\(\int (a+b x)^2 \cot ^{-1}(a+b x) \, dx\) [9]

Optimal result
Mathematica [A] (verified)
Rubi [A] (warning: unable to verify)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [C] (verification not implemented)
Maxima [B] (verification not implemented)
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 52 \[ \int (a+b x)^2 \cot ^{-1}(a+b x) \, dx=\frac {(a+b x)^2}{6 b}+\frac {(a+b x)^3 \cot ^{-1}(a+b x)}{3 b}-\frac {\log \left (1+(a+b x)^2\right )}{6 b} \] Output:

1/6*(b*x+a)^2/b+1/3*(b*x+a)^3*arccot(b*x+a)/b-1/6*ln(1+(b*x+a)^2)/b
 

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.81 \[ \int (a+b x)^2 \cot ^{-1}(a+b x) \, dx=\frac {(a+b x)^2+2 (a+b x)^3 \cot ^{-1}(a+b x)-\log \left (1+(a+b x)^2\right )}{6 b} \] Input:

Integrate[(a + b*x)^2*ArcCot[a + b*x],x]
 

Output:

((a + b*x)^2 + 2*(a + b*x)^3*ArcCot[a + b*x] - Log[1 + (a + b*x)^2])/(6*b)
 

Rubi [A] (warning: unable to verify)

Time = 0.26 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.83, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {5567, 5362, 243, 49, 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 (a+b x)^2 \cot ^{-1}(a+b x) \, dx\)

\(\Big \downarrow \) 5567

\(\displaystyle \frac {\int (a+b x)^2 \cot ^{-1}(a+b x)d(a+b x)}{b}\)

\(\Big \downarrow \) 5362

\(\displaystyle \frac {\frac {1}{3} \int \frac {(a+b x)^3}{(a+b x)^2+1}d(a+b x)+\frac {1}{3} (a+b x)^3 \cot ^{-1}(a+b x)}{b}\)

\(\Big \downarrow \) 243

\(\displaystyle \frac {\frac {1}{6} \int \frac {(a+b x)^2}{(a+b x)^2+1}d(a+b x)^2+\frac {1}{3} (a+b x)^3 \cot ^{-1}(a+b x)}{b}\)

\(\Big \downarrow \) 49

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {1}{6} \left ((a+b x)^2-\log (a+b x+1)\right )+\frac {1}{3} (a+b x)^3 \cot ^{-1}(a+b x)}{b}\)

Input:

Int[(a + b*x)^2*ArcCot[a + b*x],x]
 

Output:

(((a + b*x)^3*ArcCot[a + b*x])/3 + ((a + b*x)^2 - Log[1 + a + b*x])/6)/b
 

Defintions of rubi rules used

rule 49
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int 
[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] 
&& IGtQ[m, 0] && IGtQ[m + n + 2, 0]
 

rule 243
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[1/2   Subst[In 
t[x^((m - 1)/2)*(a + b*x)^p, x], x, x^2], x] /; FreeQ[{a, b, m, p}, x] && I 
ntegerQ[(m - 1)/2]
 

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

rule 5362
Int[((a_.) + ArcCot[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> 
 Simp[x^(m + 1)*((a + b*ArcCot[c*x^n])^p/(m + 1)), x] + Simp[b*c*n*(p/(m + 
1))   Int[x^(m + n)*((a + b*ArcCot[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))), x], 
x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] & 
& IntegerQ[m])) && NeQ[m, -1]
 

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

Time = 0.37 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.81

method result size
derivativedivides \(\frac {\frac {\operatorname {arccot}\left (b x +a \right ) \left (b x +a \right )^{3}}{3}+\frac {\left (b x +a \right )^{2}}{6}-\frac {\ln \left (1+\left (b x +a \right )^{2}\right )}{6}}{b}\) \(42\)
default \(\frac {\frac {\operatorname {arccot}\left (b x +a \right ) \left (b x +a \right )^{3}}{3}+\frac {\left (b x +a \right )^{2}}{6}-\frac {\ln \left (1+\left (b x +a \right )^{2}\right )}{6}}{b}\) \(42\)
parts \(\frac {\operatorname {arccot}\left (b x +a \right ) b^{2} x^{3}}{3}+\operatorname {arccot}\left (b x +a \right ) b a \,x^{2}+\operatorname {arccot}\left (b x +a \right ) a^{2} x +\frac {\operatorname {arccot}\left (b x +a \right ) a^{3}}{3 b}+\frac {x^{2} b}{6}+\frac {a x}{3}-\frac {\ln \left (b^{2} x^{2}+2 a b x +a^{2}+1\right )}{6 b}\) \(86\)
parallelrisch \(-\frac {-2 b^{4} \operatorname {arccot}\left (b x +a \right ) x^{3}-6 a \,b^{3} x^{2} \operatorname {arccot}\left (b x +a \right )-6 x \,\operatorname {arccot}\left (b x +a \right ) a^{2} b^{2}-x^{2} b^{3}-2 \,\operatorname {arccot}\left (b x +a \right ) a^{3} b -2 x a \,b^{2}+5 a^{2} b +\ln \left (b^{2} x^{2}+2 a b x +a^{2}+1\right ) b +b}{6 b^{2}}\) \(105\)
risch \(\frac {i \left (b x +a \right )^{3} \ln \left (1+i \left (b x +a \right )\right )}{6 b}-\frac {i b^{2} x^{3} \ln \left (1-i \left (b x +a \right )\right )}{6}+\frac {\pi \,b^{2} x^{3}}{6}-\frac {i b a \,x^{2} \ln \left (1-i \left (b x +a \right )\right )}{2}+\frac {b \pi a \,x^{2}}{2}-\frac {i a^{2} x \ln \left (1-i \left (b x +a \right )\right )}{2}+\frac {x \,a^{2} \pi }{2}-\frac {i a^{3} \ln \left (b^{2} x^{2}+2 a b x +a^{2}+1\right )}{12 b}-\frac {\arctan \left (b x +a \right ) a^{3}}{6 b}+\frac {x^{2} b}{6}+\frac {a x}{3}-\frac {\ln \left (-b^{2} x^{2}-2 a b x -a^{2}-1\right )}{6 b}\) \(184\)

Input:

int((b*x+a)^2*arccot(b*x+a),x,method=_RETURNVERBOSE)
 

Output:

1/b*(1/3*arccot(b*x+a)*(b*x+a)^3+1/6*(b*x+a)^2-1/6*ln(1+(b*x+a)^2))
 

Fricas [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.56 \[ \int (a+b x)^2 \cot ^{-1}(a+b x) \, dx=\frac {b^{2} x^{2} - 2 \, a^{3} \arctan \left (b x + a\right ) + 2 \, a b x + 2 \, {\left (b^{3} x^{3} + 3 \, a b^{2} x^{2} + 3 \, a^{2} b x\right )} \operatorname {arccot}\left (b x + a\right ) - \log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + 1\right )}{6 \, b} \] Input:

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

Output:

1/6*(b^2*x^2 - 2*a^3*arctan(b*x + a) + 2*a*b*x + 2*(b^3*x^3 + 3*a*b^2*x^2 
+ 3*a^2*b*x)*arccot(b*x + a) - log(b^2*x^2 + 2*a*b*x + a^2 + 1))/b
 

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 5.45 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.90 \[ \int (a+b x)^2 \cot ^{-1}(a+b x) \, dx=\begin {cases} \frac {a^{3} \operatorname {acot}{\left (a + b x \right )}}{3 b} + a^{2} x \operatorname {acot}{\left (a + b x \right )} + a b x^{2} \operatorname {acot}{\left (a + b x \right )} + \frac {a x}{3} + \frac {b^{2} x^{3} \operatorname {acot}{\left (a + b x \right )}}{3} + \frac {b x^{2}}{6} - \frac {\log {\left (\frac {a}{b} + x - \frac {i}{b} \right )}}{3 b} - \frac {i \operatorname {acot}{\left (a + b x \right )}}{3 b} & \text {for}\: b \neq 0 \\a^{2} x \operatorname {acot}{\left (a \right )} & \text {otherwise} \end {cases} \] Input:

integrate((b*x+a)**2*acot(b*x+a),x)
 

Output:

Piecewise((a**3*acot(a + b*x)/(3*b) + a**2*x*acot(a + b*x) + a*b*x**2*acot 
(a + b*x) + a*x/3 + b**2*x**3*acot(a + b*x)/3 + b*x**2/6 - log(a/b + x - I 
/b)/(3*b) - I*acot(a + b*x)/(3*b), Ne(b, 0)), (a**2*x*acot(a), True))
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 93 vs. \(2 (46) = 92\).

Time = 0.14 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.79 \[ \int (a+b x)^2 \cot ^{-1}(a+b x) \, dx=-\frac {1}{6} \, {\left (\frac {2 \, a^{3} \arctan \left (\frac {b^{2} x + a b}{b}\right )}{b^{2}} - \frac {b x^{2} + 2 \, a x}{b} + \frac {\log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + 1\right )}{b^{2}}\right )} b + \frac {1}{3} \, {\left (b^{2} x^{3} + 3 \, a b x^{2} + 3 \, a^{2} x\right )} \operatorname {arccot}\left (b x + a\right ) \] Input:

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

Output:

-1/6*(2*a^3*arctan((b^2*x + a*b)/b)/b^2 - (b*x^2 + 2*a*x)/b + log(b^2*x^2 
+ 2*a*b*x + a^2 + 1)/b^2)*b + 1/3*(b^2*x^3 + 3*a*b*x^2 + 3*a^2*x)*arccot(b 
*x + a)
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 203 vs. \(2 (46) = 92\).

Time = 0.23 (sec) , antiderivative size = 203, normalized size of antiderivative = 3.90 \[ \int (a+b x)^2 \cot ^{-1}(a+b x) \, dx=-\frac {\arctan \left (\frac {1}{b x + a}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{6} - 3 \, \arctan \left (\frac {1}{b x + a}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{4} - \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{5} - 4 \, \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{2}}{\tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{3} + 3 \, \arctan \left (\frac {1}{b x + a}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{3} - \arctan \left (\frac {1}{b x + a}\right ) - \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )}{24 \, b \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{3}} \] Input:

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

Output:

-1/24*(arctan(1/(b*x + a))*tan(1/2*arctan(1/(b*x + a)))^6 - 3*arctan(1/(b* 
x + a))*tan(1/2*arctan(1/(b*x + a)))^4 - tan(1/2*arctan(1/(b*x + a)))^5 - 
4*log(16*tan(1/2*arctan(1/(b*x + a)))^2/(tan(1/2*arctan(1/(b*x + a)))^4 + 
2*tan(1/2*arctan(1/(b*x + a)))^2 + 1))*tan(1/2*arctan(1/(b*x + a)))^3 + 3* 
arctan(1/(b*x + a))*tan(1/2*arctan(1/(b*x + a)))^2 - 2*tan(1/2*arctan(1/(b 
*x + a)))^3 - arctan(1/(b*x + a)) - tan(1/2*arctan(1/(b*x + a))))/(b*tan(1 
/2*arctan(1/(b*x + a)))^3)
 

Mupad [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.63 \[ \int (a+b x)^2 \cot ^{-1}(a+b x) \, dx=\frac {a\,x}{3}-\frac {\ln \left (a^2+2\,a\,b\,x+b^2\,x^2+1\right )}{6\,b}+\frac {b\,x^2}{6}-\frac {a^3\,\mathrm {atan}\left (a+b\,x\right )}{3\,b}+\frac {b^2\,x^3\,\mathrm {acot}\left (a+b\,x\right )}{3}+a^2\,x\,\mathrm {acot}\left (a+b\,x\right )+a\,b\,x^2\,\mathrm {acot}\left (a+b\,x\right ) \] Input:

int(acot(a + b*x)*(a + b*x)^2,x)
 

Output:

(a*x)/3 - log(a^2 + b^2*x^2 + 2*a*b*x + 1)/(6*b) + (b*x^2)/6 - (a^3*atan(a 
 + b*x))/(3*b) + (b^2*x^3*acot(a + b*x))/3 + a^2*x*acot(a + b*x) + a*b*x^2 
*acot(a + b*x)
 

Reduce [B] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.75 \[ \int (a+b x)^2 \cot ^{-1}(a+b x) \, dx=\frac {2 \mathit {acot} \left (b x +a \right ) a^{3}+6 \mathit {acot} \left (b x +a \right ) a^{2} b x +6 \mathit {acot} \left (b x +a \right ) a \,b^{2} x^{2}+2 \mathit {acot} \left (b x +a \right ) b^{3} x^{3}-\mathrm {log}\left (b^{2} x^{2}+2 a b x +a^{2}+1\right )+2 a b x +b^{2} x^{2}}{6 b} \] Input:

int((b*x+a)^2*acot(b*x+a),x)
 

Output:

(2*acot(a + b*x)*a**3 + 6*acot(a + b*x)*a**2*b*x + 6*acot(a + b*x)*a*b**2* 
x**2 + 2*acot(a + b*x)*b**3*x**3 - log(a**2 + 2*a*b*x + b**2*x**2 + 1) + 2 
*a*b*x + b**2*x**2)/(6*b)