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

3.2.31.1 Optimal result
3.2.31.2 Mathematica [C] (verified)
3.2.31.3 Rubi [A] (verified)
3.2.31.4 Maple [A] (verified)
3.2.31.5 Fricas [A] (verification not implemented)
3.2.31.6 Sympy [C] (verification not implemented)
3.2.31.7 Maxima [A] (verification not implemented)
3.2.31.8 Giac [B] (verification not implemented)
3.2.31.9 Mupad [B] (verification not implemented)

3.2.31.1 Optimal result

Integrand size = 16, antiderivative size = 97 \[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right ) \, dx=\frac {b f x}{2 d}+\frac {(e+f x)^2 \left (a+b \cot ^{-1}(c+d x)\right )}{2 f}+\frac {b (d e+f-c f) (d e-(1+c) f) \arctan (c+d x)}{2 d^2 f}+\frac {b (d e-c f) \log \left (1+(c+d x)^2\right )}{2 d^2} \]

output
1/2*b*f*x/d+1/2*(f*x+e)^2*(a+b*arccot(d*x+c))/f+1/2*b*(-c*f+d*e+f)*(d*e-(1 
+c)*f)*arctan(d*x+c)/d^2/f+1/2*b*(-c*f+d*e)*ln(1+(d*x+c)^2)/d^2
 
3.2.31.2 Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.07 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.68 \[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right ) \, dx=a e x+\frac {1}{2} a f x^2+b e x \cot ^{-1}(c+d x)+\frac {b f \left (\frac {1}{2} d \left (-\frac {c}{d}+\frac {c+d x}{d}\right )^2 \cot ^{-1}(c+d x)+\frac {1}{2} d \left (\frac {x}{d}-\frac {i (i-c)^2 \log (i-c-d x)}{2 d^2}+\frac {i (i+c)^2 \log (i+c+d x)}{2 d^2}\right )\right )}{d}+\frac {b e \left (-2 c \arctan (c+d x)+\log \left (1+c^2+2 c d x+d^2 x^2\right )\right )}{2 d} \]

input
Integrate[(e + f*x)*(a + b*ArcCot[c + d*x]),x]
 
output
a*e*x + (a*f*x^2)/2 + b*e*x*ArcCot[c + d*x] + (b*f*((d*(-(c/d) + (c + d*x) 
/d)^2*ArcCot[c + d*x])/2 + (d*(x/d - ((I/2)*(I - c)^2*Log[I - c - d*x])/d^ 
2 + ((I/2)*(I + c)^2*Log[I + c + d*x])/d^2))/2))/d + (b*e*(-2*c*ArcTan[c + 
 d*x] + Log[1 + c^2 + 2*c*d*x + d^2*x^2]))/(2*d)
 
3.2.31.3 Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.06, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {5571, 27, 5388, 478, 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 ) \, 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 )}{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 )d(c+d x)}{d^2}\)

\(\Big \downarrow \) 5388

\(\displaystyle \frac {\frac {b \int \frac {(d e-c f+f (c+d x))^2}{(c+d x)^2+1}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 )}{2 f}}{d^2}\)

\(\Big \downarrow \) 478

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

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

3.2.31.3.1 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 478
Int[((c_) + (d_.)*(x_))^(n_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Int[Expand 
Integrand[(c + d*x)^n/(a + b*x^2), x], x] /; FreeQ[{a, b, c, d}, x] && IGtQ 
[n, 1]
 

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

rule 5388
Int[((a_.) + ArcCot[(c_.)*(x_)]*(b_.))*((d_) + (e_.)*(x_))^(q_.), x_Symbol] 
 :> Simp[(d + e*x)^(q + 1)*((a + b*ArcCot[c*x])/(e*(q + 1))), x] + Simp[b*( 
c/(e*(q + 1)))   Int[(d + e*x)^(q + 1)/(1 + c^2*x^2), x], x] /; FreeQ[{a, b 
, c, d, e, q}, x] && 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]
 
3.2.31.4 Maple [A] (verified)

Time = 0.35 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.16

method result size
parts \(a \left (\frac {1}{2} f \,x^{2}+e x \right )+\frac {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}\) \(113\)
derivativedivides \(\frac {-\frac {a \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 \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}\) \(130\)
default \(\frac {-\frac {a \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 \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}\) \(130\)
parallelrisch \(-\frac {-\operatorname {arccot}\left (d x +c \right ) b \,d^{2} f \,x^{2}-a \,d^{2} f \,x^{2}-2 x \,\operatorname {arccot}\left (d x +c \right ) b \,d^{2} e -2 a \,d^{2} e x +\operatorname {arccot}\left (d x +c \right ) b \,c^{2} f -2 \,\operatorname {arccot}\left (d x +c \right ) b c d e +b c f \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )-b e d \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )-b d f x +a \,c^{2} f +4 a c d e -\operatorname {arccot}\left (d x +c \right ) b f +2 b c f +a f}{2 d^{2}}\) \(160\)
risch \(\frac {i b \left (f \,x^{2}+2 e x \right ) \ln \left (1+i \left (d x +c \right )\right )}{4}-\frac {i b f \,x^{2} \ln \left (1-i \left (d x +c \right )\right )}{4}-\frac {i b e x \ln \left (1-i \left (d x +c \right )\right )}{2}+\frac {\pi b f \,x^{2}}{4}+\frac {\pi b e x}{2}+\frac {a f \,x^{2}}{2}+\frac {\arctan \left (d x +c \right ) b \,c^{2} f}{2 d^{2}}-\frac {b c e \arctan \left (d x +c \right )}{d}+a e x -\frac {b c f \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{2 d^{2}}+\frac {b e \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{2 d}+\frac {b f x}{2 d}-\frac {\arctan \left (d x +c \right ) b f}{2 d^{2}}\) \(190\)

input
int((f*x+e)*(a+b*arccot(d*x+c)),x,method=_RETURNVERBOSE)
 
output
a*(1/2*f*x^2+e*x)+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)))
 
3.2.31.5 Fricas [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.13 \[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right ) \, dx=\frac {a d^{2} f x^{2} + {\left (2 \, a d^{2} e + b d f\right )} x + {\left (b d^{2} f x^{2} + 2 \, b d^{2} e x\right )} \operatorname {arccot}\left (d x + c\right ) - {\left (2 \, b c d e - {\left (b c^{2} - b\right )} f\right )} \arctan \left (d x + c\right ) + {\left (b d e - b c f\right )} \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{2 \, d^{2}} \]

input
integrate((f*x+e)*(a+b*arccot(d*x+c)),x, algorithm="fricas")
 
output
1/2*(a*d^2*f*x^2 + (2*a*d^2*e + b*d*f)*x + (b*d^2*f*x^2 + 2*b*d^2*e*x)*arc 
cot(d*x + c) - (2*b*c*d*e - (b*c^2 - b)*f)*arctan(d*x + c) + (b*d*e - b*c* 
f)*log(d^2*x^2 + 2*c*d*x + c^2 + 1))/d^2
 
3.2.31.6 Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 14.48 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.82 \[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right ) \, dx=\begin {cases} a e x + \frac {a f x^{2}}{2} - \frac {b c^{2} f \operatorname {acot}{\left (c + d x \right )}}{2 d^{2}} + \frac {b c e \operatorname {acot}{\left (c + d x \right )}}{d} - \frac {b c f \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d^{2}} - \frac {i b c f \operatorname {acot}{\left (c + d x \right )}}{d^{2}} + b e x \operatorname {acot}{\left (c + d x \right )} + \frac {b f x^{2} \operatorname {acot}{\left (c + d x \right )}}{2} + \frac {b e \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d} + \frac {i b e \operatorname {acot}{\left (c + d x \right )}}{d} + \frac {b f x}{2 d} + \frac {b f \operatorname {acot}{\left (c + d x \right )}}{2 d^{2}} & \text {for}\: d \neq 0 \\\left (a + b \operatorname {acot}{\left (c \right )}\right ) \left (e x + \frac {f x^{2}}{2}\right ) & \text {otherwise} \end {cases} \]

input
integrate((f*x+e)*(a+b*acot(d*x+c)),x)
 
output
Piecewise((a*e*x + a*f*x**2/2 - b*c**2*f*acot(c + d*x)/(2*d**2) + b*c*e*ac 
ot(c + d*x)/d - b*c*f*log(c/d + x - I/d)/d**2 - I*b*c*f*acot(c + d*x)/d**2 
 + b*e*x*acot(c + d*x) + b*f*x**2*acot(c + d*x)/2 + b*e*log(c/d + x - I/d) 
/d + I*b*e*acot(c + d*x)/d + b*f*x/(2*d) + b*f*acot(c + d*x)/(2*d**2), Ne( 
d, 0)), ((a + b*acot(c))*(e*x + f*x**2/2), True))
 
3.2.31.7 Maxima [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.16 \[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right ) \, dx=\frac {1}{2} \, a f x^{2} + \frac {1}{2} \, {\left (x^{2} \operatorname {arccot}\left (d x + c\right ) + d {\left (\frac {x}{d^{2}} + \frac {{\left (c^{2} - 1\right )} \arctan \left (\frac {d^{2} x + c d}{d}\right )}{d^{3}} - \frac {c \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{d^{3}}\right )}\right )} b f + a e x + \frac {{\left (2 \, {\left (d x + c\right )} \operatorname {arccot}\left (d x + c\right ) + \log \left ({\left (d x + c\right )}^{2} + 1\right )\right )} b e}{2 \, d} \]

input
integrate((f*x+e)*(a+b*arccot(d*x+c)),x, algorithm="maxima")
 
output
1/2*a*f*x^2 + 1/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))*b*f + a*e*x + 1 
/2*(2*(d*x + c)*arccot(d*x + c) + log((d*x + c)^2 + 1))*b*e/d
 
3.2.31.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 451 vs. \(2 (89) = 178\).

Time = 0.41 (sec) , antiderivative size = 451, normalized size of antiderivative = 4.65 \[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right ) \, dx=-\frac {4 \, b d e \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{3} - 4 \, b c f \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{3} - b f \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{4} + 4 \, b d e \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2}}{\tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} - 4 \, b c f \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2}}{\tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} + 4 \, a d e \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{3} - 4 \, a c f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{3} - a f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{4} - 4 \, b d e \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right ) + 4 \, b c f \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right ) - 2 \, b f \arctan \left (\frac {1}{d x + c}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} + 2 \, b f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{3} - 4 \, a d e \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right ) + 4 \, a c f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right ) - 2 \, a f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2} - b f \arctan \left (\frac {1}{d x + c}\right ) - 2 \, b f \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right ) - a f}{8 \, d^{2} \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{d x + c}\right )\right )^{2}} \]

input
integrate((f*x+e)*(a+b*arccot(d*x+c)),x, algorithm="giac")
 
output
-1/8*(4*b*d*e*arctan(1/(d*x + c))*tan(1/2*arctan(1/(d*x + c)))^3 - 4*b*c*f 
*arctan(1/(d*x + c))*tan(1/2*arctan(1/(d*x + c)))^3 - b*f*arctan(1/(d*x + 
c))*tan(1/2*arctan(1/(d*x + c)))^4 + 4*b*d*e*log(16*tan(1/2*arctan(1/(d*x 
+ c)))^2/(tan(1/2*arctan(1/(d*x + c)))^4 + 2*tan(1/2*arctan(1/(d*x + c)))^ 
2 + 1))*tan(1/2*arctan(1/(d*x + c)))^2 - 4*b*c*f*log(16*tan(1/2*arctan(1/( 
d*x + c)))^2/(tan(1/2*arctan(1/(d*x + c)))^4 + 2*tan(1/2*arctan(1/(d*x + c 
)))^2 + 1))*tan(1/2*arctan(1/(d*x + c)))^2 + 4*a*d*e*tan(1/2*arctan(1/(d*x 
 + c)))^3 - 4*a*c*f*tan(1/2*arctan(1/(d*x + c)))^3 - a*f*tan(1/2*arctan(1/ 
(d*x + c)))^4 - 4*b*d*e*arctan(1/(d*x + c))*tan(1/2*arctan(1/(d*x + c))) + 
 4*b*c*f*arctan(1/(d*x + c))*tan(1/2*arctan(1/(d*x + c))) - 2*b*f*arctan(1 
/(d*x + c))*tan(1/2*arctan(1/(d*x + c)))^2 + 2*b*f*tan(1/2*arctan(1/(d*x + 
 c)))^3 - 4*a*d*e*tan(1/2*arctan(1/(d*x + c))) + 4*a*c*f*tan(1/2*arctan(1/ 
(d*x + c))) - 2*a*f*tan(1/2*arctan(1/(d*x + c)))^2 - b*f*arctan(1/(d*x + c 
)) - 2*b*f*tan(1/2*arctan(1/(d*x + c))) - a*f)/(d^2*tan(1/2*arctan(1/(d*x 
+ c)))^2)
 
3.2.31.9 Mupad [B] (verification not implemented)

Time = 1.58 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.40 \[ \int (e+f x) \left (a+b \cot ^{-1}(c+d x)\right ) \, dx=a\,e\,x+\frac {a\,f\,x^2}{2}+\frac {b\,e\,\ln \left (c^2+2\,c\,d\,x+d^2\,x^2+1\right )}{2\,d}+\frac {b\,f\,\mathrm {acot}\left (c+d\,x\right )}{2\,d^2}+\frac {b\,f\,x^2\,\mathrm {acot}\left (c+d\,x\right )}{2}+\frac {b\,f\,x}{2\,d}+b\,e\,x\,\mathrm {acot}\left (c+d\,x\right )-\frac {b\,c^2\,f\,\mathrm {acot}\left (c+d\,x\right )}{2\,d^2}-\frac {b\,c\,f\,\ln \left (c^2+2\,c\,d\,x+d^2\,x^2+1\right )}{2\,d^2}+\frac {b\,c\,e\,\mathrm {acot}\left (c+d\,x\right )}{d} \]

input
int((e + f*x)*(a + b*acot(c + d*x)),x)
 
output
a*e*x + (a*f*x^2)/2 + (b*e*log(c^2 + d^2*x^2 + 2*c*d*x + 1))/(2*d) + (b*f* 
acot(c + d*x))/(2*d^2) + (b*f*x^2*acot(c + d*x))/2 + (b*f*x)/(2*d) + b*e*x 
*acot(c + d*x) - (b*c^2*f*acot(c + d*x))/(2*d^2) - (b*c*f*log(c^2 + d^2*x^ 
2 + 2*c*d*x + 1))/(2*d^2) + (b*c*e*acot(c + d*x))/d