3.27 \(\int x \cos (x) \sin (x) \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 23, 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 = {3443, 2635, 8} \[ -\frac {x}{4}+\frac {1}{2} x \sin ^2(x)+\frac {1}{4} \sin (x) \cos (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2635

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

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

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 18, normalized size = 0.78 \[ \frac {1}{8} \sin (2 x)-\frac {1}{4} x \cos (2 x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 17, normalized size = 0.74 \[ -\frac {1}{2} \, x \cos \relax (x)^{2} + \frac {1}{4} \, \cos \relax (x) \sin \relax (x) + \frac {1}{4} \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.01, size = 14, normalized size = 0.61 \[ -\frac {1}{4} \, x \cos \left (2 \, x\right ) + \frac {1}{8} \, \sin \left (2 \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.00, size = 18, normalized size = 0.78 \[ -\frac {x \left (\cos ^{2}\relax (x )\right )}{2}+\frac {\cos \relax (x ) \sin \relax (x )}{4}+\frac {x}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.51, size = 14, normalized size = 0.61 \[ -\frac {1}{4} \, x \cos \left (2 \, x\right ) + \frac {1}{8} \, \sin \left (2 \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.09, size = 18, normalized size = 0.78 \[ \frac {\sin \left (2\,x\right )}{8}+\frac {x\,\left (2\,{\sin \relax (x)}^2-1\right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.34, size = 24, normalized size = 1.04 \[ \frac {x \sin ^{2}{\relax (x )}}{4} - \frac {x \cos ^{2}{\relax (x )}}{4} + \frac {\sin {\relax (x )} \cos {\relax (x )}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________