Optimal. Leaf size=47 \[ -\frac {\cot ^{-1}(a+b x)}{b (a+b x)}-\frac {\log (a+b x)}{b}+\frac {\log \left (1+(a+b x)^2\right )}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {5152, 4947,
272, 36, 29, 31} \begin {gather*} -\frac {\log (a+b x)}{b}+\frac {\log \left ((a+b x)^2+1\right )}{2 b}-\frac {\cot ^{-1}(a+b x)}{b (a+b x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 29
Rule 31
Rule 36
Rule 272
Rule 4947
Rule 5152
Rubi steps
\begin {align*} \int \frac {\cot ^{-1}(a+b x)}{(a+b x)^2} \, dx &=\frac {\text {Subst}\left (\int \frac {\cot ^{-1}(x)}{x^2} \, dx,x,a+b x\right )}{b}\\ &=-\frac {\cot ^{-1}(a+b x)}{b (a+b x)}-\frac {\text {Subst}\left (\int \frac {1}{x \left (1+x^2\right )} \, dx,x,a+b x\right )}{b}\\ &=-\frac {\cot ^{-1}(a+b x)}{b (a+b x)}-\frac {\text {Subst}\left (\int \frac {1}{x (1+x)} \, dx,x,(a+b x)^2\right )}{2 b}\\ &=-\frac {\cot ^{-1}(a+b x)}{b (a+b x)}-\frac {\text {Subst}\left (\int \frac {1}{x} \, dx,x,(a+b x)^2\right )}{2 b}+\frac {\text {Subst}\left (\int \frac {1}{1+x} \, dx,x,(a+b x)^2\right )}{2 b}\\ &=-\frac {\cot ^{-1}(a+b x)}{b (a+b x)}-\frac {\log (a+b x)}{b}+\frac {\log \left (1+(a+b x)^2\right )}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 40, normalized size = 0.85 \begin {gather*} -\frac {\frac {\cot ^{-1}(a+b x)}{a+b x}+\log (a+b x)-\frac {1}{2} \log \left (1+(a+b x)^2\right )}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 41, normalized size = 0.87
method | result | size |
derivativedivides | \(\frac {-\frac {\mathrm {arccot}\left (b x +a \right )}{b x +a}+\frac {\ln \left (1+\left (b x +a \right )^{2}\right )}{2}-\ln \left (b x +a \right )}{b}\) | \(41\) |
default | \(\frac {-\frac {\mathrm {arccot}\left (b x +a \right )}{b x +a}+\frac {\ln \left (1+\left (b x +a \right )^{2}\right )}{2}-\ln \left (b x +a \right )}{b}\) | \(41\) |
risch | \(-\frac {i \ln \left (1+i \left (b x +a \right )\right )}{2 b \left (b x +a \right )}-\frac {2 \ln \left (-b x -a \right ) b x -\ln \left (b^{2} x^{2}+2 a b x +a^{2}+1\right ) b x -i \ln \left (1-i \left (b x +a \right )\right )+2 \ln \left (-b x -a \right ) a -\ln \left (b^{2} x^{2}+2 a b x +a^{2}+1\right ) a +\pi }{2 b \left (b x +a \right )}\) | \(122\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 53, normalized size = 1.13 \begin {gather*} \frac {\log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + 1\right )}{2 \, b} - \frac {\log \left (b x + a\right )}{b} - \frac {\operatorname {arccot}\left (b x + a\right )}{{\left (b x + a\right )} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.11, size = 59, normalized size = 1.26 \begin {gather*} \frac {{\left (b x + a\right )} \log \left (b^{2} x^{2} + 2 \, a b x + a^{2} + 1\right ) - 2 \, {\left (b x + a\right )} \log \left (b x + a\right ) - 2 \, \operatorname {arccot}\left (b x + a\right )}{2 \, {\left (b^{2} x + a b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 5.25, size = 139, normalized size = 2.96 \begin {gather*} \begin {cases} - \frac {a \log {\left (\frac {a}{b} + x \right )}}{a b + b^{2} x} + \frac {a \log {\left (\frac {a}{b} + x - \frac {i}{b} \right )}}{a b + b^{2} x} + \frac {i a \operatorname {acot}{\left (a + b x \right )}}{a b + b^{2} x} - \frac {b x \log {\left (\frac {a}{b} + x \right )}}{a b + b^{2} x} + \frac {b x \log {\left (\frac {a}{b} + x - \frac {i}{b} \right )}}{a b + b^{2} x} + \frac {i b x \operatorname {acot}{\left (a + b x \right )}}{a b + b^{2} x} - \frac {\operatorname {acot}{\left (a + b x \right )}}{a b + b^{2} x} & \text {for}\: b \neq 0 \\\frac {x \operatorname {acot}{\left (a \right )}}{a^{2}} & \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. 238 vs.
\(2 (45) = 90\).
time = 0.44, size = 238, normalized size = 5.06 \begin {gather*} -\frac {\arctan \left (\frac {1}{b x + a}\right )^{2} - \frac {\arctan \left (\frac {1}{b x + a}\right )^{2} \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right )^{2} - \log \left (\frac {4 \, {\left (\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 )^{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 )^{2} - \arctan \left (\frac {1}{b x + a}\right )^{2} + 4 \, \arctan \left (\frac {1}{b x + a}\right ) \tan \left (\frac {1}{2} \, \arctan \left (\frac {1}{b x + a}\right )\right ) + \log \left (\frac {4 \, {\left (\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 )^{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 )^{2} - 1}}{2 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.77, size = 57, normalized size = 1.21 \begin {gather*} \frac {\ln \left (-a^2-2\,a\,b\,x-b^2\,x^2-1\right )}{2\,b}-\frac {\ln \left (a+b\,x\right )}{b}-\frac {\mathrm {acot}\left (a+b\,x\right )}{x\,b^2+a\,b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________