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

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 = 220 \[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right )^2 \, dx=\frac {a b f x}{d}+\frac {b^2 f (c+d x) \cot ^{-1}(c+d x)}{d^2}+\frac {i (d e-c f) \left (a+b \cot ^{-1}(c+d x)\right )^2}{d^2}-\frac {(d e+f-c f) (d e-(1+c) f) \left (a+b \cot ^{-1}(c+d x)\right )^2}{2 d^2 f}+\frac {(e+f x)^2 \left (a+b \cot ^{-1}(c+d x)\right )^2}{2 f}-\frac {2 b (d e-c f) \left (a+b \cot ^{-1}(c+d x)\right ) \log \left (\frac {2}{1+i (c+d x)}\right )}{d^2}+\frac {b^2 f \log \left (1+(c+d x)^2\right )}{2 d^2}+\frac {i b^2 (d e-c f) \operatorname {PolyLog}\left (2,1-\frac {2}{1+i (c+d x)}\right )}{d^2} \] Output:

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

Mathematica [A] (verified)

Time = 0.97 (sec) , antiderivative size = 286, normalized size of antiderivative = 1.30 \[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right )^2 \, dx=\frac {2 a^2 c d e+2 a b c f-a^2 c^2 f+2 a^2 d^2 e x+2 a b d f x+a^2 d^2 f x^2+b^2 (i+c+d x) (-((i+c) f)+d (2 e+f x)) \cot ^{-1}(c+d x)^2-2 a b f \arctan (c+d x)+2 b \cot ^{-1}(c+d x) \left (-((c+d x) (-b f+a c f-a d (2 e+f x)))-2 b (d e-c f) \log \left (1-e^{2 i \cot ^{-1}(c+d x)}\right )\right )-4 a b d e \log \left (\frac {1}{(c+d x) \sqrt {1+\frac {1}{(c+d x)^2}}}\right )-2 b^2 f \log \left (\frac {1}{(c+d x) \sqrt {1+\frac {1}{(c+d x)^2}}}\right )+4 a b c f \log \left (\frac {1}{(c+d x) \sqrt {1+\frac {1}{(c+d x)^2}}}\right )+2 i b^2 (d e-c f) \operatorname {PolyLog}\left (2,e^{2 i \cot ^{-1}(c+d x)}\right )}{2 d^2} \] Input:

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

Output:

(2*a^2*c*d*e + 2*a*b*c*f - a^2*c^2*f + 2*a^2*d^2*e*x + 2*a*b*d*f*x + a^2*d 
^2*f*x^2 + b^2*(I + c + d*x)*(-((I + c)*f) + d*(2*e + f*x))*ArcCot[c + d*x 
]^2 - 2*a*b*f*ArcTan[c + d*x] + 2*b*ArcCot[c + d*x]*(-((c + d*x)*(-(b*f) + 
 a*c*f - a*d*(2*e + f*x))) - 2*b*(d*e - c*f)*Log[1 - E^((2*I)*ArcCot[c + d 
*x])]) - 4*a*b*d*e*Log[1/((c + d*x)*Sqrt[1 + (c + d*x)^(-2)])] - 2*b^2*f*L 
og[1/((c + d*x)*Sqrt[1 + (c + d*x)^(-2)])] + 4*a*b*c*f*Log[1/((c + d*x)*Sq 
rt[1 + (c + d*x)^(-2)])] + (2*I)*b^2*(d*e - c*f)*PolyLog[2, E^((2*I)*ArcCo 
t[c + d*x])])/(2*d^2)
 

Rubi [A] (verified)

Time = 0.60 (sec) , antiderivative size = 227, normalized size of antiderivative = 1.03, 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 )^2 \, 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 )^2}{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 )^2d(c+d x)}{d^2}\)

\(\Big \downarrow \) 5390

\(\displaystyle \frac {\frac {b \int \left (\left (a+b \cot ^{-1}(c+d x)\right ) f^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 )}{(c+d x)^2+1}\right )d(c+d x)}{f}+\frac {(f (c+d x)-c f+d e)^2 \left (a+b \cot ^{-1}(c+d x)\right )^2}{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 )^2}{2 f}+\frac {b \left (\frac {i f (d e-c f) \left (a+b \cot ^{-1}(c+d x)\right )^2}{b}-\frac {(-c f+d e+f) (d e-(c+1) f) \left (a+b \cot ^{-1}(c+d x)\right )^2}{2 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 )+a f^2 (c+d x)+i b f (d e-c f) \operatorname {PolyLog}\left (2,1-\frac {2}{i (c+d x)+1}\right )+\frac {1}{2} b f^2 \log \left ((c+d x)^2+1\right )+b f^2 (c+d x) \cot ^{-1}(c+d x)\right )}{f}}{d^2}\)

Input:

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

Output:

(((d*e - c*f + f*(c + d*x))^2*(a + b*ArcCot[c + d*x])^2)/(2*f) + (b*(a*f^2 
*(c + d*x) + b*f^2*(c + d*x)*ArcCot[c + d*x] + (I*f*(d*e - c*f)*(a + b*Arc 
Cot[c + d*x])^2)/b - ((d*e + f - c*f)*(d*e - (1 + c)*f)*(a + b*ArcCot[c + 
d*x])^2)/(2*b) - 2*f*(d*e - c*f)*(a + b*ArcCot[c + d*x])*Log[2/(1 + I*(c + 
 d*x))] + (b*f^2*Log[1 + (c + d*x)^2])/2 + I*b*f*(d*e - c*f)*PolyLog[2, 1 
- 2/(1 + I*(c + d*x))]))/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. 426 vs. \(2 (210 ) = 420\).

Time = 1.35 (sec) , antiderivative size = 427, normalized size of antiderivative = 1.94

method result size
parts \(a^{2} \left (\frac {1}{2} f \,x^{2}+e x \right )+\frac {b^{2} \left (\frac {\operatorname {arccot}\left (d x +c \right )^{2} \left (d x +c \right )^{2} f}{2 d}-\frac {\operatorname {arccot}\left (d x +c \right )^{2} c f \left (d x +c \right )}{d}+\operatorname {arccot}\left (d x +c \right )^{2} e \left (d x +c \right )+\frac {-\ln \left (1+\left (d x +c \right )^{2}\right ) \operatorname {arccot}\left (d x +c \right ) c f +\ln \left (1+\left (d x +c \right )^{2}\right ) \operatorname {arccot}\left (d x +c \right ) d e -\arctan \left (d x +c \right ) \operatorname {arccot}\left (d x +c \right ) f +\operatorname {arccot}\left (d x +c \right ) f \left (d x +c \right )+\frac {f \ln \left (1+\left (d x +c \right )^{2}\right )}{2}-\frac {\arctan \left (d x +c \right )^{2} f}{2}+\frac {\left (-2 c f +2 d e \right ) \left (-\frac {i \left (\ln \left (d x +c -i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c -i\right )^{2}}{2}-\operatorname {dilog}\left (-\frac {i \left (d x +c +i\right )}{2}\right )-\ln \left (d x +c -i\right ) \ln \left (-\frac {i \left (d x +c +i\right )}{2}\right )\right )}{2}+\frac {i \left (\ln \left (d x +c +i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c +i\right )^{2}}{2}-\operatorname {dilog}\left (\frac {i \left (d x +c -i\right )}{2}\right )-\ln \left (d x +c +i\right ) \ln \left (\frac {i \left (d x +c -i\right )}{2}\right )\right )}{2}\right )}{2}}{d}\right )}{d}+\frac {2 a b \left (\frac {\operatorname {arccot}\left (d x +c \right ) \left (d x +c \right )^{2} f}{2 d}-\frac {\operatorname {arccot}\left (d x +c \right ) c f \left (d x +c \right )}{d}+\operatorname {arccot}\left (d x +c \right ) e \left (d x +c \right )+\frac {f \left (d x +c \right )+\frac {\left (-2 c f +2 d e \right ) \ln \left (1+\left (d x +c \right )^{2}\right )}{2}-f \arctan \left (d x +c \right )}{2 d}\right )}{d}\) \(427\)
derivativedivides \(\frac {-\frac {a^{2} \left (f c \left (d x +c \right )-e d \left (d x +c \right )-\frac {f \left (d x +c \right )^{2}}{2}\right )}{d}-\frac {b^{2} \left (\operatorname {arccot}\left (d x +c \right )^{2} f c \left (d x +c \right )-\operatorname {arccot}\left (d x +c \right )^{2} e d \left (d x +c \right )-\frac {\operatorname {arccot}\left (d x +c \right )^{2} f \left (d x +c \right )^{2}}{2}+\ln \left (1+\left (d x +c \right )^{2}\right ) \operatorname {arccot}\left (d x +c \right ) c f -\ln \left (1+\left (d x +c \right )^{2}\right ) \operatorname {arccot}\left (d x +c \right ) d e +\arctan \left (d x +c \right ) \operatorname {arccot}\left (d x +c \right ) f -\operatorname {arccot}\left (d x +c \right ) f \left (d x +c \right )-\frac {f \ln \left (1+\left (d x +c \right )^{2}\right )}{2}+\frac {\arctan \left (d x +c \right )^{2} f}{2}+\frac {\left (2 c f -2 d e \right ) \left (-\frac {i \left (\ln \left (d x +c -i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c -i\right )^{2}}{2}-\operatorname {dilog}\left (-\frac {i \left (d x +c +i\right )}{2}\right )-\ln \left (d x +c -i\right ) \ln \left (-\frac {i \left (d x +c +i\right )}{2}\right )\right )}{2}+\frac {i \left (\ln \left (d x +c +i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c +i\right )^{2}}{2}-\operatorname {dilog}\left (\frac {i \left (d x +c -i\right )}{2}\right )-\ln \left (d x +c +i\right ) \ln \left (\frac {i \left (d x +c -i\right )}{2}\right )\right )}{2}\right )}{2}\right )}{d}-\frac {2 a b \left (\operatorname {arccot}\left (d x +c \right ) f c \left (d x +c \right )-\operatorname {arccot}\left (d x +c \right ) e d \left (d x +c \right )-\frac {\operatorname {arccot}\left (d x +c \right ) f \left (d x +c \right )^{2}}{2}-\frac {f \left (d x +c \right )}{2}+\frac {\left (2 c f -2 d e \right ) \ln \left (1+\left (d x +c \right )^{2}\right )}{4}+\frac {f \arctan \left (d x +c \right )}{2}\right )}{d}}{d}\) \(434\)
default \(\frac {-\frac {a^{2} \left (f c \left (d x +c \right )-e d \left (d x +c \right )-\frac {f \left (d x +c \right )^{2}}{2}\right )}{d}-\frac {b^{2} \left (\operatorname {arccot}\left (d x +c \right )^{2} f c \left (d x +c \right )-\operatorname {arccot}\left (d x +c \right )^{2} e d \left (d x +c \right )-\frac {\operatorname {arccot}\left (d x +c \right )^{2} f \left (d x +c \right )^{2}}{2}+\ln \left (1+\left (d x +c \right )^{2}\right ) \operatorname {arccot}\left (d x +c \right ) c f -\ln \left (1+\left (d x +c \right )^{2}\right ) \operatorname {arccot}\left (d x +c \right ) d e +\arctan \left (d x +c \right ) \operatorname {arccot}\left (d x +c \right ) f -\operatorname {arccot}\left (d x +c \right ) f \left (d x +c \right )-\frac {f \ln \left (1+\left (d x +c \right )^{2}\right )}{2}+\frac {\arctan \left (d x +c \right )^{2} f}{2}+\frac {\left (2 c f -2 d e \right ) \left (-\frac {i \left (\ln \left (d x +c -i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c -i\right )^{2}}{2}-\operatorname {dilog}\left (-\frac {i \left (d x +c +i\right )}{2}\right )-\ln \left (d x +c -i\right ) \ln \left (-\frac {i \left (d x +c +i\right )}{2}\right )\right )}{2}+\frac {i \left (\ln \left (d x +c +i\right ) \ln \left (1+\left (d x +c \right )^{2}\right )-\frac {\ln \left (d x +c +i\right )^{2}}{2}-\operatorname {dilog}\left (\frac {i \left (d x +c -i\right )}{2}\right )-\ln \left (d x +c +i\right ) \ln \left (\frac {i \left (d x +c -i\right )}{2}\right )\right )}{2}\right )}{2}\right )}{d}-\frac {2 a b \left (\operatorname {arccot}\left (d x +c \right ) f c \left (d x +c \right )-\operatorname {arccot}\left (d x +c \right ) e d \left (d x +c \right )-\frac {\operatorname {arccot}\left (d x +c \right ) f \left (d x +c \right )^{2}}{2}-\frac {f \left (d x +c \right )}{2}+\frac {\left (2 c f -2 d e \right ) \ln \left (1+\left (d x +c \right )^{2}\right )}{4}+\frac {f \arctan \left (d x +c \right )}{2}\right )}{d}}{d}\) \(434\)
risch \(\text {Expression too large to display}\) \(1781\)

Input:

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

Output:

a^2*(1/2*f*x^2+e*x)+b^2/d*(1/2/d*arccot(d*x+c)^2*(d*x+c)^2*f-1/d*arccot(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)*arccot( 
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)^2-dilog 
(-1/2*I*(d*x+c+I))-ln(d*x+c-I)*ln(-1/2*I*(d*x+c+I)))+1/2*I*(ln(d*x+c+I)*ln 
(1+(d*x+c)^2)-1/2*ln(d*x+c+I)^2-dilog(1/2*I*(d*x+c-I))-ln(d*x+c+I)*ln(1/2* 
I*(d*x+c-I))))))+2*a*b/d*(1/2/d*arccot(d*x+c)*(d*x+c)^2*f-1/d*arccot(d*x+c 
)*c*f*(d*x+c)+arccot(d*x+c)*e*(d*x+c)+1/2/d*(f*(d*x+c)+1/2*(-2*c*f+2*d*e)* 
ln(1+(d*x+c)^2)-f*arctan(d*x+c)))
 

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

1/8*b^2*f*x^2*arctan2(1, d*x + c)^2 + 1/4*b^2*e*x*arctan2(1, d*x + c)^2 + 
1/2*a^2*f*x^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*b*f + a^2*e*x + 
 (2*(d*x + c)*arccot(d*x + c) + log((d*x + c)^2 + 1))*a*b*e/d - 1/32*(b^2* 
f*x^2 + 2*b^2*e*x)*log(d^2*x^2 + 2*c*d*x + c^2 + 1)^2 + integrate(1/16*(12 
*b^2*d^2*f*x^3*arctan2(1, d*x + c)^2 + 4*(3*b^2*d^2*e*arctan2(1, d*x + c)^ 
2 + (6*b^2*c*arctan2(1, d*x + c)^2 + b^2*arctan2(1, d*x + c))*d*f)*x^2 + ( 
b^2*d^2*f*x^3 + (b^2*d^2*e + 2*b^2*c*d*f)*x^2 + (b^2*c^2 + b^2)*e + (2*b^2 
*c*d*e + (b^2*c^2 + b^2)*f)*x)*log(d^2*x^2 + 2*c*d*x + c^2 + 1)^2 + 12*(b^ 
2*c^2*arctan2(1, d*x + c)^2 + b^2*arctan2(1, d*x + c)^2)*e + 4*(2*(3*b^2*c 
*arctan2(1, d*x + c)^2 + b^2*arctan2(1, d*x + c))*d*e + 3*(b^2*c^2*arctan2 
(1, d*x + c)^2 + b^2*arctan2(1, d*x + c)^2)*f)*x + 2*(b^2*d^2*f*x^3 + 2*b^ 
2*c*d*e*x + (2*b^2*d^2*e + b^2*c*d*f)*x^2)*log(d^2*x^2 + 2*c*d*x + c^2 + 1 
))/(d^2*x^2 + 2*c*d*x + c^2 + 1), x)
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right )^2 \, dx=\frac {\mathit {acot} \left (d x +c \right )^{2} b^{2} c^{2} f +2 \mathit {acot} \left (d x +c \right )^{2} b^{2} d^{2} e x +\mathit {acot} \left (d x +c \right )^{2} b^{2} d^{2} f \,x^{2}+\mathit {acot} \left (d x +c \right )^{2} b^{2} f -2 \mathit {acot} \left (d x +c \right ) a b \,c^{2} f +4 \mathit {acot} \left (d x +c \right ) a b c d e +4 \mathit {acot} \left (d x +c \right ) a b \,d^{2} e x +2 \mathit {acot} \left (d x +c \right ) a b \,d^{2} f \,x^{2}+2 \mathit {acot} \left (d x +c \right ) a b f +2 \mathit {acot} \left (d x +c \right ) b^{2} c f +2 \mathit {acot} \left (d x +c \right ) b^{2} d f x -4 \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^{2} c \,d^{2} f +4 \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^{2} d^{3} e -2 \,\mathrm {log}\left (d^{2} x^{2}+2 c d x +c^{2}+1\right ) a b c f +2 \,\mathrm {log}\left (d^{2} x^{2}+2 c d x +c^{2}+1\right ) a b d e +\mathrm {log}\left (d^{2} x^{2}+2 c d x +c^{2}+1\right ) b^{2} f +2 a^{2} d^{2} e x +a^{2} d^{2} f \,x^{2}+2 a b d f x}{2 d^{2}} \] Input:

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

Output:

(acot(c + d*x)**2*b**2*c**2*f + 2*acot(c + d*x)**2*b**2*d**2*e*x + acot(c 
+ d*x)**2*b**2*d**2*f*x**2 + acot(c + d*x)**2*b**2*f - 2*acot(c + d*x)*a*b 
*c**2*f + 4*acot(c + d*x)*a*b*c*d*e + 4*acot(c + d*x)*a*b*d**2*e*x + 2*aco 
t(c + d*x)*a*b*d**2*f*x**2 + 2*acot(c + d*x)*a*b*f + 2*acot(c + d*x)*b**2* 
c*f + 2*acot(c + d*x)*b**2*d*f*x - 4*int((acot(c + d*x)*x)/(c**2 + 2*c*d*x 
 + d**2*x**2 + 1),x)*b**2*c*d**2*f + 4*int((acot(c + d*x)*x)/(c**2 + 2*c*d 
*x + d**2*x**2 + 1),x)*b**2*d**3*e - 2*log(c**2 + 2*c*d*x + d**2*x**2 + 1) 
*a*b*c*f + 2*log(c**2 + 2*c*d*x + d**2*x**2 + 1)*a*b*d*e + log(c**2 + 2*c* 
d*x + d**2*x**2 + 1)*b**2*f + 2*a**2*d**2*e*x + a**2*d**2*f*x**2 + 2*a*b*d 
*f*x)/(2*d**2)