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

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 39 \[ \int (a+b x) \cot ^{-1}(a+b x) \, dx=\frac {x}{2}+\frac {(a+b x)^2 \cot ^{-1}(a+b x)}{2 b}-\frac {\arctan (a+b x)}{2 b} \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5152, 4947, 327, 209} \[ \int (a+b x) \cot ^{-1}(a+b x) \, dx=-\frac {\arctan (a+b x)}{2 b}+\frac {(a+b x)^2 \cot ^{-1}(a+b x)}{2 b}+\frac {x}{2} \]

[In]

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

[Out]

x/2 + ((a + b*x)^2*ArcCot[a + b*x])/(2*b) - ArcTan[a + b*x]/(2*b)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 4947

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] + Dist[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 5152

Int[((a_.) + ArcCot[(c_) + (d_.)*(x_)]*(b_.))^(p_.)*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Dist[1/d, Subst[I
nt[(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]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int x \cot ^{-1}(x) \, dx,x,a+b x\right )}{b} \\ & = \frac {(a+b x)^2 \cot ^{-1}(a+b x)}{2 b}+\frac {\text {Subst}\left (\int \frac {x^2}{1+x^2} \, dx,x,a+b x\right )}{2 b} \\ & = \frac {x}{2}+\frac {(a+b x)^2 \cot ^{-1}(a+b x)}{2 b}-\frac {\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,a+b x\right )}{2 b} \\ & = \frac {x}{2}+\frac {(a+b x)^2 \cot ^{-1}(a+b x)}{2 b}-\frac {\arctan (a+b x)}{2 b} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.04 (sec) , antiderivative size = 141, normalized size of antiderivative = 3.62 \[ \int (a+b x) \cot ^{-1}(a+b x) \, dx=a x \cot ^{-1}(a+b x)+\frac {1}{2} b \left (-\frac {a}{b}+\frac {a+b x}{b}\right )^2 \cot ^{-1}(a+b x)+\frac {1}{2} b \left (\frac {x}{b}-\frac {i (i-a)^2 \log (i-a-b x)}{2 b^2}+\frac {i (i+a)^2 \log (i+a+b x)}{2 b^2}\right )+\frac {a \left (-2 a \arctan (a+b x)+\log \left (1+a^2+2 a b x+b^2 x^2\right )\right )}{2 b} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.25 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.92

method result size
derivativedivides \(\frac {\frac {\left (b x +a \right )^{2} \operatorname {arccot}\left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}-\frac {\arctan \left (b x +a \right )}{2}}{b}\) \(36\)
default \(\frac {\frac {\left (b x +a \right )^{2} \operatorname {arccot}\left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}-\frac {\arctan \left (b x +a \right )}{2}}{b}\) \(36\)
parts \(\frac {\operatorname {arccot}\left (b x +a \right ) x^{2} b}{2}+\operatorname {arccot}\left (b x +a \right ) a x +\frac {b \left (\frac {x}{b}+\frac {\left (-a^{2}-1\right ) \arctan \left (b x +a \right )}{b^{2}}\right )}{2}\) \(49\)
parallelrisch \(\frac {\operatorname {arccot}\left (b x +a \right ) x^{2} b^{3}+2 a \,\operatorname {arccot}\left (b x +a \right ) x \,b^{2}+\operatorname {arccot}\left (b x +a \right ) a^{2} b +b^{2} x +\operatorname {arccot}\left (b x +a \right ) b -2 a b}{2 b^{2}}\) \(61\)
risch \(\frac {i \left (x^{2} b +2 a x \right ) \ln \left (1+i \left (b x +a \right )\right )}{4}-\frac {i b \,x^{2} \ln \left (1-i \left (b x +a \right )\right )}{4}-\frac {i a x \ln \left (1-i \left (b x +a \right )\right )}{2}+\frac {\pi b \,x^{2}}{4}+\frac {\pi a x}{2}-\frac {a^{2} \arctan \left (b x +a \right )}{2 b}+\frac {x}{2}-\frac {\arctan \left (b x +a \right )}{2 b}\) \(100\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.85 \[ \int (a+b x) \cot ^{-1}(a+b x) \, dx=\frac {b x + {\left (b^{2} x^{2} + 2 \, a b x + a^{2} + 1\right )} \operatorname {arccot}\left (b x + a\right )}{2 \, b} \]

[In]

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

[Out]

1/2*(b*x + (b^2*x^2 + 2*a*b*x + a^2 + 1)*arccot(b*x + a))/b

Sympy [A] (verification not implemented)

Time = 0.38 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.44 \[ \int (a+b x) \cot ^{-1}(a+b x) \, dx=\begin {cases} \frac {a^{2} \operatorname {acot}{\left (a + b x \right )}}{2 b} + a x \operatorname {acot}{\left (a + b x \right )} + \frac {b x^{2} \operatorname {acot}{\left (a + b x \right )}}{2} + \frac {x}{2} + \frac {\operatorname {acot}{\left (a + b x \right )}}{2 b} & \text {for}\: b \neq 0 \\a x \operatorname {acot}{\left (a \right )} & \text {otherwise} \end {cases} \]

[In]

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

[Out]

Piecewise((a**2*acot(a + b*x)/(2*b) + a*x*acot(a + b*x) + b*x**2*acot(a + b*x)/2 + x/2 + acot(a + b*x)/(2*b),
Ne(b, 0)), (a*x*acot(a), True))

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.33 \[ \int (a+b x) \cot ^{-1}(a+b x) \, dx=\frac {1}{2} \, b {\left (\frac {x}{b} - \frac {{\left (a^{2} + 1\right )} \arctan \left (\frac {b^{2} x + a b}{b}\right )}{b^{2}}\right )} + \frac {1}{2} \, {\left (b x^{2} + 2 \, a x\right )} \operatorname {arccot}\left (b x + a\right ) \]

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 100 vs. \(2 (33) = 66\).

Time = 0.33 (sec) , antiderivative size = 100, normalized size of antiderivative = 2.56 \[ \int (a+b x) \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 )^{4} + 2 \, \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 ) + 2 \, \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )}{8 \, b \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{2}} \]

[In]

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

[Out]

1/8*(arctan(1/(b*x + a))*tan(1/2*arctan(1/(b*x + a)))^4 + 2*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)) + 2*tan(1/2*arctan(1/(b*x + a))))/(b*tan(1/2*arctan(
1/(b*x + a)))^2)

Mupad [B] (verification not implemented)

Time = 1.74 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.26 \[ \int (a+b x) \cot ^{-1}(a+b x) \, dx=\frac {x}{2}+\frac {\frac {\mathrm {acot}\left (a+b\,x\right )}{2}+\frac {a^2\,\mathrm {acot}\left (a+b\,x\right )}{2}}{b}+a\,x\,\mathrm {acot}\left (a+b\,x\right )+\frac {b\,x^2\,\mathrm {acot}\left (a+b\,x\right )}{2} \]

[In]

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

[Out]

x/2 + (acot(a + b*x)/2 + (a^2*acot(a + b*x))/2)/b + a*x*acot(a + b*x) + (b*x^2*acot(a + b*x))/2