Optimal. Leaf size=104 \[ -\frac {x^2}{2}+\frac {4 i x^3}{3}+\frac {x^4}{4}-4 x^2 \log \left (1+e^{2 i x}\right )+\log (\cos (x))+4 i x \text {Li}_2\left (-e^{2 i x}\right )-2 \text {Li}_3\left (-e^{2 i x}\right )+x \tan (x)-x^3 \tan (x)-\frac {1}{2} x^2 \tan ^2(x)+\frac {1}{3} x^3 \tan ^3(x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 104, normalized size of antiderivative = 1.00, number of steps
used = 17, number of rules used = 8, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.000, Rules used = {3801, 3556, 30,
3800, 2221, 2611, 2320, 6724} \begin {gather*} 4 i x \text {PolyLog}\left (2,-e^{2 i x}\right )-2 \text {PolyLog}\left (3,-e^{2 i x}\right )+\frac {x^4}{4}+\frac {4 i x^3}{3}+\frac {1}{3} x^3 \tan ^3(x)-x^3 \tan (x)-\frac {x^2}{2}-4 x^2 \log \left (1+e^{2 i x}\right )-\frac {1}{2} x^2 \tan ^2(x)+x \tan (x)+\log (\cos (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2221
Rule 2320
Rule 2611
Rule 3556
Rule 3800
Rule 3801
Rule 6724
Rubi steps
\begin {align*} \int x^3 \tan ^4(x) \, dx &=\frac {1}{3} x^3 \tan ^3(x)-\int x^3 \tan ^2(x) \, dx-\int x^2 \tan ^3(x) \, dx\\ &=-x^3 \tan (x)-\frac {1}{2} x^2 \tan ^2(x)+\frac {1}{3} x^3 \tan ^3(x)+3 \int x^2 \tan (x) \, dx+\int x^3 \, dx+\int x^2 \tan (x) \, dx+\int x \tan ^2(x) \, dx\\ &=\frac {4 i x^3}{3}+\frac {x^4}{4}+x \tan (x)-x^3 \tan (x)-\frac {1}{2} x^2 \tan ^2(x)+\frac {1}{3} x^3 \tan ^3(x)-2 i \int \frac {e^{2 i x} x^2}{1+e^{2 i x}} \, dx-6 i \int \frac {e^{2 i x} x^2}{1+e^{2 i x}} \, dx-\int x \, dx-\int \tan (x) \, dx\\ &=-\frac {x^2}{2}+\frac {4 i x^3}{3}+\frac {x^4}{4}-4 x^2 \log \left (1+e^{2 i x}\right )+\log (\cos (x))+x \tan (x)-x^3 \tan (x)-\frac {1}{2} x^2 \tan ^2(x)+\frac {1}{3} x^3 \tan ^3(x)+2 \int x \log \left (1+e^{2 i x}\right ) \, dx+6 \int x \log \left (1+e^{2 i x}\right ) \, dx\\ &=-\frac {x^2}{2}+\frac {4 i x^3}{3}+\frac {x^4}{4}-4 x^2 \log \left (1+e^{2 i x}\right )+\log (\cos (x))+4 i x \text {Li}_2\left (-e^{2 i x}\right )+x \tan (x)-x^3 \tan (x)-\frac {1}{2} x^2 \tan ^2(x)+\frac {1}{3} x^3 \tan ^3(x)-i \int \text {Li}_2\left (-e^{2 i x}\right ) \, dx-3 i \int \text {Li}_2\left (-e^{2 i x}\right ) \, dx\\ &=-\frac {x^2}{2}+\frac {4 i x^3}{3}+\frac {x^4}{4}-4 x^2 \log \left (1+e^{2 i x}\right )+\log (\cos (x))+4 i x \text {Li}_2\left (-e^{2 i x}\right )+x \tan (x)-x^3 \tan (x)-\frac {1}{2} x^2 \tan ^2(x)+\frac {1}{3} x^3 \tan ^3(x)-\frac {1}{2} \text {Subst}\left (\int \frac {\text {Li}_2(-x)}{x} \, dx,x,e^{2 i x}\right )-\frac {3}{2} \text {Subst}\left (\int \frac {\text {Li}_2(-x)}{x} \, dx,x,e^{2 i x}\right )\\ &=-\frac {x^2}{2}+\frac {4 i x^3}{3}+\frac {x^4}{4}-4 x^2 \log \left (1+e^{2 i x}\right )+\log (\cos (x))+4 i x \text {Li}_2\left (-e^{2 i x}\right )-2 \text {Li}_3\left (-e^{2 i x}\right )+x \tan (x)-x^3 \tan (x)-\frac {1}{2} x^2 \tan ^2(x)+\frac {1}{3} x^3 \tan ^3(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 101, normalized size = 0.97 \begin {gather*} \frac {4 i x^3}{3}+\frac {x^4}{4}-4 x^2 \log \left (1+e^{2 i x}\right )+\log (\cos (x))+4 i x \text {Li}_2\left (-e^{2 i x}\right )-2 \text {Li}_3\left (-e^{2 i x}\right )-\frac {1}{2} x^2 \sec ^2(x)+x \tan (x)-\frac {4}{3} x^3 \tan (x)+\frac {1}{3} x^3 \sec ^2(x) \tan (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 138, normalized size = 1.33
method | result | size |
risch | \(\frac {x^{4}}{4}-\frac {2 i x \left (6 x^{2} {\mathrm e}^{4 i x}+6 x^{2} {\mathrm e}^{2 i x}-3 \,{\mathrm e}^{4 i x}-3 i x \,{\mathrm e}^{4 i x}+4 x^{2}-6 \,{\mathrm e}^{2 i x}-3 i x \,{\mathrm e}^{2 i x}-3\right )}{3 \left ({\mathrm e}^{2 i x}+1\right )^{3}}-2 \ln \left ({\mathrm e}^{i x}\right )+\ln \left ({\mathrm e}^{2 i x}+1\right )+\frac {8 i x^{3}}{3}-4 x^{2} \ln \left ({\mathrm e}^{2 i x}+1\right )+4 i x \polylog \left (2, -{\mathrm e}^{2 i x}\right )-2 \polylog \left (3, -{\mathrm e}^{2 i x}\right )\) | \(138\) |
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. 491 vs. \(2 (80) = 160\).
time = 2.54, size = 491, normalized size = 4.72 \begin {gather*} -\frac {3 i \, x^{4} + 12 \, {\left (4 \, x^{2} + {\left (4 \, x^{2} - 1\right )} \cos \left (6 \, x\right ) + 3 \, {\left (4 \, x^{2} - 1\right )} \cos \left (4 \, x\right ) + 3 \, {\left (4 \, x^{2} - 1\right )} \cos \left (2 \, x\right ) - {\left (-4 i \, x^{2} + i\right )} \sin \left (6 \, x\right ) - 3 \, {\left (-4 i \, x^{2} + i\right )} \sin \left (4 \, x\right ) - 3 \, {\left (-4 i \, x^{2} + i\right )} \sin \left (2 \, x\right ) - 1\right )} \arctan \left (\sin \left (2 \, x\right ), \cos \left (2 \, x\right ) + 1\right ) + {\left (3 i \, x^{4} - 32 \, x^{3} + 24 \, x\right )} \cos \left (6 \, x\right ) - 3 \, {\left (-3 i \, x^{4} + 16 \, x^{3} + 8 i \, x^{2} - 16 \, x\right )} \cos \left (4 \, x\right ) - 3 \, {\left (-3 i \, x^{4} + 16 \, x^{3} + 8 i \, x^{2} - 8 \, x\right )} \cos \left (2 \, x\right ) - 48 \, {\left (x \cos \left (6 \, x\right ) + 3 \, x \cos \left (4 \, x\right ) + 3 \, x \cos \left (2 \, x\right ) + i \, x \sin \left (6 \, x\right ) + 3 i \, x \sin \left (4 \, x\right ) + 3 i \, x \sin \left (2 \, x\right ) + x\right )} {\rm Li}_2\left (-e^{\left (2 i \, x\right )}\right ) - 6 \, {\left (4 i \, x^{2} + {\left (4 i \, x^{2} - i\right )} \cos \left (6 \, x\right ) + 3 \, {\left (4 i \, x^{2} - i\right )} \cos \left (4 \, x\right ) + 3 \, {\left (4 i \, x^{2} - i\right )} \cos \left (2 \, x\right ) - {\left (4 \, x^{2} - 1\right )} \sin \left (6 \, x\right ) - 3 \, {\left (4 \, x^{2} - 1\right )} \sin \left (4 \, x\right ) - 3 \, {\left (4 \, x^{2} - 1\right )} \sin \left (2 \, x\right ) - i\right )} \log \left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right ) - 24 \, {\left (i \, \cos \left (6 \, x\right ) + 3 i \, \cos \left (4 \, x\right ) + 3 i \, \cos \left (2 \, x\right ) - \sin \left (6 \, x\right ) - 3 \, \sin \left (4 \, x\right ) - 3 \, \sin \left (2 \, x\right ) + i\right )} {\rm Li}_{3}(-e^{\left (2 i \, x\right )}) - {\left (3 \, x^{4} + 32 i \, x^{3} - 24 i \, x\right )} \sin \left (6 \, x\right ) - 3 \, {\left (3 \, x^{4} + 16 i \, x^{3} - 8 \, x^{2} - 16 i \, x\right )} \sin \left (4 \, x\right ) - 3 \, {\left (3 \, x^{4} + 16 i \, x^{3} - 8 \, x^{2} - 8 i \, x\right )} \sin \left (2 \, x\right )}{-12 i \, \cos \left (6 \, x\right ) - 36 i \, \cos \left (4 \, x\right ) - 36 i \, \cos \left (2 \, x\right ) + 12 \, \sin \left (6 \, x\right ) + 36 \, \sin \left (4 \, x\right ) + 36 \, \sin \left (2 \, x\right ) - 12 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. 182 vs. \(2 (80) = 160\).
time = 0.92, size = 182, normalized size = 1.75 \begin {gather*} \frac {1}{3} \, x^{3} \tan \left (x\right )^{3} + \frac {1}{4} \, x^{4} - \frac {1}{2} \, x^{2} \tan \left (x\right )^{2} - \frac {1}{2} \, x^{2} - 2 i \, x {\rm Li}_2\left (\frac {2 \, {\left (i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1} + 1\right ) + 2 i \, x {\rm Li}_2\left (\frac {2 \, {\left (-i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1} + 1\right ) - \frac {1}{2} \, {\left (4 \, x^{2} - 1\right )} \log \left (-\frac {2 \, {\left (i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1}\right ) - \frac {1}{2} \, {\left (4 \, x^{2} - 1\right )} \log \left (-\frac {2 \, {\left (-i \, \tan \left (x\right ) - 1\right )}}{\tan \left (x\right )^{2} + 1}\right ) - {\left (x^{3} - x\right )} \tan \left (x\right ) - {\rm polylog}\left (3, \frac {\tan \left (x\right )^{2} + 2 i \, \tan \left (x\right ) - 1}{\tan \left (x\right )^{2} + 1}\right ) - {\rm polylog}\left (3, \frac {\tan \left (x\right )^{2} - 2 i \, \tan \left (x\right ) - 1}{\tan \left (x\right )^{2} + 1}\right ) \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^{3} \tan ^{4}{\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.01 \begin {gather*} \int x^3\,{\mathrm {tan}\left (x\right )}^4 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________