3.1.25 \(\int x^3 \sin (x) \, dx\) [25]

Optimal. Leaf size=24 \[ 6 x \cos (x)-x^3 \cos (x)-6 \sin (x)+3 x^2 \sin (x) \]

[Out]

6*x*cos(x)-x^3*cos(x)-6*sin(x)+3*x^2*sin(x)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3377, 2717} \begin {gather*} x^3 (-\cos (x))+3 x^2 \sin (x)-6 \sin (x)+6 x \cos (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^3*Sin[x],x]

[Out]

6*x*Cos[x] - x^3*Cos[x] - 6*Sin[x] + 3*x^2*Sin[x]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps

\begin {align*} \int x^3 \sin (x) \, dx &=-x^3 \cos (x)+3 \int x^2 \cos (x) \, dx\\ &=-x^3 \cos (x)+3 x^2 \sin (x)-6 \int x \sin (x) \, dx\\ &=6 x \cos (x)-x^3 \cos (x)+3 x^2 \sin (x)-6 \int \cos (x) \, dx\\ &=6 x \cos (x)-x^3 \cos (x)-6 \sin (x)+3 x^2 \sin (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 20, normalized size = 0.83 \begin {gather*} -x \left (-6+x^2\right ) \cos (x)+3 \left (-2+x^2\right ) \sin (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^3*Sin[x],x]

[Out]

-(x*(-6 + x^2)*Cos[x]) + 3*(-2 + x^2)*Sin[x]

________________________________________________________________________________________

Mathics [A]
time = 1.80, size = 24, normalized size = 1.00 \begin {gather*} 6 x \text {Cos}\left [x\right ]+3 x^2 \text {Sin}\left [x\right ]-x^3 \text {Cos}\left [x\right ]-6 \text {Sin}\left [x\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[x^3*Sin[x],x]')

[Out]

6 x Cos[x] + 3 x ^ 2 Sin[x] - x ^ 3 Cos[x] - 6 Sin[x]

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 25, normalized size = 1.04

method result size
risch \(\left (-x^{3}+6 x \right ) \cos \left (x \right )+3 \left (x^{2}-2\right ) \sin \left (x \right )\) \(23\)
default \(6 x \cos \left (x \right )-x^{3} \cos \left (x \right )-6 \sin \left (x \right )+3 x^{2} \sin \left (x \right )\) \(25\)
meijerg \(8 \sqrt {\pi }\, \left (\frac {x \left (-\frac {5 x^{2}}{2}+15\right ) \cos \left (x \right )}{20 \sqrt {\pi }}-\frac {\left (-\frac {15 x^{2}}{2}+15\right ) \sin \left (x \right )}{20 \sqrt {\pi }}\right )\) \(36\)
norman \(\frac {x^{3} \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+6 x -x^{3}-6 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+6 x^{2} \tan \left (\frac {x}{2}\right )-12 \tan \left (\frac {x}{2}\right )}{1+\tan ^{2}\left (\frac {x}{2}\right )}\) \(55\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^3*sin(x),x,method=_RETURNVERBOSE)

[Out]

6*x*cos(x)-x^3*cos(x)-6*sin(x)+3*x^2*sin(x)

________________________________________________________________________________________

Maxima [A]
time = 0.25, size = 21, normalized size = 0.88 \begin {gather*} -{\left (x^{3} - 6 \, x\right )} \cos \left (x\right ) + 3 \, {\left (x^{2} - 2\right )} \sin \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3*sin(x),x, algorithm="maxima")

[Out]

-(x^3 - 6*x)*cos(x) + 3*(x^2 - 2)*sin(x)

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 21, normalized size = 0.88 \begin {gather*} -{\left (x^{3} - 6 \, x\right )} \cos \left (x\right ) + 3 \, {\left (x^{2} - 2\right )} \sin \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3*sin(x),x, algorithm="fricas")

[Out]

-(x^3 - 6*x)*cos(x) + 3*(x^2 - 2)*sin(x)

________________________________________________________________________________________

Sympy [A]
time = 0.16, size = 26, normalized size = 1.08 \begin {gather*} - x^{3} \cos {\left (x \right )} + 3 x^{2} \sin {\left (x \right )} + 6 x \cos {\left (x \right )} - 6 \sin {\left (x \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**3*sin(x),x)

[Out]

-x**3*cos(x) + 3*x**2*sin(x) + 6*x*cos(x) - 6*sin(x)

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 22, normalized size = 0.92 \begin {gather*} \left (-x^{3}+6 x\right ) \cos x+\left (3 x^{2}-6\right ) \sin x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3*sin(x),x)

[Out]

-(x^3 - 6*x)*cos(x) + 3*(x^2 - 2)*sin(x)

________________________________________________________________________________________

Mupad [B]
time = 0.03, size = 23, normalized size = 0.96 \begin {gather*} \cos \left (x\right )\,\left (6\,x-x^3\right )+\sin \left (x\right )\,\left (3\,x^2-6\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^3*sin(x),x)

[Out]

cos(x)*(6*x - x^3) + sin(x)*(3*x^2 - 6)

________________________________________________________________________________________