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

   Optimal result
   Rubi [A] (verified)
   Mathematica [F]
   Maple [C] (warning: unable to verify)
   Fricas [F]
   Sympy [F(-1)]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 20, antiderivative size = 261 \[ \int \frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{e+f x} \, dx=-\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2 \log \left (\frac {2}{1-i (c+d x)}\right )}{f}+\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2 \log \left (\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{f}-\frac {i b \left (a+b \cot ^{-1}(c+d x)\right ) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i (c+d x)}\right )}{f}+\frac {i b \left (a+b \cot ^{-1}(c+d x)\right ) \operatorname {PolyLog}\left (2,1-\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{f}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2}{1-i (c+d x)}\right )}{2 f}+\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{2 f} \]

[Out]

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

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 261, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {5156, 4969} \[ \int \frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{e+f x} \, dx=\frac {i b \left (a+b \cot ^{-1}(c+d x)\right ) \operatorname {PolyLog}\left (2,1-\frac {2 d (e+f x)}{(d e-c f+i f) (1-i (c+d x))}\right )}{f}+\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2 \log \left (\frac {2 d (e+f x)}{(1-i (c+d x)) (-c f+d e+i f)}\right )}{f}-\frac {i b \operatorname {PolyLog}\left (2,1-\frac {2}{1-i (c+d x)}\right ) \left (a+b \cot ^{-1}(c+d x)\right )}{f}-\frac {\log \left (\frac {2}{1-i (c+d x)}\right ) \left (a+b \cot ^{-1}(c+d x)\right )^2}{f}+\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 d (e+f x)}{(d e-c f+i f) (1-i (c+d x))}\right )}{2 f}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2}{1-i (c+d x)}\right )}{2 f} \]

[In]

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

[Out]

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

Rule 4969

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

Rule 5156

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

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (a+b \cot ^{-1}(x)\right )^2}{\frac {d e-c f}{d}+\frac {f x}{d}} \, dx,x,c+d x\right )}{d} \\ & = -\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2 \log \left (\frac {2}{1-i (c+d x)}\right )}{f}+\frac {\left (a+b \cot ^{-1}(c+d x)\right )^2 \log \left (\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{f}-\frac {i b \left (a+b \cot ^{-1}(c+d x)\right ) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i (c+d x)}\right )}{f}+\frac {i b \left (a+b \cot ^{-1}(c+d x)\right ) \operatorname {PolyLog}\left (2,1-\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{f}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2}{1-i (c+d x)}\right )}{2 f}+\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 d (e+f x)}{(d e+i f-c f) (1-i (c+d x))}\right )}{2 f} \\ \end{align*}

Mathematica [F]

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

[In]

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

[Out]

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

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 14.06 (sec) , antiderivative size = 1911, normalized size of antiderivative = 7.32

method result size
derivativedivides \(\text {Expression too large to display}\) \(1911\)
default \(\text {Expression too large to display}\) \(1911\)
parts \(\text {Expression too large to display}\) \(2022\)

[In]

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

[Out]

1/d*(a^2*d*ln(c*f-d*e-f*(d*x+c))/f-b^2*d*(-ln(c*f-d*e-f*(d*x+c))/f*arccot(d*x+c)^2-2/f*(-1/2*arccot(d*x+c)^2*l
n(-I*f*(d*x+c+I)^2/(1+(d*x+c)^2)+c*f*(d*x+c+I)^2/(1+(d*x+c)^2)-d*e*(d*x+c+I)^2/(1+(d*x+c)^2)-I*f-c*f+d*e)-1/4*
I*f/(-I*f+c*f-d*e)*polylog(3,(d*e+I*f-c*f)/(-c*f+d*e-I*f)*(d*x+c+I)^2/(1+(d*x+c)^2))+1/2*arccot(d*x+c)^2*ln((d
*x+c+I)^2/(1+(d*x+c)^2)-1)-1/2*arccot(d*x+c)^2*ln(1+(d*x+c+I)/(1+(d*x+c)^2)^(1/2))+I*d*e*arccot(d*x+c)*polylog
(2,(d*e+I*f-c*f)/(-c*f+d*e-I*f)*(d*x+c+I)^2/(1+(d*x+c)^2))/(-2*I*f+2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dx=\int { \frac {{\left (b \operatorname {arccot}\left (d x + c\right ) + a\right )}^{2}}{f x + e} \,d x } \]

[In]

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

[Out]

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

Sympy [F(-1)]

Timed out. \[ \int \frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{e+f x} \, dx=\text {Timed out} \]

[In]

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

[Out]

Timed out

Maxima [F]

\[ \int \frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{e+f x} \, dx=\int { \frac {{\left (b \operatorname {arccot}\left (d x + c\right ) + a\right )}^{2}}{f x + e} \,d x } \]

[In]

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

[Out]

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

Giac [F]

\[ \int \frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{e+f x} \, dx=\int { \frac {{\left (b \operatorname {arccot}\left (d x + c\right ) + a\right )}^{2}}{f x + e} \,d x } \]

[In]

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

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \frac {\left (a+b \cot ^{-1}(c+d x)\right )^2}{e+f x} \, dx=\int \frac {{\left (a+b\,\mathrm {acot}\left (c+d\,x\right )\right )}^2}{e+f\,x} \,d x \]

[In]

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

[Out]

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