3.24 \(\int x^3 \cos (x) \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 23, 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 = {3296, 2638} \[ x^3 \sin (x)+3 x^2 \cos (x)-6 x \sin (x)-6 \cos (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2638

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

Rule 3296

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 \cos (x) \, dx &=x^3 \sin (x)-3 \int x^2 \sin (x) \, dx\\ &=3 x^2 \cos (x)+x^3 \sin (x)-6 \int x \cos (x) \, dx\\ &=3 x^2 \cos (x)-6 x \sin (x)+x^3 \sin (x)+6 \int \sin (x) \, dx\\ &=-6 \cos (x)+3 x^2 \cos (x)-6 x \sin (x)+x^3 \sin (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 19, normalized size = 0.83 \[ x \left (x^2-6\right ) \sin (x)+3 \left (x^2-2\right ) \cos (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.40, size = 20, normalized size = 0.87 \[ 3 \, {\left (x^{2} - 2\right )} \cos \relax (x) + {\left (x^{3} - 6 \, x\right )} \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.01, size = 20, normalized size = 0.87 \[ 3 \, {\left (x^{2} - 2\right )} \cos \relax (x) + {\left (x^{3} - 6 \, x\right )} \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3*cos(x),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 24, normalized size = 1.04 \[ x^{3} \sin \relax (x )+3 x^{2} \cos \relax (x )-6 x \sin \relax (x )-6 \cos \relax (x ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.64, size = 20, normalized size = 0.87 \[ 3 \, {\left (x^{2} - 2\right )} \cos \relax (x) + {\left (x^{3} - 6 \, x\right )} \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.03, size = 24, normalized size = 1.04 \[ \cos \relax (x)\,\left (3\,x^2-6\right )-\sin \relax (x)\,\left (6\,x-x^3\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.64, size = 26, normalized size = 1.13 \[ x^{3} \sin {\relax (x )} + 3 x^{2} \cos {\relax (x )} - 6 x \sin {\relax (x )} - 6 \cos {\relax (x )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**3*cos(x),x)

[Out]

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

________________________________________________________________________________________