Optimal. Leaf size=6 \[ x^2 \sec (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.178028, antiderivative size = 6, normalized size of antiderivative = 1., number of steps used = 13, number of rules used = 5, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {6742, 4181, 2279, 2391, 3757} \[ x^2 \sec (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6742
Rule 4181
Rule 2279
Rule 2391
Rule 3757
Rubi steps
\begin{align*} \int x \sec (x) (2+x \tan (x)) \, dx &=\int \left (2 x \sec (x)+x^2 \sec (x) \tan (x)\right ) \, dx\\ &=2 \int x \sec (x) \, dx+\int x^2 \sec (x) \tan (x) \, dx\\ &=-4 i x \tan ^{-1}\left (e^{i x}\right )+x^2 \sec (x)-2 \int \log \left (1-i e^{i x}\right ) \, dx+2 \int \log \left (1+i e^{i x}\right ) \, dx-2 \int x \sec (x) \, dx\\ &=x^2 \sec (x)+2 i \operatorname{Subst}\left (\int \frac{\log (1-i x)}{x} \, dx,x,e^{i x}\right )-2 i \operatorname{Subst}\left (\int \frac{\log (1+i x)}{x} \, dx,x,e^{i x}\right )+2 \int \log \left (1-i e^{i x}\right ) \, dx-2 \int \log \left (1+i e^{i x}\right ) \, dx\\ &=2 i \text{Li}_2\left (-i e^{i x}\right )-2 i \text{Li}_2\left (i e^{i x}\right )+x^2 \sec (x)-2 i \operatorname{Subst}\left (\int \frac{\log (1-i x)}{x} \, dx,x,e^{i x}\right )+2 i \operatorname{Subst}\left (\int \frac{\log (1+i x)}{x} \, dx,x,e^{i x}\right )\\ &=x^2 \sec (x)\\ \end{align*}
Mathematica [A] time = 0.024492, size = 6, normalized size = 1. \[ x^2 \sec (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.035, size = 20, normalized size = 3.3 \begin{align*} 2\,{\frac{{x}^{2}{{\rm e}^{ix}}}{1+{{\rm e}^{2\,ix}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.66423, size = 69, normalized size = 11.5 \begin{align*} \frac{2 \,{\left (x^{2} \cos \left (2 \, x\right ) \cos \left (x\right ) + x^{2} \sin \left (2 \, x\right ) \sin \left (x\right ) + x^{2} \cos \left (x\right )\right )}}{\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.96152, size = 16, normalized size = 2.67 \begin{align*} \frac{x^{2}}{\cos \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.552568, size = 5, normalized size = 0.83 \begin{align*} x^{2} \sec{\left (x \right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.09754, size = 35, normalized size = 5.83 \begin{align*} -\frac{x^{2} \tan \left (\frac{1}{2} \, x\right )^{2} + x^{2}}{\tan \left (\frac{1}{2} \, x\right )^{2} - 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]