Optimal. Leaf size=67 \[ \frac {i \cot ^{-1}(a x)^2}{a}+x \cot ^{-1}(a x)^2-\frac {2 \cot ^{-1}(a x) \log \left (\frac {2}{1+i a x}\right )}{a}+\frac {i \text {PolyLog}\left (2,1-\frac {2}{1+i a x}\right )}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 67, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.833, Rules used = {4931, 5041,
4965, 2449, 2352} \begin {gather*} \frac {i \text {Li}_2\left (1-\frac {2}{i a x+1}\right )}{a}+x \cot ^{-1}(a x)^2+\frac {i \cot ^{-1}(a x)^2}{a}-\frac {2 \log \left (\frac {2}{1+i a x}\right ) \cot ^{-1}(a x)}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2352
Rule 2449
Rule 4931
Rule 4965
Rule 5041
Rubi steps
\begin {align*} \int \cot ^{-1}(a x)^2 \, dx &=x \cot ^{-1}(a x)^2+(2 a) \int \frac {x \cot ^{-1}(a x)}{1+a^2 x^2} \, dx\\ &=\frac {i \cot ^{-1}(a x)^2}{a}+x \cot ^{-1}(a x)^2-2 \int \frac {\cot ^{-1}(a x)}{i-a x} \, dx\\ &=\frac {i \cot ^{-1}(a x)^2}{a}+x \cot ^{-1}(a x)^2-\frac {2 \cot ^{-1}(a x) \log \left (\frac {2}{1+i a x}\right )}{a}-2 \int \frac {\log \left (\frac {2}{1+i a x}\right )}{1+a^2 x^2} \, dx\\ &=\frac {i \cot ^{-1}(a x)^2}{a}+x \cot ^{-1}(a x)^2-\frac {2 \cot ^{-1}(a x) \log \left (\frac {2}{1+i a x}\right )}{a}+\frac {(2 i) \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1+i a x}\right )}{a}\\ &=\frac {i \cot ^{-1}(a x)^2}{a}+x \cot ^{-1}(a x)^2-\frac {2 \cot ^{-1}(a x) \log \left (\frac {2}{1+i a x}\right )}{a}+\frac {i \text {Li}_2\left (1-\frac {2}{1+i a x}\right )}{a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.06, size = 56, normalized size = 0.84 \begin {gather*} \frac {\cot ^{-1}(a x) \left ((i+a x) \cot ^{-1}(a x)-2 \log \left (1-e^{2 i \cot ^{-1}(a x)}\right )\right )+i \text {PolyLog}\left (2,e^{2 i \cot ^{-1}(a x)}\right )}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 129 vs. \(2 (63 ) = 126\).
time = 0.20, size = 130, normalized size = 1.94
method | result | size |
derivativedivides | \(\frac {\mathrm {arccot}\left (a x \right )^{2} \left (a x -i\right )-2 \,\mathrm {arccot}\left (a x \right ) \ln \left (1-\frac {a x +i}{\sqrt {a^{2} x^{2}+1}}\right )-2 \,\mathrm {arccot}\left (a x \right ) \ln \left (1+\frac {a x +i}{\sqrt {a^{2} x^{2}+1}}\right )+2 i \mathrm {arccot}\left (a x \right )^{2}+2 i \polylog \left (2, \frac {a x +i}{\sqrt {a^{2} x^{2}+1}}\right )+2 i \polylog \left (2, -\frac {a x +i}{\sqrt {a^{2} x^{2}+1}}\right )}{a}\) | \(130\) |
default | \(\frac {\mathrm {arccot}\left (a x \right )^{2} \left (a x -i\right )-2 \,\mathrm {arccot}\left (a x \right ) \ln \left (1-\frac {a x +i}{\sqrt {a^{2} x^{2}+1}}\right )-2 \,\mathrm {arccot}\left (a x \right ) \ln \left (1+\frac {a x +i}{\sqrt {a^{2} x^{2}+1}}\right )+2 i \mathrm {arccot}\left (a x \right )^{2}+2 i \polylog \left (2, \frac {a x +i}{\sqrt {a^{2} x^{2}+1}}\right )+2 i \polylog \left (2, -\frac {a x +i}{\sqrt {a^{2} x^{2}+1}}\right )}{a}\) | \(130\) |
risch | \(-\frac {i \ln \left (-i a x +1\right )^{2}}{4 a}+\frac {i \ln \left (\frac {1}{2}+\frac {i a x}{2}\right ) \ln \left (\frac {1}{2}-\frac {i a x}{2}\right )}{a}-\frac {i \ln \left (\frac {1}{2}+\frac {i a x}{2}\right ) \ln \left (-i a x +1\right )}{a}+\frac {i}{a}+\frac {i \pi ^{2}}{4 a}+\frac {i \ln \left (i a x +1\right )^{2}}{4 a}+\frac {\pi \ln \left (a^{2} x^{2}+1\right )}{2 a}+\frac {i \pi \ln \left (i a x +1\right ) x}{2}-\frac {i \pi \ln \left (-i a x +1\right ) x}{2}+\frac {\ln \left (i a x +1\right ) \ln \left (-i a x +1\right ) x}{2}+\frac {i \dilog \left (\frac {1}{2}-\frac {i a x}{2}\right )}{a}+\frac {i \ln \left (i a x +1\right ) \ln \left (-i a x +1\right )}{2 a}-\frac {\ln \left (i a x +1\right )^{2} x}{4}-\frac {\ln \left (-i a x +1\right )^{2} x}{4}+\frac {\pi ^{2} x}{4}-\frac {\pi }{a}\) | \(228\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \operatorname {acot}^{2}{\left (a x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.59, size = 55, normalized size = 0.82 \begin {gather*} \frac {-2\,\ln \left (1-{\mathrm {e}}^{\mathrm {acot}\left (a\,x\right )\,2{}\mathrm {i}}\right )\,\mathrm {acot}\left (a\,x\right )+\mathrm {polylog}\left (2,{\mathrm {e}}^{\mathrm {acot}\left (a\,x\right )\,2{}\mathrm {i}}\right )\,1{}\mathrm {i}+{\mathrm {acot}\left (a\,x\right )}^2\,1{}\mathrm {i}}{a}+x\,{\mathrm {acot}\left (a\,x\right )}^2 \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________