Optimal. Leaf size=39 \[ \frac {x}{2}+\frac {(a+b x)^2 \cot ^{-1}(a+b x)}{2 b}-\frac {\text {ArcTan}(a+b x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5152, 4947,
327, 209} \begin {gather*} -\frac {\text {ArcTan}(a+b x)}{2 b}+\frac {(a+b x)^2 \cot ^{-1}(a+b x)}{2 b}+\frac {x}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 327
Rule 4947
Rule 5152
Rubi steps
\begin {align*} \int (a+b x) \cot ^{-1}(a+b x) \, dx &=\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 {\tan ^{-1}(a+b x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.05, size = 141, normalized size = 3.62 \begin {gather*} 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 \text {ArcTan}(a+b x)+\log \left (1+a^2+2 a b x+b^2 x^2\right )\right )}{2 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 36, normalized size = 0.92
method | result | size |
derivativedivides | \(\frac {\frac {\left (b x +a \right )^{2} \mathrm {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} \mathrm {arccot}\left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}-\frac {\arctan \left (b x +a \right )}{2}}{b}\) | \(36\) |
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 {\pi b \,x^{2}}{4}-\frac {i a x \ln \left (1-i \left (b x +a \right )\right )}{2}+\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\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.47, size = 52, normalized size = 1.33 \begin {gather*} \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 ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.24, size = 33, normalized size = 0.85 \begin {gather*} \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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 2.59, size = 56, normalized size = 1.44 \begin {gather*} \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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 100 vs.
\(2 (33) = 66\).
time = 0.43, size = 100, normalized size = 2.56 \begin {gather*} \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}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.51, size = 49, normalized size = 1.26 \begin {gather*} \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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________