3.38 \(\int x \cos (2 x) \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0122093, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 6, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3296, 2638} \[ \frac{1}{2} x \sin (2 x)+\frac{1}{4} \cos (2 x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 2638

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

Rubi steps

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

Mathematica [A]  time = 0.0090039, size = 18, normalized size = 1. \[ \frac{1}{2} x \sin (2 x)+\frac{1}{4} \cos (2 x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 15, normalized size = 0.8 \begin{align*}{\frac{\cos \left ( 2\,x \right ) }{4}}+{\frac{x\sin \left ( 2\,x \right ) }{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.935605, size = 19, normalized size = 1.06 \begin{align*} \frac{1}{2} \, x \sin \left (2 \, x\right ) + \frac{1}{4} \, \cos \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.37485, size = 42, normalized size = 2.33 \begin{align*} \frac{1}{2} \, x \sin \left (2 \, x\right ) + \frac{1}{4} \, \cos \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.162415, size = 14, normalized size = 0.78 \begin{align*} \frac{x \sin{\left (2 x \right )}}{2} + \frac{\cos{\left (2 x \right )}}{4} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.04112, size = 19, normalized size = 1.06 \begin{align*} \frac{1}{2} \, x \sin \left (2 \, x\right ) + \frac{1}{4} \, \cos \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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