3.25 \(\int x^2 \sin (2 x) \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3296, 2638} \[ -\frac {1}{2} x^2 \cos (2 x)+\frac {1}{2} x \sin (2 x)+\frac {1}{4} \cos (2 x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 25, normalized size = 0.86 \[ \frac {1}{2} x \sin (2 x)-\frac {1}{4} \left (2 x^2-1\right ) \cos (2 x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-1/4*((-1 + 2*x^2)*Cos[2*x]) + (x*Sin[2*x])/2

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 21, normalized size = 0.72 \[ -\frac {1}{4} \, {\left (2 \, x^{2} - 1\right )} \cos \left (2 \, x\right ) + \frac {1}{2} \, x \sin \left (2 \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.95, size = 21, normalized size = 0.72 \[ -\frac {1}{4} \, {\left (2 \, x^{2} - 1\right )} \cos \left (2 \, x\right ) + \frac {1}{2} \, x \sin \left (2 \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 24, normalized size = 0.83 \[ -\frac {x^{2} \cos \left (2 x \right )}{2}+\frac {x \sin \left (2 x \right )}{2}+\frac {\cos \left (2 x \right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.43, size = 21, normalized size = 0.72 \[ -\frac {1}{4} \, {\left (2 \, x^{2} - 1\right )} \cos \left (2 \, x\right ) + \frac {1}{2} \, x \sin \left (2 \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.03, size = 24, normalized size = 0.83 \[ \frac {x\,\sin \left (2\,x\right )}{2}+\left (2\,{\sin \relax (x)}^2-1\right )\,\left (\frac {x^2}{2}-\frac {1}{4}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x*sin(2*x))/2 + (2*sin(x)^2 - 1)*(x^2/2 - 1/4)

________________________________________________________________________________________

sympy [A]  time = 0.33, size = 24, normalized size = 0.83 \[ - \frac {x^{2} \cos {\left (2 x \right )}}{2} + \frac {x \sin {\left (2 x \right )}}{2} + \frac {\cos {\left (2 x \right )}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x**2*cos(2*x)/2 + x*sin(2*x)/2 + cos(2*x)/4

________________________________________________________________________________________