Optimal. Leaf size=62 \[ \frac {1}{2} i \operatorname {PolyLog}\left (2,-e^{2 i x}\right )+\frac {i x^2}{2}+\frac {x}{4}-x \log \left (1+e^{2 i x}\right )-\frac {1}{2} x \sin ^2(x)-\frac {1}{4} \sin (x) \cos (x) \]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.000, Rules used = {4407, 3443, 2635, 8, 3719, 2190, 2279, 2391} \[ \frac {1}{2} i \text {PolyLog}\left (2,-e^{2 i x}\right )+\frac {i x^2}{2}+\frac {x}{4}-x \log \left (1+e^{2 i x}\right )-\frac {1}{2} x \sin ^2(x)-\frac {1}{4} \sin (x) \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2190
Rule 2279
Rule 2391
Rule 2635
Rule 3443
Rule 3719
Rule 4407
Rubi steps
\begin {align*} \int x \sin ^2(x) \tan (x) \, dx &=-\int x \cos (x) \sin (x) \, dx+\int x \tan (x) \, dx\\ &=\frac {i x^2}{2}-\frac {1}{2} x \sin ^2(x)-2 i \int \frac {e^{2 i x} x}{1+e^{2 i x}} \, dx+\frac {1}{2} \int \sin ^2(x) \, dx\\ &=\frac {i x^2}{2}-x \log \left (1+e^{2 i x}\right )-\frac {1}{4} \cos (x) \sin (x)-\frac {1}{2} x \sin ^2(x)+\frac {\int 1 \, dx}{4}+\int \log \left (1+e^{2 i x}\right ) \, dx\\ &=\frac {x}{4}+\frac {i x^2}{2}-x \log \left (1+e^{2 i x}\right )-\frac {1}{4} \cos (x) \sin (x)-\frac {1}{2} x \sin ^2(x)-\frac {1}{2} i \operatorname {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 i x}\right )\\ &=\frac {x}{4}+\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}{4} \cos (x) \sin (x)-\frac {1}{2} x \sin ^2(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.02, size = 57, normalized size = 0.92 \[ \frac {1}{2} i \operatorname {PolyLog}\left (2,-e^{2 i x}\right )+\frac {i x^2}{2}-x \log \left (1+e^{2 i x}\right )-\frac {1}{8} \sin (2 x)+\frac {1}{4} x \cos (2 x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x \sin ^2(x) \tan (x) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.41, size = 113, normalized size = 1.82 \[ \frac {1}{2} \, x \cos \relax (x)^{2} - \frac {1}{2} \, x \log \left (i \, \cos \relax (x) + \sin \relax (x) + 1\right ) - \frac {1}{2} \, x \log \left (i \, \cos \relax (x) - \sin \relax (x) + 1\right ) - \frac {1}{2} \, x \log \left (-i \, \cos \relax (x) + \sin \relax (x) + 1\right ) - \frac {1}{2} \, x \log \left (-i \, \cos \relax (x) - \sin \relax (x) + 1\right ) - \frac {1}{4} \, \cos \relax (x) \sin \relax (x) - \frac {1}{4} \, x - \frac {1}{2} i \, {\rm Li}_2\left (i \, \cos \relax (x) + \sin \relax (x)\right ) + \frac {1}{2} i \, {\rm Li}_2\left (i \, \cos \relax (x) - \sin \relax (x)\right ) + \frac {1}{2} i \, {\rm Li}_2\left (-i \, \cos \relax (x) + \sin \relax (x)\right ) - \frac {1}{2} i \, {\rm Li}_2\left (-i \, \cos \relax (x) - \sin \relax (x)\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x \sin \relax (x)^{3}}{\cos \relax (x)}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.09, size = 57, normalized size = 0.92
method | result | size |
risch | \(\frac {i x^{2}}{2}+\frac {\left (2 x +i\right ) {\mathrm e}^{2 i x}}{16}+\frac {\left (-i+2 x \right ) {\mathrm e}^{-2 i x}}{16}-x \ln \left (1+{\mathrm e}^{2 i x}\right )+\frac {i \polylog \left (2, -{\mathrm e}^{2 i x}\right )}{2}\) | \(57\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.47, size = 66, normalized size = 1.06 \[ \frac {1}{2} i \, x^{2} - i \, x \arctan \left (\sin \left (2 \, x\right ), \cos \left (2 \, x\right ) + 1\right ) + \frac {1}{4} \, x \cos \left (2 \, x\right ) - \frac {1}{2} \, x \log \left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right ) + \frac {1}{2} i \, {\rm Li}_2\left (-e^{\left (2 i \, x\right )}\right ) - \frac {1}{8} \, \sin \left (2 \, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.02 \[ \int \frac {x\,{\sin \relax (x)}^3}{\cos \relax (x)} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x \sin ^{3}{\relax (x )}}{\cos {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________