3.217 \(\int x \sin (a+x) \, dx\)

Optimal. Leaf size=12 \[ \sin (a+x)-x \cos (a+x) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 12, normalized size of antiderivative = 1.00, 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, 2637} \[ \sin (a+x)-x \cos (a+x) \]

Antiderivative was successfully verified.

[In]

Int[x*Sin[a + x],x]

[Out]

-(x*Cos[a + x]) + Sin[a + 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 (a+x) \, dx &=-x \cos (a+x)+\int \cos (a+x) \, dx\\ &=-x \cos (a+x)+\sin (a+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 12, normalized size = 1.00 \[ \sin (a+x)-x \cos (a+x) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Sin[a + x],x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 12, normalized size = 1.00 \[ -x \cos \left (a + x\right ) + \sin \left (a + x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 1.33, size = 12, normalized size = 1.00 \[ -x \cos \left (a + x\right ) + \sin \left (a + x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 21, normalized size = 1.75 \[ a \cos \left (a +x \right )-\left (a +x \right ) \cos \left (a +x \right )+\sin \left (a +x \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*sin(a+x),x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 20, normalized size = 1.67 \[ -{\left (a + x\right )} \cos \left (a + x\right ) + a \cos \left (a + x\right ) + \sin \left (a + x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.08, size = 12, normalized size = 1.00 \[ \sin \left (a+x\right )-x\,\cos \left (a+x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*sin(a + x),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.18, size = 10, normalized size = 0.83 \[ - x \cos {\left (a + x \right )} + \sin {\left (a + x \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(a+x),x)

[Out]

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

________________________________________________________________________________________