\(\int x \sin (a+x) \, dx\) [217]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 6, antiderivative size = 12 \[ \int x \sin (a+x) \, dx=-x \cos (a+x)+\sin (a+x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3377, 2717} \[ \int x \sin (a+x) \, dx=\sin (a+x)-x \cos (a+x) \]

[In]

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

[Out]

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

Rule 2717

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

Rule 3377

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

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int x \sin (a+x) \, dx=-x \cos (a+x)+\sin (a+x) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.08

method result size
risch \(-x \cos \left (a +x \right )+\sin \left (a +x \right )\) \(13\)
parallelrisch \(-x \cos \left (a +x \right )+\sin \left (a +x \right )\) \(13\)
parts \(-x \cos \left (a +x \right )+\sin \left (a +x \right )\) \(13\)
derivativedivides \(a \cos \left (a +x \right )+\sin \left (a +x \right )-\left (a +x \right ) \cos \left (a +x \right )\) \(21\)
default \(a \cos \left (a +x \right )+\sin \left (a +x \right )-\left (a +x \right ) \cos \left (a +x \right )\) \(21\)
norman \(\frac {x \left (\tan ^{2}\left (\frac {a}{2}+\frac {x}{2}\right )\right )-x +2 \tan \left (\frac {a}{2}+\frac {x}{2}\right )}{1+\tan ^{2}\left (\frac {a}{2}+\frac {x}{2}\right )}\) \(42\)
meijerg \(2 \sin \left (a \right ) \sqrt {\pi }\, \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\cos \left (x \right )}{2 \sqrt {\pi }}+\frac {x \sin \left (x \right )}{2 \sqrt {\pi }}\right )+2 \cos \left (a \right ) \sqrt {\pi }\, \left (-\frac {x \cos \left (x \right )}{2 \sqrt {\pi }}+\frac {\sin \left (x \right )}{2 \sqrt {\pi }}\right )\) \(53\)

[In]

int(x*sin(a+x),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int x \sin (a+x) \, dx=-x \cos \left (a + x\right ) + \sin \left (a + x\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.83 \[ \int x \sin (a+x) \, dx=- x \cos {\left (a + x \right )} + \sin {\left (a + x \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.67 \[ \int x \sin (a+x) \, dx=-{\left (a + x\right )} \cos \left (a + x\right ) + a \cos \left (a + x\right ) + \sin \left (a + x\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int x \sin (a+x) \, dx=-x \cos \left (a + x\right ) + \sin \left (a + x\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int x \sin (a+x) \, dx=\sin \left (a+x\right )-x\,\cos \left (a+x\right ) \]

[In]

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

[Out]

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