Optimal. Leaf size=111 \[ \frac {x}{3 a^2}+\frac {x^2 \cot ^{-1}(a x)}{3 a}-\frac {i \cot ^{-1}(a x)^2}{3 a^3}+\frac {1}{3} x^3 \cot ^{-1}(a x)^2-\frac {\text {ArcTan}(a x)}{3 a^3}+\frac {2 \cot ^{-1}(a x) \log \left (\frac {2}{1+i a x}\right )}{3 a^3}-\frac {i \text {PolyLog}\left (2,1-\frac {2}{1+i a x}\right )}{3 a^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 8, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.800, Rules used = {4947, 5037,
327, 209, 5041, 4965, 2449, 2352} \begin {gather*} -\frac {\text {ArcTan}(a x)}{3 a^3}-\frac {i \text {Li}_2\left (1-\frac {2}{i a x+1}\right )}{3 a^3}-\frac {i \cot ^{-1}(a x)^2}{3 a^3}+\frac {2 \log \left (\frac {2}{1+i a x}\right ) \cot ^{-1}(a x)}{3 a^3}+\frac {x}{3 a^2}+\frac {1}{3} x^3 \cot ^{-1}(a x)^2+\frac {x^2 \cot ^{-1}(a x)}{3 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 327
Rule 2352
Rule 2449
Rule 4947
Rule 4965
Rule 5037
Rule 5041
Rubi steps
\begin {align*} \int x^2 \cot ^{-1}(a x)^2 \, dx &=\frac {1}{3} x^3 \cot ^{-1}(a x)^2+\frac {1}{3} (2 a) \int \frac {x^3 \cot ^{-1}(a x)}{1+a^2 x^2} \, dx\\ &=\frac {1}{3} x^3 \cot ^{-1}(a x)^2+\frac {2 \int x \cot ^{-1}(a x) \, dx}{3 a}-\frac {2 \int \frac {x \cot ^{-1}(a x)}{1+a^2 x^2} \, dx}{3 a}\\ &=\frac {x^2 \cot ^{-1}(a x)}{3 a}-\frac {i \cot ^{-1}(a x)^2}{3 a^3}+\frac {1}{3} x^3 \cot ^{-1}(a x)^2+\frac {1}{3} \int \frac {x^2}{1+a^2 x^2} \, dx+\frac {2 \int \frac {\cot ^{-1}(a x)}{i-a x} \, dx}{3 a^2}\\ &=\frac {x}{3 a^2}+\frac {x^2 \cot ^{-1}(a x)}{3 a}-\frac {i \cot ^{-1}(a x)^2}{3 a^3}+\frac {1}{3} x^3 \cot ^{-1}(a x)^2+\frac {2 \cot ^{-1}(a x) \log \left (\frac {2}{1+i a x}\right )}{3 a^3}-\frac {\int \frac {1}{1+a^2 x^2} \, dx}{3 a^2}+\frac {2 \int \frac {\log \left (\frac {2}{1+i a x}\right )}{1+a^2 x^2} \, dx}{3 a^2}\\ &=\frac {x}{3 a^2}+\frac {x^2 \cot ^{-1}(a x)}{3 a}-\frac {i \cot ^{-1}(a x)^2}{3 a^3}+\frac {1}{3} x^3 \cot ^{-1}(a x)^2-\frac {\tan ^{-1}(a x)}{3 a^3}+\frac {2 \cot ^{-1}(a x) \log \left (\frac {2}{1+i a x}\right )}{3 a^3}-\frac {(2 i) \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1+i a x}\right )}{3 a^3}\\ &=\frac {x}{3 a^2}+\frac {x^2 \cot ^{-1}(a x)}{3 a}-\frac {i \cot ^{-1}(a x)^2}{3 a^3}+\frac {1}{3} x^3 \cot ^{-1}(a x)^2-\frac {\tan ^{-1}(a x)}{3 a^3}+\frac {2 \cot ^{-1}(a x) \log \left (\frac {2}{1+i a x}\right )}{3 a^3}-\frac {i \text {Li}_2\left (1-\frac {2}{1+i a x}\right )}{3 a^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.21, size = 76, normalized size = 0.68 \begin {gather*} \frac {a x+\left (-i+a^3 x^3\right ) \cot ^{-1}(a x)^2+\cot ^{-1}(a x) \left (1+a^2 x^2+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 )}{3 a^3} \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. 187 vs. \(2 (93 ) = 186\).
time = 0.14, size = 188, normalized size = 1.69
method | result | size |
derivativedivides | \(\frac {\frac {a^{3} x^{3} \mathrm {arccot}\left (a x \right )^{2}}{3}+\frac {\mathrm {arccot}\left (a x \right ) a^{2} x^{2}}{3}-\frac {\mathrm {arccot}\left (a x \right ) \ln \left (a^{2} x^{2}+1\right )}{3}+\frac {a x}{3}-\frac {\arctan \left (a x \right )}{3}+\frac {i \ln \left (a x -i\right ) \ln \left (a^{2} x^{2}+1\right )}{6}-\frac {i \dilog \left (-\frac {i \left (a x +i\right )}{2}\right )}{6}-\frac {i \ln \left (a x -i\right ) \ln \left (-\frac {i \left (a x +i\right )}{2}\right )}{6}-\frac {i \ln \left (a x -i\right )^{2}}{12}-\frac {i \ln \left (a x +i\right ) \ln \left (a^{2} x^{2}+1\right )}{6}+\frac {i \dilog \left (\frac {i \left (a x -i\right )}{2}\right )}{6}+\frac {i \ln \left (a x +i\right ) \ln \left (\frac {i \left (a x -i\right )}{2}\right )}{6}+\frac {i \ln \left (a x +i\right )^{2}}{12}}{a^{3}}\) | \(188\) |
default | \(\frac {\frac {a^{3} x^{3} \mathrm {arccot}\left (a x \right )^{2}}{3}+\frac {\mathrm {arccot}\left (a x \right ) a^{2} x^{2}}{3}-\frac {\mathrm {arccot}\left (a x \right ) \ln \left (a^{2} x^{2}+1\right )}{3}+\frac {a x}{3}-\frac {\arctan \left (a x \right )}{3}+\frac {i \ln \left (a x -i\right ) \ln \left (a^{2} x^{2}+1\right )}{6}-\frac {i \dilog \left (-\frac {i \left (a x +i\right )}{2}\right )}{6}-\frac {i \ln \left (a x -i\right ) \ln \left (-\frac {i \left (a x +i\right )}{2}\right )}{6}-\frac {i \ln \left (a x -i\right )^{2}}{12}-\frac {i \ln \left (a x +i\right ) \ln \left (a^{2} x^{2}+1\right )}{6}+\frac {i \dilog \left (\frac {i \left (a x -i\right )}{2}\right )}{6}+\frac {i \ln \left (a x +i\right ) \ln \left (\frac {i \left (a x -i\right )}{2}\right )}{6}+\frac {i \ln \left (a x +i\right )^{2}}{12}}{a^{3}}\) | \(188\) |
risch | \(-\frac {i \ln \left (-i a x +1\right ) x^{2}}{6 a}+\frac {i \ln \left (i a x +1\right ) x^{2}}{6 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 )}{3 a^{3}}-\frac {i \dilog \left (\frac {1}{2}-\frac {i a x}{2}\right )}{3 a^{3}}-\frac {i \pi \ln \left (-i a x +1\right ) x^{3}}{6}+\frac {i \pi \ln \left (i a x +1\right ) x^{3}}{6}+\frac {x}{3 a^{2}}+\frac {\pi ^{2} x^{3}}{12}+\frac {11 \pi }{18 a^{3}}-\frac {\ln \left (i a x +1\right )^{2} x^{3}}{12}-\frac {\ln \left (-i a x +1\right )^{2} x^{3}}{12}-\frac {\pi \ln \left (a^{2} x^{2}+1\right )}{6 a^{3}}-\frac {\arctan \left (a x \right )}{3 a^{3}}-\frac {i \ln \left (i a x +1\right )^{2}}{12 a^{3}}+\frac {\ln \left (i a x +1\right ) \ln \left (-i a x +1\right ) x^{3}}{6}+\frac {\pi \,x^{2}}{6 a}-\frac {17 i}{54 a^{3}}+\frac {i \ln \left (-i a x +1\right )^{2}}{12 a^{3}}-\frac {i \ln \left (i a x +1\right ) \ln \left (-i a x +1\right )}{6 a^{3}}-\frac {i \pi ^{2}}{12 a^{3}}+\frac {i \ln \left (\frac {1}{2}+\frac {i a x}{2}\right ) \ln \left (-i a x +1\right )}{3 a^{3}}\) | \(298\) |
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 x^{2} \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 [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int x^2\,{\mathrm {acot}\left (a\,x\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________