3.233 \(\int \cos (x) \sin (a+x) \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {4574, 2638} \[ \frac {1}{2} x \sin (a)-\frac {1}{4} \cos (a+2 x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2638

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

Rule 4574

Int[Cos[w_]^(q_.)*Sin[v_]^(p_.), x_Symbol] :> Int[ExpandTrigReduce[Sin[v]^p*Cos[w]^q, x], x] /; IGtQ[p, 0] &&
IGtQ[q, 0] && ((PolynomialQ[v, x] && PolynomialQ[w, x]) || (BinomialQ[{v, w}, x] && IndependentQ[Cancel[v/w],
x]))

Rubi steps

\begin {align*} \int \cos (x) \sin (a+x) \, dx &=\int \left (\frac {\sin (a)}{2}+\frac {1}{2} \sin (a+2 x)\right ) \, dx\\ &=\frac {1}{2} x \sin (a)+\frac {1}{2} \int \sin (a+2 x) \, dx\\ &=-\frac {1}{4} \cos (a+2 x)+\frac {1}{2} x \sin (a)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 18, normalized size = 1.00 \[ \frac {1}{4} (2 x \sin (a)-\cos (a+2 x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 28, normalized size = 1.56 \[ -\frac {1}{2} \, \cos \left (a + x\right )^{2} \cos \relax (a) - \frac {1}{2} \, \cos \left (a + x\right ) \sin \left (a + x\right ) \sin \relax (a) + \frac {1}{2} \, x \sin \relax (a) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 1.04, size = 14, normalized size = 0.78 \[ \frac {1}{2} \, x \sin \relax (a) - \frac {1}{4} \, \cos \left (a + 2 \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.05, size = 15, normalized size = 0.83 \[ \frac {x \sin \relax (a )}{2}-\frac {\cos \left (a +2 x \right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.42, size = 14, normalized size = 0.78 \[ \frac {1}{2} \, x \sin \relax (a) - \frac {1}{4} \, \cos \left (a + 2 \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.03, size = 14, normalized size = 0.78 \[ \frac {x\,\sin \relax (a)}{2}-\frac {\cos \left (a+2\,x\right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [B]  time = 0.54, size = 32, normalized size = 1.78 \[ - \frac {x \sin {\relax (x )} \cos {\left (a + x \right )}}{2} + \frac {x \sin {\left (a + x \right )} \cos {\relax (x )}}{2} + \frac {\sin {\relax (x )} \sin {\left (a + x \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________