Optimal. Leaf size=59 \[ \frac {x}{2}-\frac {i x^2}{2}+x \log \left (1+e^{2 i x}\right )-\frac {1}{2} i \text {Li}_2\left (-e^{2 i x}\right )-\frac {\tan (x)}{2}+\frac {1}{2} x \tan ^2(x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.167, Rules used = {3801, 3554, 8,
3800, 2221, 2317, 2438} \begin {gather*} -\frac {1}{2} i \text {PolyLog}\left (2,-e^{2 i x}\right )-\frac {i x^2}{2}+\frac {x}{2}+x \log \left (1+e^{2 i x}\right )+\frac {1}{2} x \tan ^2(x)-\frac {\tan (x)}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2221
Rule 2317
Rule 2438
Rule 3554
Rule 3800
Rule 3801
Rubi steps
\begin {align*} \int x \tan ^3(x) \, dx &=\frac {1}{2} x \tan ^2(x)-\frac {1}{2} \int \tan ^2(x) \, dx-\int x \tan (x) \, dx\\ &=-\frac {i x^2}{2}-\frac {\tan (x)}{2}+\frac {1}{2} x \tan ^2(x)+2 i \int \frac {e^{2 i x} x}{1+e^{2 i x}} \, dx+\frac {\int 1 \, dx}{2}\\ &=\frac {x}{2}-\frac {i x^2}{2}+x \log \left (1+e^{2 i x}\right )-\frac {\tan (x)}{2}+\frac {1}{2} x \tan ^2(x)-\int \log \left (1+e^{2 i x}\right ) \, dx\\ &=\frac {x}{2}-\frac {i x^2}{2}+x \log \left (1+e^{2 i x}\right )-\frac {\tan (x)}{2}+\frac {1}{2} x \tan ^2(x)+\frac {1}{2} i \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 i x}\right )\\ &=\frac {x}{2}-\frac {i x^2}{2}+x \log \left (1+e^{2 i x}\right )-\frac {1}{2} i \text {Li}_2\left (-e^{2 i x}\right )-\frac {\tan (x)}{2}+\frac {1}{2} x \tan ^2(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 54, normalized size = 0.92 \begin {gather*} -\frac {i x^2}{2}+x \log \left (1+e^{2 i x}\right )-\frac {1}{2} i \text {Li}_2\left (-e^{2 i x}\right )+\frac {1}{2} x \sec ^2(x)-\frac {\tan (x)}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.27, size = 59, normalized size = 1.00
method | result | size |
risch | \(-\frac {i x^{2}}{2}+\frac {2 x \,{\mathrm e}^{2 i x}-i {\mathrm e}^{2 i x}-i}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}+x \ln \left ({\mathrm e}^{2 i x}+1\right )-\frac {i \polylog \left (2, -{\mathrm e}^{2 i x}\right )}{2}\) | \(59\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 210 vs. \(2 (38) = 76\).
time = 3.79, size = 210, normalized size = 3.56 \begin {gather*} -\frac {x^{2} \cos \left (4 \, x\right ) + i \, x^{2} \sin \left (4 \, x\right ) + x^{2} - 2 \, {\left (x \cos \left (4 \, x\right ) + 2 \, x \cos \left (2 \, x\right ) + i \, x \sin \left (4 \, x\right ) + 2 i \, x \sin \left (2 \, x\right ) + x\right )} \arctan \left (\sin \left (2 \, x\right ), \cos \left (2 \, x\right ) + 1\right ) + 2 \, {\left (x^{2} + 2 i \, x + 1\right )} \cos \left (2 \, x\right ) + {\left (\cos \left (4 \, x\right ) + 2 \, \cos \left (2 \, x\right ) + i \, \sin \left (4 \, x\right ) + 2 i \, \sin \left (2 \, x\right ) + 1\right )} {\rm Li}_2\left (-e^{\left (2 i \, x\right )}\right ) - {\left (-i \, x \cos \left (4 \, x\right ) - 2 i \, x \cos \left (2 \, x\right ) + x \sin \left (4 \, x\right ) + 2 \, x \sin \left (2 \, x\right ) - i \, x\right )} \log \left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right ) + 2 \, {\left (i \, x^{2} - 2 \, x + i\right )} \sin \left (2 \, x\right ) + 2}{-2 i \, \cos \left (4 \, x\right ) - 4 i \, \cos \left (2 \, x\right ) + 2 \, \sin \left (4 \, x\right ) + 4 \, \sin \left (2 \, x\right ) - 2 i} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 138 vs. \(2 (38) = 76\).
time = 1.54, size = 138, normalized size = 2.34 \begin {gather*} \frac {x \cos \left (x\right )^{2} \log \left (i \, \cos \left (x\right ) + \sin \left (x\right ) + 1\right ) + x \cos \left (x\right )^{2} \log \left (i \, \cos \left (x\right ) - \sin \left (x\right ) + 1\right ) + x \cos \left (x\right )^{2} \log \left (-i \, \cos \left (x\right ) + \sin \left (x\right ) + 1\right ) + x \cos \left (x\right )^{2} \log \left (-i \, \cos \left (x\right ) - \sin \left (x\right ) + 1\right ) + i \, \cos \left (x\right )^{2} {\rm Li}_2\left (i \, \cos \left (x\right ) + \sin \left (x\right )\right ) - i \, \cos \left (x\right )^{2} {\rm Li}_2\left (i \, \cos \left (x\right ) - \sin \left (x\right )\right ) - i \, \cos \left (x\right )^{2} {\rm Li}_2\left (-i \, \cos \left (x\right ) + \sin \left (x\right )\right ) + i \, \cos \left (x\right )^{2} {\rm Li}_2\left (-i \, \cos \left (x\right ) - \sin \left (x\right )\right ) - \cos \left (x\right ) \sin \left (x\right ) + x}{2 \, \cos \left (x\right )^{2}} \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 \frac {x \sin ^{3}{\left (x \right )}}{\cos ^{3}{\left (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.02 \begin {gather*} \int \frac {x\,{\sin \left (x\right )}^3}{{\cos \left (x\right )}^3} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________