3.92 \(\int x \sin (x) \, dx\)

Optimal. Leaf size=8 \[ \sin (x)-x \cos (x) \]

[Out]

-x*cos(x)+sin(x)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 8, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3296, 2637} \[ \sin (x)-x \cos (x) \]

Antiderivative was successfully verified.

[In]

Int[x*Sin[x],x]

[Out]

-(x*Cos[x]) + Sin[x]

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]

Rubi steps

\begin {align*} \int x \sin (x) \, dx &=-x \cos (x)+\int \cos (x) \, dx\\ &=-x \cos (x)+\sin (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 8, normalized size = 1.00 \[ \sin (x)-x \cos (x) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Sin[x],x]

[Out]

-(x*Cos[x]) + Sin[x]

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 8, normalized size = 1.00 \[ -x \cos \relax (x) + \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x*cos(x) + sin(x)

________________________________________________________________________________________

giac [A]  time = 1.01, size = 8, normalized size = 1.00 \[ -x \cos \relax (x) + \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x*cos(x) + sin(x)

________________________________________________________________________________________

maple [A]  time = 0.00, size = 9, normalized size = 1.12 \[ -x \cos \relax (x )+\sin \relax (x ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*sin(x),x)

[Out]

-x*cos(x)+sin(x)

________________________________________________________________________________________

maxima [A]  time = 0.42, size = 8, normalized size = 1.00 \[ -x \cos \relax (x) + \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x*cos(x) + sin(x)

________________________________________________________________________________________

mupad [B]  time = 0.02, size = 8, normalized size = 1.00 \[ \sin \relax (x)-x\,\cos \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*sin(x),x)

[Out]

sin(x) - x*cos(x)

________________________________________________________________________________________

sympy [A]  time = 0.18, size = 7, normalized size = 0.88 \[ - x \cos {\relax (x )} + \sin {\relax (x )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(x),x)

[Out]

-x*cos(x) + sin(x)

________________________________________________________________________________________