Optimal. Leaf size=15 \[ -\frac {x^2}{2}+\log (\cos (x))+x \tan (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3801, 3556, 30}
\begin {gather*} -\frac {x^2}{2}+x \tan (x)+\log (\cos (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 3556
Rule 3801
Rubi steps
\begin {align*} \int x \tan ^2(x) \, dx &=x \tan (x)-\int x \, dx-\int \tan (x) \, dx\\ &=-\frac {x^2}{2}+\log (\cos (x))+x \tan (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 15, normalized size = 1.00 \begin {gather*} -\frac {x^2}{2}+\log (\cos (x))+x \tan (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.01, size = 20, normalized size = 1.33
method | result | size |
norman | \(x \tan \left (x \right )-\frac {x^{2}}{2}-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{2}\) | \(20\) |
risch | \(-\frac {x^{2}}{2}-2 i x +\frac {2 i x}{{\mathrm e}^{2 i x}+1}+\ln \left ({\mathrm e}^{2 i x}+1\right )\) | \(32\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 107 vs.
\(2 (13) = 26\).
time = 1.41, size = 107, normalized size = 7.13 \begin {gather*} -\frac {x^{2} \cos \left (2 \, x\right )^{2} + x^{2} \sin \left (2 \, x\right )^{2} + 2 \, x^{2} \cos \left (2 \, x\right ) + x^{2} - {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right ) - 4 \, x \sin \left (2 \, x\right )}{2 \, {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.49, size = 21, normalized size = 1.40 \begin {gather*} -\frac {1}{2} \, x^{2} + x \tan \left (x\right ) + \frac {1}{2} \, \log \left (\frac {1}{\tan \left (x\right )^{2} + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.06, size = 19, normalized size = 1.27 \begin {gather*} - \frac {x^{2}}{2} + x \tan {\left (x \right )} - \frac {\log {\left (\tan ^{2}{\left (x \right )} + 1 \right )}}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.59, size = 23, normalized size = 1.53 \begin {gather*} -\frac {1}{2} \, x^{2} + x \tan \left (x\right ) + \frac {1}{2} \, \log \left (\frac {4}{\tan \left (x\right )^{2} + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.02, size = 13, normalized size = 0.87 \begin {gather*} \ln \left (\cos \left (x\right )\right )+x\,\mathrm {tan}\left (x\right )-\frac {x^2}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________