3.2.40 \(\int \frac {(a+b \cot ^{-1}(c+d x))^2}{(e+f x)^2} \, dx\) [140]

Optimal. Leaf size=567 \[ \frac {i b^2 d \cot ^{-1}(c+d x)^2}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {b^2 d (d e-c f) \cot ^{-1}(c+d x)^2}{f \left (d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2\right )}-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {2 a b d (d e-c f) \text {ArcTan}(c+d x)}{f \left (f^2+(d e-c f)^2\right )}-\frac {2 a b d \log (e+f x)}{f^2+(d e-c f)^2}+\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1+i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {a b d \log \left (1+(c+d x)^2\right )}{f^2+(d e-c f)^2}+\frac {i b^2 d \text {PolyLog}\left (2,1-\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {i b^2 d \text {PolyLog}\left (2,1-\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {i b^2 d \text {PolyLog}\left (2,1-\frac {2}{1+i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2} \]

[Out]

I*b^2*d*arccot(d*x+c)^2/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)+b^2*d*(-c*f+d*e)*arccot(d*x+c)^2/f/(d^2*e^2-2*c*d*e*f+
(c^2+1)*f^2)-(a+b*arccot(d*x+c))^2/f/(f*x+e)-2*a*b*d*(-c*f+d*e)*arctan(d*x+c)/f/(f^2+(-c*f+d*e)^2)-2*a*b*d*ln(
f*x+e)/(f^2+(-c*f+d*e)^2)+2*b^2*d*arccot(d*x+c)*ln(2/(1-I*(d*x+c)))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)-2*b^2*d*ar
ccot(d*x+c)*ln(2*d*(f*x+e)/(d*e+I*f-c*f)/(1-I*(d*x+c)))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)-2*b^2*d*arccot(d*x+c)*
ln(2/(1+I*(d*x+c)))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)+a*b*d*ln(1+(d*x+c)^2)/(f^2+(-c*f+d*e)^2)+I*b^2*d*polylog(2
,1-2/(1-I*(d*x+c)))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)-I*b^2*d*polylog(2,1-2*d*(f*x+e)/(d*e+I*f-c*f)/(1-I*(d*x+c)
))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)+I*b^2*d*polylog(2,1-2/(1+I*(d*x+c)))/(d^2*e^2-2*c*d*e*f+(c^2+1)*f^2)

________________________________________________________________________________________

Rubi [A]
time = 1.05, antiderivative size = 567, normalized size of antiderivative = 1.00, number of steps used = 25, number of rules used = 25, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.250, Rules used = {5154, 2007, 719, 31, 648, 632, 210, 642, 6873, 5166, 720, 649, 209, 266, 6820, 12, 6857, 4967, 2449, 2352, 2497, 5105, 5005, 5041, 4965} \begin {gather*} -\frac {2 a b d \text {ArcTan}(c+d x) (d e-c f)}{f \left ((d e-c f)^2+f^2\right )}-\frac {2 a b d \log (e+f x)}{(d e-c f)^2+f^2}+\frac {a b d \log \left ((c+d x)^2+1\right )}{(d e-c f)^2+f^2}-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac {i b^2 d \text {Li}_2\left (1-\frac {2}{1-i (c+d x)}\right )}{\left (c^2+1\right ) f^2-2 c d e f+d^2 e^2}-\frac {i b^2 d \text {Li}_2\left (1-\frac {2 d (e+f x)}{(d e-c f+i f) (1-i (c+d x))}\right )}{\left (c^2+1\right ) f^2-2 c d e f+d^2 e^2}+\frac {i b^2 d \text {Li}_2\left (1-\frac {2}{i (c+d x)+1}\right )}{\left (c^2+1\right ) f^2-2 c d e f+d^2 e^2}+\frac {i b^2 d \cot ^{-1}(c+d x)^2}{\left (c^2+1\right ) f^2-2 c d e f+d^2 e^2}+\frac {b^2 d (d e-c f) \cot ^{-1}(c+d x)^2}{f \left (\left (c^2+1\right ) f^2-2 c d e f+d^2 e^2\right )}+\frac {2 b^2 d \log \left (\frac {2}{1-i (c+d x)}\right ) \cot ^{-1}(c+d x)}{\left (c^2+1\right ) f^2-2 c d e f+d^2 e^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2 d (e+f x)}{(1-i (c+d x)) (-c f+d e+i f)}\right )}{\left (c^2+1\right ) f^2-2 c d e f+d^2 e^2}-\frac {2 b^2 d \log \left (\frac {2}{1+i (c+d x)}\right ) \cot ^{-1}(c+d x)}{\left (c^2+1\right ) f^2-2 c d e f+d^2 e^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*ArcCot[c + d*x])^2/(e + f*x)^2,x]

[Out]

(I*b^2*d*ArcCot[c + d*x]^2)/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2) + (b^2*d*(d*e - c*f)*ArcCot[c + d*x]^2)/(f*(
d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2)) - (a + b*ArcCot[c + d*x])^2/(f*(e + f*x)) - (2*a*b*d*(d*e - c*f)*ArcTan[
c + d*x])/(f*(f^2 + (d*e - c*f)^2)) - (2*a*b*d*Log[e + f*x])/(f^2 + (d*e - c*f)^2) + (2*b^2*d*ArcCot[c + d*x]*
Log[2/(1 - I*(c + d*x))])/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2) - (2*b^2*d*ArcCot[c + d*x]*Log[(2*d*(e + f*x))
/((d*e + I*f - c*f)*(1 - I*(c + d*x)))])/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2) - (2*b^2*d*ArcCot[c + d*x]*Log[
2/(1 + I*(c + d*x))])/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2) + (a*b*d*Log[1 + (c + d*x)^2])/(f^2 + (d*e - c*f)^
2) + (I*b^2*d*PolyLog[2, 1 - 2/(1 - I*(c + d*x))])/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2) - (I*b^2*d*PolyLog[2,
 1 - (2*d*(e + f*x))/((d*e + I*f - c*f)*(1 - I*(c + d*x)))])/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2) + (I*b^2*d*
PolyLog[2, 1 - 2/(1 + I*(c + d*x))])/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 649

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[(-a)*c]

Rule 719

Int[1/(((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)), x_Symbol] :> Dist[e^2/(c*d^2 - b*d*e + a*e^2
), Int[1/(d + e*x), x], x] + Dist[1/(c*d^2 - b*d*e + a*e^2), Int[(c*d - b*e - c*e*x)/(a + b*x + c*x^2), x], x]
 /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0]

Rule 720

Int[1/(((d_) + (e_.)*(x_))*((a_) + (c_.)*(x_)^2)), x_Symbol] :> Dist[e^2/(c*d^2 + a*e^2), Int[1/(d + e*x), x],
 x] + Dist[1/(c*d^2 + a*e^2), Int[(c*d - c*e*x)/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a
*e^2, 0]

Rule 2007

Int[(u_)^(m_.)*(v_)^(p_.), x_Symbol] :> Int[ExpandToSum[u, x]^m*ExpandToSum[v, x]^p, x] /; FreeQ[{m, p}, x] &&
 LinearQ[u, x] && QuadraticQ[v, x] &&  !(LinearMatchQ[u, x] && QuadraticMatchQ[v, x])

Rule 2352

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-e^(-1))*PolyLog[2, 1 - c*x], x] /; FreeQ[{c, d, e
}, x] && EqQ[e + c*d, 0]

Rule 2449

Int[Log[(c_.)/((d_) + (e_.)*(x_))]/((f_) + (g_.)*(x_)^2), x_Symbol] :> Dist[-e/g, Subst[Int[Log[2*d*x]/(1 - 2*
d*x), x], x, 1/(d + e*x)], x] /; FreeQ[{c, d, e, f, g}, x] && EqQ[c, 2*d] && EqQ[e^2*f + d^2*g, 0]

Rule 2497

Int[Log[u_]*(Pq_)^(m_.), x_Symbol] :> With[{C = FullSimplify[Pq^m*((1 - u)/D[u, x])]}, Simp[C*PolyLog[2, 1 - u
], x] /; FreeQ[C, x]] /; IntegerQ[m] && PolyQ[Pq, x] && RationalFunctionQ[u, x] && LeQ[RationalFunctionExponen
ts[u, x][[2]], Expon[Pq, x]]

Rule 4965

Int[((a_.) + ArcCot[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-(a + b*ArcCot[c*x])^p)*(
Log[2/(1 + e*(x/d))]/e), x] - Dist[b*c*(p/e), Int[(a + b*ArcCot[c*x])^(p - 1)*(Log[2/(1 + e*(x/d))]/(1 + c^2*x
^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[c^2*d^2 + e^2, 0]

Rule 4967

Int[((a_.) + ArcCot[(c_.)*(x_)]*(b_.))/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-(a + b*ArcCot[c*x]))*(Log[2/(1
 - I*c*x)]/e), x] + (-Dist[b*(c/e), Int[Log[2/(1 - I*c*x)]/(1 + c^2*x^2), x], x] + Dist[b*(c/e), Int[Log[2*c*(
(d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/(1 + c^2*x^2), x], x] + Simp[(a + b*ArcCot[c*x])*(Log[2*c*((d + e*x)/((c
*d + I*e)*(1 - I*c*x)))]/e), x]) /; FreeQ[{a, b, c, d, e}, x] && NeQ[c^2*d^2 + e^2, 0]

Rule 5005

Int[((a_.) + ArcCot[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[-(a + b*ArcCot[c*x])^(p
+ 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 5041

Int[(((a_.) + ArcCot[(c_.)*(x_)]*(b_.))^(p_.)*(x_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[I*((a + b*ArcCot[
c*x])^(p + 1)/(b*e*(p + 1))), x] - Dist[1/(c*d), Int[(a + b*ArcCot[c*x])^p/(I - c*x), x], x] /; FreeQ[{a, b, c
, d, e}, x] && EqQ[e, c^2*d] && IGtQ[p, 0]

Rule 5105

Int[(((a_.) + ArcCot[(c_.)*(x_)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(m_.))/((d_) + (e_.)*(x_)^2), x_Symbol] :> I
nt[ExpandIntegrand[(a + b*ArcCot[c*x])^p/(d + e*x^2), (f + g*x)^m, x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &
& IGtQ[p, 0] && EqQ[e, c^2*d] && IGtQ[m, 0]

Rule 5154

Int[((a_.) + ArcCot[(c_) + (d_.)*(x_)]*(b_.))^(p_.)*((e_.) + (f_.)*(x_))^(m_), x_Symbol] :> Simp[(e + f*x)^(m
+ 1)*((a + b*ArcCot[c + d*x])^p/(f*(m + 1))), x] + Dist[b*d*(p/(f*(m + 1))), Int[(e + f*x)^(m + 1)*((a + b*Arc
Cot[c + d*x])^(p - 1)/(1 + (c + d*x)^2)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[p, 0] && ILtQ[m, -1]

Rule 5166

Int[((a_.) + ArcCot[(c_) + (d_.)*(x_)]*(b_.))^(p_.)*((e_.) + (f_.)*(x_))^(m_.)*((A_.) + (B_.)*(x_) + (C_.)*(x_
)^2)^(q_.), x_Symbol] :> Dist[1/d, Subst[Int[((d*e - c*f)/d + f*(x/d))^m*(C/d^2 + (C/d^2)*x^2)^q*(a + b*ArcCot
[x])^p, x], x, c + d*x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m, p, q}, x] && EqQ[B*(1 + c^2) - 2*A*c*d, 0]
 && EqQ[2*c*C - B*d, 0]

Rule 6820

Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; SimplerIntegrandQ[v, u, x]]

Rule 6857

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

Rule 6873

Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =!= u]

Rubi steps

\begin {align*} \int \frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{(e+f x)^2} \, dx &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {(2 b d) \int \frac {a+b \cot ^{-1}(c+d x)}{(e+f x) \left (1+(c+d x)^2\right )} \, dx}{f}\\ &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {(2 b d) \int \frac {a+b \cot ^{-1}(c+d x)}{(e+f x) \left (1+c^2+2 c d x+d^2 x^2\right )} \, dx}{f}\\ &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {(2 b) \text {Subst}\left (\int \frac {a+b \cot ^{-1}(x)}{\left (\frac {d e-c f}{d}+\frac {f x}{d}\right ) \left (1+x^2\right )} \, dx,x,c+d x\right )}{f}\\ &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {(2 b) \text {Subst}\left (\int \frac {d \left (a+b \cot ^{-1}(x)\right )}{(d e-c f+f x) \left (1+x^2\right )} \, dx,x,c+d x\right )}{f}\\ &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {(2 b d) \text {Subst}\left (\int \frac {a+b \cot ^{-1}(x)}{(d e-c f+f x) \left (1+x^2\right )} \, dx,x,c+d x\right )}{f}\\ &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {(2 b d) \text {Subst}\left (\int \left (\frac {a}{(d e-c f+f x) \left (1+x^2\right )}+\frac {b \cot ^{-1}(x)}{(d e-c f+f x) \left (1+x^2\right )}\right ) \, dx,x,c+d x\right )}{f}\\ &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {(2 a b d) \text {Subst}\left (\int \frac {1}{(d e-c f+f x) \left (1+x^2\right )} \, dx,x,c+d x\right )}{f}-\frac {\left (2 b^2 d\right ) \text {Subst}\left (\int \frac {\cot ^{-1}(x)}{(d e-c f+f x) \left (1+x^2\right )} \, dx,x,c+d x\right )}{f}\\ &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {\left (2 b^2 d\right ) \text {Subst}\left (\int \left (\frac {f^2 \cot ^{-1}(x)}{\left (d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2\right ) (d e-c f+f x)}+\frac {(d e-c f-f x) \cot ^{-1}(x)}{\left (d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2\right ) \left (1+x^2\right )}\right ) \, dx,x,c+d x\right )}{f}-\frac {(2 a b d) \text {Subst}\left (\int \frac {d e-c f-f x}{1+x^2} \, dx,x,c+d x\right )}{f \left (f^2+(d e-c f)^2\right )}-\frac {(2 a b d f) \text {Subst}\left (\int \frac {1}{d e-c f+f x} \, dx,x,c+d x\right )}{f^2+(d e-c f)^2}\\ &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {2 a b d \log (e+f x)}{f^2+(d e-c f)^2}-\frac {\left (2 b^2 d\right ) \text {Subst}\left (\int \frac {(d e-c f-f x) \cot ^{-1}(x)}{1+x^2} \, dx,x,c+d x\right )}{f \left (d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2\right )}-\frac {\left (2 b^2 d f\right ) \text {Subst}\left (\int \frac {\cot ^{-1}(x)}{d e-c f+f x} \, dx,x,c+d x\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {(2 a b d) \text {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,c+d x\right )}{f^2+(d e-c f)^2}-\frac {(2 a b d (d e-c f)) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,c+d x\right )}{f \left (f^2+(d e-c f)^2\right )}\\ &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {2 a b d (d e-c f) \tan ^{-1}(c+d x)}{f \left (f^2+(d e-c f)^2\right )}-\frac {2 a b d \log (e+f x)}{f^2+(d e-c f)^2}+\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {a b d \log \left (1+(c+d x)^2\right )}{f^2+(d e-c f)^2}+\frac {\left (2 b^2 d\right ) \text {Subst}\left (\int \frac {\log \left (\frac {2}{1-i x}\right )}{1+x^2} \, dx,x,c+d x\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {\left (2 b^2 d\right ) \text {Subst}\left (\int \frac {\log \left (\frac {2 (d e-c f+f x)}{(d e+i f-c f) (1-i x)}\right )}{1+x^2} \, dx,x,c+d x\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {\left (2 b^2 d\right ) \text {Subst}\left (\int \left (\frac {d e \left (1-\frac {c f}{d e}\right ) \cot ^{-1}(x)}{1+x^2}-\frac {f x \cot ^{-1}(x)}{1+x^2}\right ) \, dx,x,c+d x\right )}{f \left (d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2\right )}\\ &=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {2 a b d (d e-c f) \tan ^{-1}(c+d x)}{f \left (f^2+(d e-c f)^2\right )}-\frac {2 a b d \log (e+f x)}{f^2+(d e-c f)^2}+\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {a b d \log \left (1+(c+d x)^2\right )}{f^2+(d e-c f)^2}-\frac {i b^2 d \text {Li}_2\left (1-\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {\left (2 i b^2 d\right ) \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {\left (2 b^2 d\right ) \text {Subst}\left (\int \frac {x \cot ^{-1}(x)}{1+x^2} \, dx,x,c+d x\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {\left (2 b^2 d (d e-c f)\right ) \text {Subst}\left (\int \frac {\cot ^{-1}(x)}{1+x^2} \, dx,x,c+d x\right )}{f \left (d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2\right )}\\ &=\frac {i b^2 d \cot ^{-1}(c+d x)^2}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {b^2 d (d e-c f) \cot ^{-1}(c+d x)^2}{f \left (d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2\right )}-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {2 a b d (d e-c f) \tan ^{-1}(c+d x)}{f \left (f^2+(d e-c f)^2\right )}-\frac {2 a b d \log (e+f x)}{f^2+(d e-c f)^2}+\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {a b d \log \left (1+(c+d x)^2\right )}{f^2+(d e-c f)^2}+\frac {i b^2 d \text {Li}_2\left (1-\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {i b^2 d \text {Li}_2\left (1-\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {\left (2 b^2 d\right ) \text {Subst}\left (\int \frac {\cot ^{-1}(x)}{i-x} \, dx,x,c+d x\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}\\ &=\frac {i b^2 d \cot ^{-1}(c+d x)^2}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {b^2 d (d e-c f) \cot ^{-1}(c+d x)^2}{f \left (d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2\right )}-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {2 a b d (d e-c f) \tan ^{-1}(c+d x)}{f \left (f^2+(d e-c f)^2\right )}-\frac {2 a b d \log (e+f x)}{f^2+(d e-c f)^2}+\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1+i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {a b d \log \left (1+(c+d x)^2\right )}{f^2+(d e-c f)^2}+\frac {i b^2 d \text {Li}_2\left (1-\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {i b^2 d \text {Li}_2\left (1-\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {\left (2 b^2 d\right ) \text {Subst}\left (\int \frac {\log \left (\frac {2}{1+i x}\right )}{1+x^2} \, dx,x,c+d x\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}\\ &=\frac {i b^2 d \cot ^{-1}(c+d x)^2}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {b^2 d (d e-c f) \cot ^{-1}(c+d x)^2}{f \left (d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2\right )}-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {2 a b d (d e-c f) \tan ^{-1}(c+d x)}{f \left (f^2+(d e-c f)^2\right )}-\frac {2 a b d \log (e+f x)}{f^2+(d e-c f)^2}+\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1+i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {a b d \log \left (1+(c+d x)^2\right )}{f^2+(d e-c f)^2}+\frac {i b^2 d \text {Li}_2\left (1-\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {i b^2 d \text {Li}_2\left (1-\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {\left (2 i b^2 d\right ) \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1+i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}\\ &=\frac {i b^2 d \cot ^{-1}(c+d x)^2}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {b^2 d (d e-c f) \cot ^{-1}(c+d x)^2}{f \left (d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2\right )}-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac {2 a b d (d e-c f) \tan ^{-1}(c+d x)}{f \left (f^2+(d e-c f)^2\right )}-\frac {2 a b d \log (e+f x)}{f^2+(d e-c f)^2}+\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {2 b^2 d \cot ^{-1}(c+d x) \log \left (\frac {2}{1+i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {a b d \log \left (1+(c+d x)^2\right )}{f^2+(d e-c f)^2}+\frac {i b^2 d \text {Li}_2\left (1-\frac {2}{1-i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}-\frac {i b^2 d \text {Li}_2\left (1-\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {i b^2 d \text {Li}_2\left (1-\frac {2}{1+i (c+d x)}\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 6.16, size = 454, normalized size = 0.80 \begin {gather*} -\frac {a^2+\frac {2 a b f \left (\left (-c d e+f+c^2 f-d^2 e x+c d f x\right ) \cot ^{-1}(c+d x)+d (e+f x) \log \left (-\frac {d (e+f x)}{(c+d x) \sqrt {1+\frac {1}{(c+d x)^2}}}\right )\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}+\frac {b^2 d (e+f x) \left (1+(c+d x)^2\right ) \left (\frac {e^{i \text {ArcTan}\left (\frac {f}{d e-c f}\right )} \cot ^{-1}(c+d x)^2}{(-d e+c f) \sqrt {1+\frac {f^2}{(d e-c f)^2}}}+\frac {\cot ^{-1}(c+d x)^2}{d e+d f x}+\frac {f \left (i \pi \cot ^{-1}(c+d x)+\pi \log \left (1+e^{-2 i \cot ^{-1}(c+d x)}\right )+2 \cot ^{-1}(c+d x) \log \left (1-e^{2 i \left (\cot ^{-1}(c+d x)+\text {ArcTan}\left (\frac {f}{d e-c f}\right )\right )}\right )-\pi \log \left (\frac {1}{\sqrt {1+\frac {1}{(c+d x)^2}}}\right )+2 \text {ArcTan}\left (\frac {f}{-d e+c f}\right ) \left (i \cot ^{-1}(c+d x)-\log \left (1-e^{2 i \left (\cot ^{-1}(c+d x)+\text {ArcTan}\left (\frac {f}{d e-c f}\right )\right )}\right )+\log \left (\sin \left (\cot ^{-1}(c+d x)+\text {ArcTan}\left (\frac {f}{d e-c f}\right )\right )\right )\right )-i \text {PolyLog}\left (2,e^{2 i \left (\cot ^{-1}(c+d x)+\text {ArcTan}\left (\frac {f}{d e-c f}\right )\right )}\right )\right )}{d^2 e^2-2 c d e f+\left (1+c^2\right ) f^2}\right )}{(c+d x)^2 \left (1+\frac {1}{(c+d x)^2}\right )}}{f (e+f x)} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[(a + b*ArcCot[c + d*x])^2/(e + f*x)^2,x]

[Out]

-((a^2 + (2*a*b*f*((-(c*d*e) + f + c^2*f - d^2*e*x + c*d*f*x)*ArcCot[c + d*x] + d*(e + f*x)*Log[-((d*(e + f*x)
)/((c + d*x)*Sqrt[1 + (c + d*x)^(-2)]))]))/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2) + (b^2*d*(e + f*x)*(1 + (c +
d*x)^2)*((E^(I*ArcTan[f/(d*e - c*f)])*ArcCot[c + d*x]^2)/((-(d*e) + c*f)*Sqrt[1 + f^2/(d*e - c*f)^2]) + ArcCot
[c + d*x]^2/(d*e + d*f*x) + (f*(I*Pi*ArcCot[c + d*x] + Pi*Log[1 + E^((-2*I)*ArcCot[c + d*x])] + 2*ArcCot[c + d
*x]*Log[1 - E^((2*I)*(ArcCot[c + d*x] + ArcTan[f/(d*e - c*f)]))] - Pi*Log[1/Sqrt[1 + (c + d*x)^(-2)]] + 2*ArcT
an[f/(-(d*e) + c*f)]*(I*ArcCot[c + d*x] - Log[1 - E^((2*I)*(ArcCot[c + d*x] + ArcTan[f/(d*e - c*f)]))] + Log[S
in[ArcCot[c + d*x] + ArcTan[f/(d*e - c*f)]]]) - I*PolyLog[2, E^((2*I)*(ArcCot[c + d*x] + ArcTan[f/(d*e - c*f)]
))]))/(d^2*e^2 - 2*c*d*e*f + (1 + c^2)*f^2)))/((c + d*x)^2*(1 + (c + d*x)^(-2))))/(f*(e + f*x)))

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1253 vs. \(2 (555 ) = 1110\).
time = 2.06, size = 1254, normalized size = 2.21 Too large to display

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*arccot(d*x+c))^2/(f*x+e)^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(2*a*b*d^2/(c*f-d*e-f*(d*x+c))/f*arccot(d*x+c)-2*a*b*d^3/f/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*arctan(d*x+c)*e
-2*b^2*d^3/f*arccot(d*x+c)/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*arctan(d*x+c)*e+2*a*b*d^2/(c^2*f^2-2*c*d*e*f+d^2*e^
2+f^2)*arctan(d*x+c)*c+a^2*d^2/(c*f-d*e-f*(d*x+c))/f-1/2*I*b^2*d^2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*ln(d*x+c+I)
*ln(1/2*I*(d*x+c-I))+1/2*I*b^2*d^2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*ln(d*x+c-I)*ln(-1/2*I*(d*x+c+I))-1/2*I*b^2*
d^2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*ln(d*x+c-I)*ln(1+(d*x+c)^2)-b^2*d^3/f/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*arct
an(d*x+c)^2*e+I*b^2*d^2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*ln(c*f-d*e-f*(d*x+c))*ln((I*f-f*(d*x+c))/(d*e+I*f-c*f)
)+1/2*I*b^2*d^2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*ln(d*x+c+I)*ln(1+(d*x+c)^2)-I*b^2*d^2/(c^2*f^2-2*c*d*e*f+d^2*e
^2+f^2)*ln(c*f-d*e-f*(d*x+c))*ln((I*f+f*(d*x+c))/(c*f-d*e+I*f))+2*b^2*d^2*arccot(d*x+c)/(c^2*f^2-2*c*d*e*f+d^2
*e^2+f^2)*arctan(d*x+c)*c-1/4*I*b^2*d^2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*ln(d*x+c+I)^2-1/2*I*b^2*d^2/(c^2*f^2-2
*c*d*e*f+d^2*e^2+f^2)*dilog(1/2*I*(d*x+c-I))-I*b^2*d^2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*dilog((I*f+f*(d*x+c))/(
c*f-d*e+I*f))+1/2*I*b^2*d^2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*dilog(-1/2*I*(d*x+c+I))+1/4*I*b^2*d^2/(c^2*f^2-2*c
*d*e*f+d^2*e^2+f^2)*ln(d*x+c-I)^2+I*b^2*d^2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*dilog((I*f-f*(d*x+c))/(d*e+I*f-c*f
))+b^2*d^2/(c*f-d*e-f*(d*x+c))/f*arccot(d*x+c)^2-2*b^2*d^2*arccot(d*x+c)/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*ln(c*
f-d*e-f*(d*x+c))+b^2*d^2*arccot(d*x+c)/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*ln(1+(d*x+c)^2)+b^2*d^2/(c^2*f^2-2*c*d*
e*f+d^2*e^2+f^2)*arctan(d*x+c)^2*c-2*a*b*d^2/(c^2*f^2-2*c*d*e*f+d^2*e^2+f^2)*ln(c*f-d*e-f*(d*x+c))+a*b*d^2/(c^
2*f^2-2*c*d*e*f+d^2*e^2+f^2)*ln(1+(d*x+c)^2))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arccot(d*x+c))^2/(f*x+e)^2,x, algorithm="maxima")

[Out]

-(d*(2*(c*d*f - d^2*e)*arctan((d^2*x + c*d)/d)/((2*c*d*f^2*e - (c^2 + 1)*f^3 - d^2*f*e^2)*d) + log(d^2*x^2 + 2
*c*d*x + c^2 + 1)/(2*c*d*f*e - (c^2 + 1)*f^2 - d^2*e^2) - 2*log(f*x + e)/(2*c*d*f*e - (c^2 + 1)*f^2 - d^2*e^2)
) + 2*arccot(d*x + c)/(f^2*x + f*e))*a*b - 1/16*(4*arctan2(1, d*x + c)^2 - 16*(f^2*x + f*e)*integrate(1/16*(12
*d^2*f*x^2*arctan2(1, d*x + c)^2 + 8*(3*c*arctan2(1, d*x + c)^2 - arctan2(1, d*x + c))*d*f*x - 8*d*arctan2(1,
d*x + c)*e + (d^2*f*x^2 + 2*c*d*f*x + (c^2 + 1)*f)*log(d^2*x^2 + 2*c*d*x + c^2 + 1)^2 + 12*(c^2*arctan2(1, d*x
 + c)^2 + arctan2(1, d*x + c)^2)*f - 4*(d^2*f*x^2 + c*d*e + (c*d*f + d^2*e)*x)*log(d^2*x^2 + 2*c*d*x + c^2 + 1
))/(d^2*f^3*x^4 + 2*(c*d*f^3 + d^2*f^2*e)*x^3 + (4*c*d*f^2*e + (c^2 + 1)*f^3 + d^2*f*e^2)*x^2 + (c^2*e^2 + e^2
)*f + 2*(c*d*f*e^2 + (c^2*e + e)*f^2)*x), x) - log(d^2*x^2 + 2*c*d*x + c^2 + 1)^2)*b^2/(f^2*x + f*e) - a^2/(f^
2*x + f*e)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arccot(d*x+c))^2/(f*x+e)^2,x, algorithm="fricas")

[Out]

integral((b^2*arccot(d*x + c)^2 + 2*a*b*arccot(d*x + c) + a^2)/(f^2*x^2 + 2*f*x*e + e^2), x)

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*acot(d*x+c))**2/(f*x+e)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*arccot(d*x+c))^2/(f*x+e)^2,x, algorithm="giac")

[Out]

Timed out

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (a+b\,\mathrm {acot}\left (c+d\,x\right )\right )}^2}{{\left (e+f\,x\right )}^2} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*acot(c + d*x))^2/(e + f*x)^2,x)

[Out]

int((a + b*acot(c + d*x))^2/(e + f*x)^2, x)

________________________________________________________________________________________