Optimal. Leaf size=17 \[ x^2 (-\cos (x))+2 x \sin (x)+2 \cos (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0207939, antiderivative size = 17, 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, 2638} \[ x^2 (-\cos (x))+2 x \sin (x)+2 \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3296
Rule 2638
Rubi steps
\begin{align*} \int x^2 \sin (x) \, dx &=-x^2 \cos (x)+2 \int x \cos (x) \, dx\\ &=-x^2 \cos (x)+2 x \sin (x)-2 \int \sin (x) \, dx\\ &=2 \cos (x)-x^2 \cos (x)+2 x \sin (x)\\ \end{align*}
Mathematica [A] time = 0.0131344, size = 15, normalized size = 0.88 \[ 2 x \sin (x)-\left (x^2-2\right ) \cos (x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.005, size = 18, normalized size = 1.1 \begin{align*} 2\,\cos \left ( x \right ) -{x}^{2}\cos \left ( x \right ) +2\,x\sin \left ( x \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.958066, size = 20, normalized size = 1.18 \begin{align*} -{\left (x^{2} - 2\right )} \cos \left (x\right ) + 2 \, x \sin \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.451698, size = 43, normalized size = 2.53 \begin{align*} -{\left (x^{2} - 2\right )} \cos \left (x\right ) + 2 \, x \sin \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.320582, size = 17, normalized size = 1. \begin{align*} - x^{2} \cos{\left (x \right )} + 2 x \sin{\left (x \right )} + 2 \cos{\left (x \right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.0679, size = 20, normalized size = 1.18 \begin{align*} -{\left (x^{2} - 2\right )} \cos \left (x\right ) + 2 \, x \sin \left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]