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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [B] (verified)
Fricas [F]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

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

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

Mathematica [A] (verified)

Time = 5.09 (sec) , antiderivative size = 630, normalized size of antiderivative = 1.87 \[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right )^3 \, dx=\frac {a^2 (2 a d e+3 b f-2 a c f) (c+d x)+a^3 f (c+d x)^2-3 a^2 b (c+d x) (c f-d (2 e+f x)) \cot ^{-1}(c+d x)-3 a^2 b f \arctan (c+d x)+6 a b^2 f \left ((c+d x) \cot ^{-1}(c+d x)+\frac {1}{2} \left (1+(c+d x)^2\right ) \cot ^{-1}(c+d x)^2-\log \left (\frac {1}{(c+d x) \sqrt {1+\frac {1}{(c+d x)^2}}}\right )\right )+3 a^2 b (d e-c f) \log \left (1+(c+d x)^2\right )+6 a b^2 d e \left (\cot ^{-1}(c+d x) \left ((i+c+d x) \cot ^{-1}(c+d x)-2 \log \left (1-e^{2 i \cot ^{-1}(c+d x)}\right )\right )+i \operatorname {PolyLog}\left (2,e^{2 i \cot ^{-1}(c+d x)}\right )\right )-6 a b^2 c f \left (\cot ^{-1}(c+d x) \left ((i+c+d x) \cot ^{-1}(c+d x)-2 \log \left (1-e^{2 i \cot ^{-1}(c+d x)}\right )\right )+i \operatorname {PolyLog}\left (2,e^{2 i \cot ^{-1}(c+d x)}\right )\right )+b^3 f \left (3 (c+d x) \cot ^{-1}(c+d x)^2+\left (1+(c+d x)^2\right ) \cot ^{-1}(c+d x)^3-6 \cot ^{-1}(c+d x) \log \left (1-e^{2 i \cot ^{-1}(c+d x)}\right )+3 i \left (\cot ^{-1}(c+d x)^2+\operatorname {PolyLog}\left (2,e^{2 i \cot ^{-1}(c+d x)}\right )\right )\right )+2 b^3 d e \left (\frac {i \pi ^3}{8}-i \cot ^{-1}(c+d x)^3+(c+d x) \cot ^{-1}(c+d x)^3-3 \cot ^{-1}(c+d x)^2 \log \left (1-e^{-2 i \cot ^{-1}(c+d x)}\right )-3 i \cot ^{-1}(c+d x) \operatorname {PolyLog}\left (2,e^{-2 i \cot ^{-1}(c+d x)}\right )-\frac {3}{2} \operatorname {PolyLog}\left (3,e^{-2 i \cot ^{-1}(c+d x)}\right )\right )-2 b^3 c f \left (\frac {i \pi ^3}{8}-i \cot ^{-1}(c+d x)^3+(c+d x) \cot ^{-1}(c+d x)^3-3 \cot ^{-1}(c+d x)^2 \log \left (1-e^{-2 i \cot ^{-1}(c+d x)}\right )-3 i \cot ^{-1}(c+d x) \operatorname {PolyLog}\left (2,e^{-2 i \cot ^{-1}(c+d x)}\right )-\frac {3}{2} \operatorname {PolyLog}\left (3,e^{-2 i \cot ^{-1}(c+d x)}\right )\right )}{2 d^2} \] Input:

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

Output:

(a^2*(2*a*d*e + 3*b*f - 2*a*c*f)*(c + d*x) + a^3*f*(c + d*x)^2 - 3*a^2*b*( 
c + d*x)*(c*f - d*(2*e + f*x))*ArcCot[c + d*x] - 3*a^2*b*f*ArcTan[c + d*x] 
 + 6*a*b^2*f*((c + d*x)*ArcCot[c + d*x] + ((1 + (c + d*x)^2)*ArcCot[c + d* 
x]^2)/2 - Log[1/((c + d*x)*Sqrt[1 + (c + d*x)^(-2)])]) + 3*a^2*b*(d*e - c* 
f)*Log[1 + (c + d*x)^2] + 6*a*b^2*d*e*(ArcCot[c + d*x]*((I + c + d*x)*ArcC 
ot[c + d*x] - 2*Log[1 - E^((2*I)*ArcCot[c + d*x])]) + I*PolyLog[2, E^((2*I 
)*ArcCot[c + d*x])]) - 6*a*b^2*c*f*(ArcCot[c + d*x]*((I + c + d*x)*ArcCot[ 
c + d*x] - 2*Log[1 - E^((2*I)*ArcCot[c + d*x])]) + I*PolyLog[2, E^((2*I)*A 
rcCot[c + d*x])]) + b^3*f*(3*(c + d*x)*ArcCot[c + d*x]^2 + (1 + (c + d*x)^ 
2)*ArcCot[c + d*x]^3 - 6*ArcCot[c + d*x]*Log[1 - E^((2*I)*ArcCot[c + d*x]) 
] + (3*I)*(ArcCot[c + d*x]^2 + PolyLog[2, E^((2*I)*ArcCot[c + d*x])])) + 2 
*b^3*d*e*((I/8)*Pi^3 - I*ArcCot[c + d*x]^3 + (c + d*x)*ArcCot[c + d*x]^3 - 
 3*ArcCot[c + d*x]^2*Log[1 - E^((-2*I)*ArcCot[c + d*x])] - (3*I)*ArcCot[c 
+ d*x]*PolyLog[2, E^((-2*I)*ArcCot[c + d*x])] - (3*PolyLog[3, E^((-2*I)*Ar 
cCot[c + d*x])])/2) - 2*b^3*c*f*((I/8)*Pi^3 - I*ArcCot[c + d*x]^3 + (c + d 
*x)*ArcCot[c + d*x]^3 - 3*ArcCot[c + d*x]^2*Log[1 - E^((-2*I)*ArcCot[c + d 
*x])] - (3*I)*ArcCot[c + d*x]*PolyLog[2, E^((-2*I)*ArcCot[c + d*x])] - (3* 
PolyLog[3, E^((-2*I)*ArcCot[c + d*x])])/2))/(2*d^2)
 

Rubi [A] (verified)

Time = 0.89 (sec) , antiderivative size = 334, normalized size of antiderivative = 0.99, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {5571, 27, 5390, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right )^3 \, dx\)

\(\Big \downarrow \) 5571

\(\displaystyle \frac {\int \frac {\left (d \left (e-\frac {c f}{d}\right )+f (c+d x)\right ) \left (a+b \cot ^{-1}(c+d x)\right )^3}{d}d(c+d x)}{d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\int (d e-c f+f (c+d x)) \left (a+b \cot ^{-1}(c+d x)\right )^3d(c+d x)}{d^2}\)

\(\Big \downarrow \) 5390

\(\displaystyle \frac {\frac {3 b \int \left (f^2 \left (a+b \cot ^{-1}(c+d x)\right )^2+\frac {((d e-c f+f) (d e-(c+1) f)+2 f (d e-c f) (c+d x)) \left (a+b \cot ^{-1}(c+d x)\right )^2}{(c+d x)^2+1}\right )d(c+d x)}{2 f}+\frac {(f (c+d x)-c f+d e)^2 \left (a+b \cot ^{-1}(c+d x)\right )^3}{2 f}}{d^2}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {(f (c+d x)-c f+d e)^2 \left (a+b \cot ^{-1}(c+d x)\right )^3}{2 f}+\frac {3 b \left (2 i b f (d e-c f) \operatorname {PolyLog}\left (2,1-\frac {2}{i (c+d x)+1}\right ) \left (a+b \cot ^{-1}(c+d x)\right )+\frac {2 i f (d e-c f) \left (a+b \cot ^{-1}(c+d x)\right )^3}{3 b}-\frac {(-c f+d e+f) (d e-(c+1) f) \left (a+b \cot ^{-1}(c+d x)\right )^3}{3 b}-2 f (d e-c f) \log \left (\frac {2}{1+i (c+d x)}\right ) \left (a+b \cot ^{-1}(c+d x)\right )^2+i f^2 \left (a+b \cot ^{-1}(c+d x)\right )^2+f^2 (c+d x) \left (a+b \cot ^{-1}(c+d x)\right )^2-2 b f^2 \log \left (\frac {2}{1+i (c+d x)}\right ) \left (a+b \cot ^{-1}(c+d x)\right )-b^2 f (d e-c f) \operatorname {PolyLog}\left (3,1-\frac {2}{i (c+d x)+1}\right )+i b^2 f^2 \operatorname {PolyLog}\left (2,1-\frac {2}{i (c+d x)+1}\right )\right )}{2 f}}{d^2}\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 5390
Int[((a_.) + ArcCot[(c_.)*(x_)]*(b_.))^(p_)*((d_) + (e_.)*(x_))^(q_.), x_Sy 
mbol] :> Simp[(d + e*x)^(q + 1)*((a + b*ArcCot[c*x])^p/(e*(q + 1))), x] + S 
imp[b*c*(p/(e*(q + 1)))   Int[ExpandIntegrand[(a + b*ArcCot[c*x])^(p - 1), 
(d + e*x)^(q + 1)/(1 + c^2*x^2), x], x], x] /; FreeQ[{a, b, c, d, e}, x] && 
 IGtQ[p, 1] && IntegerQ[q] && NeQ[q, -1]
 

rule 5571
Int[((a_.) + ArcCot[(c_) + (d_.)*(x_)]*(b_.))^(p_.)*((e_.) + (f_.)*(x_))^(m 
_.), x_Symbol] :> Simp[1/d   Subst[Int[((d*e - c*f)/d + f*(x/d))^m*(a + b*A 
rcCot[x])^p, x], x, c + d*x], x] /; FreeQ[{a, b, c, d, e, f, m, p}, x] && I 
GtQ[p, 0]
 
Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1050 vs. \(2 (316 ) = 632\).

Time = 12.46 (sec) , antiderivative size = 1051, normalized size of antiderivative = 3.12

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

Input:

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

Output:

a^3*(1/2*f*x^2+e*x)+b^3/d*(1/2/d*arccot(d*x+c)^3*(d*x+c)^2*f-1/d*arccot(d* 
x+c)^3*c*f*(d*x+c)+arccot(d*x+c)^3*e*(d*x+c)+3/2/d*(1/3*f*arccot(d*x+c)^3+ 
4*I*d*e*arccot(d*x+c)*polylog(2,-(d*x+c+I)/(1+(d*x+c)^2)^(1/2))+arccot(d*x 
+c)^2*f*(d*x+c-I)-4*I*c*f*arccot(d*x+c)*polylog(2,(d*x+c+I)/(1+(d*x+c)^2)^ 
(1/2))-4*I*c*f*arccot(d*x+c)*polylog(2,-(d*x+c+I)/(1+(d*x+c)^2)^(1/2))+4*p 
olylog(3,-(d*x+c+I)/(1+(d*x+c)^2)^(1/2))*c*f-2/3*I*arccot(d*x+c)^3*c*f+4*p 
olylog(3,(d*x+c+I)/(1+(d*x+c)^2)^(1/2))*c*f-2*f*arccot(d*x+c)*ln(1-(d*x+c+ 
I)/(1+(d*x+c)^2)^(1/2))+2*I*f*polylog(2,(d*x+c+I)/(1+(d*x+c)^2)^(1/2))-4*p 
olylog(3,(d*x+c+I)/(1+(d*x+c)^2)^(1/2))*d*e+2*I*f*arccot(d*x+c)^2-2*ln(1-( 
d*x+c+I)/(1+(d*x+c)^2)^(1/2))*d*e*arccot(d*x+c)^2+2/3*I*arccot(d*x+c)^3*d* 
e+2*ln(1+(d*x+c+I)/(1+(d*x+c)^2)^(1/2))*c*f*arccot(d*x+c)^2+2*I*f*polylog( 
2,-(d*x+c+I)/(1+(d*x+c)^2)^(1/2))+4*I*d*e*arccot(d*x+c)*polylog(2,(d*x+c+I 
)/(1+(d*x+c)^2)^(1/2))+2*ln(1-(d*x+c+I)/(1+(d*x+c)^2)^(1/2))*c*f*arccot(d* 
x+c)^2-2*ln(1+(d*x+c+I)/(1+(d*x+c)^2)^(1/2))*d*e*arccot(d*x+c)^2-2*f*arcco 
t(d*x+c)*ln(1+(d*x+c+I)/(1+(d*x+c)^2)^(1/2))-4*polylog(3,-(d*x+c+I)/(1+(d* 
x+c)^2)^(1/2))*d*e))+3*a*b^2/d*(1/2/d*arccot(d*x+c)^2*(d*x+c)^2*f-1/d*arcc 
ot(d*x+c)^2*c*f*(d*x+c)+arccot(d*x+c)^2*e*(d*x+c)+1/d*(-ln(1+(d*x+c)^2)*ar 
ccot(d*x+c)*c*f+ln(1+(d*x+c)^2)*arccot(d*x+c)*d*e-arctan(d*x+c)*arccot(d*x 
+c)*f+arccot(d*x+c)*f*(d*x+c)+1/2*f*ln(1+(d*x+c)^2)-1/2*arctan(d*x+c)^2*f+ 
1/2*(-2*c*f+2*d*e)*(-1/2*I*(ln(d*x+c-I)*ln(1+(d*x+c)^2)-1/2*ln(d*x+c-I)...
 

Fricas [F]

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

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

Output:

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

Sympy [F]

\[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right )^3 \, dx=\int \left (a + b \operatorname {acot}{\left (c + d x \right )}\right )^{3} \left (e + f x\right )\, dx \] Input:

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

Output:

Integral((a + b*acot(c + d*x))**3*(e + f*x), x)
 

Maxima [F]

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

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

Output:

1/16*b^3*f*x^2*arctan2(1, d*x + c)^3 + 1/8*b^3*e*x*arctan2(1, d*x + c)^3 + 
 1/2*a^3*f*x^2 + 3/2*(x^2*arccot(d*x + c) + d*(x/d^2 + (c^2 - 1)*arctan((d 
^2*x + c*d)/d)/d^3 - c*log(d^2*x^2 + 2*c*d*x + c^2 + 1)/d^3))*a^2*b*f + a^ 
3*e*x + 3/2*(2*(d*x + c)*arccot(d*x + c) + log((d*x + c)^2 + 1))*a^2*b*e/d 
 - 3/64*(b^3*f*x^2*arctan2(1, d*x + c) + 2*b^3*e*x*arctan2(1, d*x + c))*lo 
g(d^2*x^2 + 2*c*d*x + c^2 + 1)^2 + integrate(1/64*(8*(7*b^3*arctan2(1, d*x 
 + c)^3 + 24*a*b^2*arctan2(1, d*x + c)^2)*d^2*f*x^3 + 4*(2*(7*b^3*arctan2( 
1, d*x + c)^3 + 24*a*b^2*arctan2(1, d*x + c)^2)*d^2*e + (3*b^3*arctan2(1, 
d*x + c)^2 + 4*(7*b^3*arctan2(1, d*x + c)^3 + 24*a*b^2*arctan2(1, d*x + c) 
^2)*c)*d*f)*x^2 + 3*(2*b^3*d^2*f*x^3*arctan2(1, d*x + c) + (2*b^3*d^2*e*ar 
ctan2(1, d*x + c) + (4*b^3*c*arctan2(1, d*x + c) - b^3)*d*f)*x^2 + 2*(b^3* 
c^2*arctan2(1, d*x + c) + b^3*arctan2(1, d*x + c))*e + 2*((2*b^3*c*arctan2 
(1, d*x + c) - b^3)*d*e + (b^3*c^2*arctan2(1, d*x + c) + b^3*arctan2(1, d* 
x + c))*f)*x)*log(d^2*x^2 + 2*c*d*x + c^2 + 1)^2 + 8*(7*b^3*arctan2(1, d*x 
 + c)^3 + 24*a*b^2*arctan2(1, d*x + c)^2 + (7*b^3*arctan2(1, d*x + c)^3 + 
24*a*b^2*arctan2(1, d*x + c)^2)*c^2)*e + 8*((3*b^3*arctan2(1, d*x + c)^2 + 
 2*(7*b^3*arctan2(1, d*x + c)^3 + 24*a*b^2*arctan2(1, d*x + c)^2)*c)*d*e + 
 (7*b^3*arctan2(1, d*x + c)^3 + 24*a*b^2*arctan2(1, d*x + c)^2 + (7*b^3*ar 
ctan2(1, d*x + c)^3 + 24*a*b^2*arctan2(1, d*x + c)^2)*c^2)*f)*x + 12*(b^3* 
d^2*f*x^3*arctan2(1, d*x + c) + 2*b^3*c*d*e*x*arctan2(1, d*x + c) + (2*...
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right )^3 \, dx=\frac {\mathit {acot} \left (d x +c \right )^{3} b^{3} d^{2} f \,x^{2}+6 \mathit {acot} \left (d x +c \right )^{2} a \,b^{2} d^{2} e x +3 \mathit {acot} \left (d x +c \right )^{2} a \,b^{2} d^{2} f \,x^{2}+6 \mathit {acot} \left (d x +c \right ) a^{2} b c d e +6 \mathit {acot} \left (d x +c \right ) a^{2} b \,d^{2} e x +3 \mathit {acot} \left (d x +c \right ) a^{2} b \,d^{2} f \,x^{2}+6 \mathit {acot} \left (d x +c \right ) a \,b^{2} d f x -12 \left (\int \frac {\mathit {acot} \left (d x +c \right ) x}{d^{2} x^{2}+2 c d x +c^{2}+1}d x \right ) a \,b^{2} c \,d^{2} f +3 \mathit {acot} \left (d x +c \right )^{2} a \,b^{2} f +3 \mathit {acot} \left (d x +c \right ) a^{2} b f +6 \left (\int \frac {\mathit {acot} \left (d x +c \right ) x}{d^{2} x^{2}+2 c d x +c^{2}+1}d x \right ) b^{3} d^{2} f +6 \left (\int \frac {\mathit {acot} \left (d x +c \right )^{2} x}{d^{2} x^{2}+2 c d x +c^{2}+1}d x \right ) b^{3} d^{3} e -3 \,\mathrm {log}\left (d^{2} x^{2}+2 c d x +c^{2}+1\right ) a^{2} b c f +3 \,\mathrm {log}\left (d^{2} x^{2}+2 c d x +c^{2}+1\right ) a^{2} b d e +3 a^{2} b d f x +12 \left (\int \frac {\mathit {acot} \left (d x +c \right ) x}{d^{2} x^{2}+2 c d x +c^{2}+1}d x \right ) a \,b^{2} d^{3} e -6 \left (\int \frac {\mathit {acot} \left (d x +c \right )^{2} x}{d^{2} x^{2}+2 c d x +c^{2}+1}d x \right ) b^{3} c \,d^{2} f +2 \mathit {acot} \left (d x +c \right )^{3} b^{3} d^{2} e x +3 \mathit {acot} \left (d x +c \right )^{2} a \,b^{2} c^{2} f +3 \mathit {acot} \left (d x +c \right )^{2} b^{3} d f x -3 \mathit {acot} \left (d x +c \right ) a^{2} b \,c^{2} f +6 \mathit {acot} \left (d x +c \right ) a \,b^{2} c f +a^{3} d^{2} f \,x^{2}+3 \,\mathrm {log}\left (d^{2} x^{2}+2 c d x +c^{2}+1\right ) a \,b^{2} f +2 a^{3} d^{2} e x +\mathit {acot} \left (d x +c \right )^{3} b^{3} c^{2} f +\mathit {acot} \left (d x +c \right )^{3} b^{3} f}{2 d^{2}} \] Input:

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

Output:

(acot(c + d*x)**3*b**3*c**2*f + 2*acot(c + d*x)**3*b**3*d**2*e*x + acot(c 
+ d*x)**3*b**3*d**2*f*x**2 + acot(c + d*x)**3*b**3*f + 3*acot(c + d*x)**2* 
a*b**2*c**2*f + 6*acot(c + d*x)**2*a*b**2*d**2*e*x + 3*acot(c + d*x)**2*a* 
b**2*d**2*f*x**2 + 3*acot(c + d*x)**2*a*b**2*f + 3*acot(c + d*x)**2*b**3*d 
*f*x - 3*acot(c + d*x)*a**2*b*c**2*f + 6*acot(c + d*x)*a**2*b*c*d*e + 6*ac 
ot(c + d*x)*a**2*b*d**2*e*x + 3*acot(c + d*x)*a**2*b*d**2*f*x**2 + 3*acot( 
c + d*x)*a**2*b*f + 6*acot(c + d*x)*a*b**2*c*f + 6*acot(c + d*x)*a*b**2*d* 
f*x - 12*int((acot(c + d*x)*x)/(c**2 + 2*c*d*x + d**2*x**2 + 1),x)*a*b**2* 
c*d**2*f + 12*int((acot(c + d*x)*x)/(c**2 + 2*c*d*x + d**2*x**2 + 1),x)*a* 
b**2*d**3*e + 6*int((acot(c + d*x)*x)/(c**2 + 2*c*d*x + d**2*x**2 + 1),x)* 
b**3*d**2*f - 6*int((acot(c + d*x)**2*x)/(c**2 + 2*c*d*x + d**2*x**2 + 1), 
x)*b**3*c*d**2*f + 6*int((acot(c + d*x)**2*x)/(c**2 + 2*c*d*x + d**2*x**2 
+ 1),x)*b**3*d**3*e - 3*log(c**2 + 2*c*d*x + d**2*x**2 + 1)*a**2*b*c*f + 3 
*log(c**2 + 2*c*d*x + d**2*x**2 + 1)*a**2*b*d*e + 3*log(c**2 + 2*c*d*x + d 
**2*x**2 + 1)*a*b**2*f + 2*a**3*d**2*e*x + a**3*d**2*f*x**2 + 3*a**2*b*d*f 
*x)/(2*d**2)