3.1.34 \(\int x \sin ^3(x) \, dx\) [34]

Optimal. Leaf size=33 \[ -\frac {2}{3} x \cos (x)+\frac {2 \sin (x)}{3}-\frac {1}{3} x \cos (x) \sin ^2(x)+\frac {\sin ^3(x)}{9} \]

[Out]

-2/3*x*cos(x)+2/3*sin(x)-1/3*x*cos(x)*sin(x)^2+1/9*sin(x)^3

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

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]

Rule 3391

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 31, normalized size = 0.94 \begin {gather*} -\frac {3}{4} x \cos (x)+\frac {1}{12} x \cos (3 x)+\frac {3 \sin (x)}{4}-\frac {1}{36} \sin (3 x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(-3*x*Cos[x])/4 + (x*Cos[3*x])/12 + (3*Sin[x])/4 - Sin[3*x]/36

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 23, normalized size = 0.70

method result size
default \(-\frac {x \left (2+\sin ^{2}\left (x \right )\right ) \cos \left (x \right )}{3}+\frac {\left (\sin ^{3}\left (x \right )\right )}{9}+\frac {2 \sin \left (x \right )}{3}\) \(23\)
risch \(-\frac {3 x \cos \left (x \right )}{4}+\frac {3 \sin \left (x \right )}{4}+\frac {x \cos \left (3 x \right )}{12}-\frac {\sin \left (3 x \right )}{36}\) \(24\)
norman \(\frac {-\frac {2 x}{3}+\frac {32 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{9}+\frac {4 \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{3}-2 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+2 x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )+\frac {2 x \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{3}+\frac {4 \tan \left (\frac {x}{2}\right )}{3}}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{3}}\) \(65\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/3*x*(2+sin(x)^2)*cos(x)+1/9*sin(x)^3+2/3*sin(x)

________________________________________________________________________________________

Maxima [A]
time = 3.25, size = 23, normalized size = 0.70 \begin {gather*} \frac {1}{12} \, x \cos \left (3 \, x\right ) - \frac {3}{4} \, x \cos \left (x\right ) - \frac {1}{36} \, \sin \left (3 \, x\right ) + \frac {3}{4} \, \sin \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/12*x*cos(3*x) - 3/4*x*cos(x) - 1/36*sin(3*x) + 3/4*sin(x)

________________________________________________________________________________________

Fricas [A]
time = 1.54, size = 23, normalized size = 0.70 \begin {gather*} \frac {1}{3} \, x \cos \left (x\right )^{3} - x \cos \left (x\right ) - \frac {1}{9} \, {\left (\cos \left (x\right )^{2} - 7\right )} \sin \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/3*x*cos(x)^3 - x*cos(x) - 1/9*(cos(x)^2 - 7)*sin(x)

________________________________________________________________________________________

Sympy [A]
time = 0.13, size = 39, normalized size = 1.18 \begin {gather*} - x \sin ^{2}{\left (x \right )} \cos {\left (x \right )} - \frac {2 x \cos ^{3}{\left (x \right )}}{3} + \frac {7 \sin ^{3}{\left (x \right )}}{9} + \frac {2 \sin {\left (x \right )} \cos ^{2}{\left (x \right )}}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x*sin(x)**2*cos(x) - 2*x*cos(x)**3/3 + 7*sin(x)**3/9 + 2*sin(x)*cos(x)**2/3

________________________________________________________________________________________

Giac [A]
time = 0.48, size = 23, normalized size = 0.70 \begin {gather*} \frac {1}{12} \, x \cos \left (3 \, x\right ) - \frac {3}{4} \, x \cos \left (x\right ) - \frac {1}{36} \, \sin \left (3 \, x\right ) + \frac {3}{4} \, \sin \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/12*x*cos(3*x) - 3/4*x*cos(x) - 1/36*sin(3*x) + 3/4*sin(x)

________________________________________________________________________________________

Mupad [B]
time = 0.12, size = 25, normalized size = 0.76 \begin {gather*} \frac {x\,{\cos \left (x\right )}^3}{3}-\frac {\sin \left (x\right )\,{\cos \left (x\right )}^2}{9}-x\,\cos \left (x\right )+\frac {7\,\sin \left (x\right )}{9} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(7*sin(x))/9 + (x*cos(x)^3)/3 - (cos(x)^2*sin(x))/9 - x*cos(x)

________________________________________________________________________________________