Optimal. Leaf size=17 \[ 2 \cos (x)-x^2 \cos (x)+2 x \sin (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 17, normalized size of antiderivative = 1.00, 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 = {3377, 2718}
\begin {gather*} x^2 (-\cos (x))+2 x \sin (x)+2 \cos (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2718
Rule 3377
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.01, size = 15, normalized size = 0.88 \begin {gather*} -\left (\left (-2+x^2\right ) \cos (x)\right )+2 x \sin (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.00, size = 18, normalized size = 1.06
method | result | size |
risch | \(\left (-x^{2}+2\right ) \cos \left (x \right )+2 x \sin \left (x \right )\) | \(17\) |
default | \(2 \cos \left (x \right )-x^{2} \cos \left (x \right )+2 x \sin \left (x \right )\) | \(18\) |
meijerg | \(4 \sqrt {\pi }\, \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\left (-\frac {x^{2}}{2}+1\right ) \cos \left (x \right )}{2 \sqrt {\pi }}+\frac {x \sin \left (x \right )}{2 \sqrt {\pi }}\right )\) | \(34\) |
norman | \(\frac {x^{2} \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-x^{2}+4 x \tan \left (\frac {x}{2}\right )+4}{1+\tan ^{2}\left (\frac {x}{2}\right )}\) | \(36\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.44, size = 15, normalized size = 0.88 \begin {gather*} -{\left (x^{2} - 2\right )} \cos \left (x\right ) + 2 \, x \sin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.76, size = 15, normalized size = 0.88 \begin {gather*} -{\left (x^{2} - 2\right )} \cos \left (x\right ) + 2 \, x \sin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.08, size = 17, normalized size = 1.00 \begin {gather*} - x^{2} \cos {\left (x \right )} + 2 x \sin {\left (x \right )} + 2 \cos {\left (x \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.64, size = 15, normalized size = 0.88 \begin {gather*} -{\left (x^{2} - 2\right )} \cos \left (x\right ) + 2 \, x \sin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.03, size = 15, normalized size = 0.88 \begin {gather*} 2\,x\,\sin \left (x\right )-\cos \left (x\right )\,\left (x^2-2\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________