3.486 \(\int x^2 \cos (x) \sin ^2(x) \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3443, 3310, 3296, 2637} \[ \frac {1}{3} x^2 \sin ^3(x)-\frac {2 \sin ^3(x)}{27}-\frac {4 \sin (x)}{9}+\frac {4}{9} x \cos (x)+\frac {2}{9} x \sin ^2(x) \cos (x) \]

Antiderivative was successfully verified.

[In]

Int[x^2*Cos[x]*Sin[x]^2,x]

[Out]

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

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[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]

Rule 3310

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]

Rule 3443

Int[Cos[(a_.) + (b_.)*(x_)^(n_.)]*(x_)^(m_.)*Sin[(a_.) + (b_.)*(x_)^(n_.)]^(p_.), x_Symbol] :> Simp[(x^(m - n
+ 1)*Sin[a + b*x^n]^(p + 1))/(b*n*(p + 1)), x] - Dist[(m - n + 1)/(b*n*(p + 1)), Int[x^(m - n)*Sin[a + b*x^n]^
(p + 1), x], x] /; FreeQ[{a, b, p}, x] && LtQ[0, n, m + 1] && NeQ[p, -1]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.13, size = 39, normalized size = 0.89 \[ \frac {1}{54} \left (\sin (x) \left (9 x^2+\left (2-9 x^2\right ) \cos (2 x)-26\right )+27 x \cos (x)-3 x \cos (3 x)\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x^2*Cos[x]*Sin[x]^2,x]

[Out]

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

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int x^2 \cos (x) \sin ^2(x) \, dx \]

Verification is Not applicable to the result.

[In]

IntegrateAlgebraic[x^2*Cos[x]*Sin[x]^2,x]

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 1.20, size = 36, normalized size = 0.82 \[ -\frac {2}{9} \, x \cos \relax (x)^{3} + \frac {2}{3} \, x \cos \relax (x) - \frac {1}{27} \, {\left ({\left (9 \, x^{2} - 2\right )} \cos \relax (x)^{2} - 9 \, x^{2} + 14\right )} \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.62, size = 35, normalized size = 0.80 \[ -\frac {1}{18} \, x \cos \left (3 \, x\right ) + \frac {1}{2} \, x \cos \relax (x) - \frac {1}{108} \, {\left (9 \, x^{2} - 2\right )} \sin \left (3 \, x\right ) + \frac {1}{4} \, {\left (x^{2} - 2\right )} \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.38, size = 32, normalized size = 0.73




method result size



default \(\frac {x^{2} \left (\sin ^{3}\relax (x )\right )}{3}+\frac {2 x \left (2+\sin ^{2}\relax (x )\right ) \cos \relax (x )}{9}-\frac {2 \left (\sin ^{3}\relax (x )\right )}{27}-\frac {4 \sin \relax (x )}{9}\) \(32\)
risch \(\frac {x \cos \relax (x )}{2}+\frac {\left (x^{2}-2\right ) \sin \relax (x )}{4}-\frac {x \cos \left (3 x \right )}{18}-\frac {\left (9 x^{2}-2\right ) \sin \left (3 x \right )}{108}\) \(36\)
norman \(\frac {\frac {4 x}{9}-\frac {64 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{27}-\frac {8 \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{9}+\frac {4 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{3}-\frac {4 x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{3}-\frac {4 x \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{9}+\frac {8 x^{2} \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{3}-\frac {8 \tan \left (\frac {x}{2}\right )}{9}}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{3}}\) \(76\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*cos(x)*sin(x)^2,x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.61, size = 35, normalized size = 0.80 \[ -\frac {1}{18} \, x \cos \left (3 \, x\right ) + \frac {1}{2} \, x \cos \relax (x) - \frac {1}{108} \, {\left (9 \, x^{2} - 2\right )} \sin \left (3 \, x\right ) + \frac {1}{4} \, {\left (x^{2} - 2\right )} \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 40, normalized size = 0.91 \[ \frac {x^2\,{\sin \relax (x)}^3}{3}+\frac {4\,x\,{\cos \relax (x)}^3}{9}+\frac {2\,x\,\cos \relax (x)\,{\sin \relax (x)}^2}{3}-\frac {4\,{\cos \relax (x)}^2\,\sin \relax (x)}{9}-\frac {14\,{\sin \relax (x)}^3}{27} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*cos(x)*sin(x)^2,x)

[Out]

(4*x*cos(x)^3)/9 - (14*sin(x)^3)/27 + (x^2*sin(x)^3)/3 - (4*cos(x)^2*sin(x))/9 + (2*x*cos(x)*sin(x)^2)/3

________________________________________________________________________________________

sympy [A]  time = 1.23, size = 53, normalized size = 1.20 \[ \frac {x^{2} \sin ^{3}{\relax (x )}}{3} + \frac {2 x \sin ^{2}{\relax (x )} \cos {\relax (x )}}{3} + \frac {4 x \cos ^{3}{\relax (x )}}{9} - \frac {14 \sin ^{3}{\relax (x )}}{27} - \frac {4 \sin {\relax (x )} \cos ^{2}{\relax (x )}}{9} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*cos(x)*sin(x)**2,x)

[Out]

x**2*sin(x)**3/3 + 2*x*sin(x)**2*cos(x)/3 + 4*x*cos(x)**3/9 - 14*sin(x)**3/27 - 4*sin(x)*cos(x)**2/9

________________________________________________________________________________________