Optimal. Leaf size=16 \[ x^2 \sin (x)-2 \sin (x)+2 x \cos (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0212841, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 6, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3296, 2637} \[ x^2 \sin (x)-2 \sin (x)+2 x \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3296
Rule 2637
Rubi steps
\begin{align*} \int x^2 \cos (x) \, dx &=x^2 \sin (x)-2 \int x \sin (x) \, dx\\ &=2 x \cos (x)+x^2 \sin (x)-2 \int \cos (x) \, dx\\ &=2 x \cos (x)-2 \sin (x)+x^2 \sin (x)\\ \end{align*}
Mathematica [A] time = 0.012978, size = 14, normalized size = 0.88 \[ \left (x^2-2\right ) \sin (x)+2 x \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.001, size = 17, normalized size = 1.1 \begin{align*} 2\,x\cos \left ( x \right ) -2\,\sin \left ( x \right ) +{x}^{2}\sin \left ( x \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.947238, size = 19, normalized size = 1.19 \begin{align*} 2 \, x \cos \left (x\right ) +{\left (x^{2} - 2\right )} \sin \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.68208, size = 42, normalized size = 2.62 \begin{align*} 2 \, x \cos \left (x\right ) +{\left (x^{2} - 2\right )} \sin \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.318554, size = 17, normalized size = 1.06 \begin{align*} x^{2} \sin{\left (x \right )} + 2 x \cos{\left (x \right )} - 2 \sin{\left (x \right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.08699, size = 19, normalized size = 1.19 \begin{align*} 2 \, x \cos \left (x\right ) +{\left (x^{2} - 2\right )} \sin \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]