3.138 \(\int \cos (c-b x) \cos (a+b x) \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0186565, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4570, 2637} \[ \frac{\sin (a+2 b x-c)}{4 b}+\frac{1}{2} x \cos (a+c) \]

Antiderivative was successfully verified.

[In]

Int[Cos[c - b*x]*Cos[a + b*x],x]

[Out]

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

Rule 4570

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

Rule 2637

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

Rubi steps

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

Mathematica [A]  time = 0.0231336, size = 26, normalized size = 0.96 \[ \frac{\sin (a+2 b x-c)+2 b x \cos (a+c)}{4 b} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c - b*x]*Cos[a + b*x],x]

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.012, size = 24, normalized size = 0.9 \begin{align*}{\frac{x\cos \left ( a+c \right ) }{2}}+{\frac{\sin \left ( 2\,bx+a-c \right ) }{4\,b}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(b*x-c)*cos(b*x+a),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.01705, size = 31, normalized size = 1.15 \begin{align*} \frac{1}{2} \, x \cos \left (a + c\right ) + \frac{\sin \left (2 \, b x + a - c\right )}{4 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x-c)*cos(b*x+a),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.38264, size = 123, normalized size = 4.56 \begin{align*} \frac{b x \cos \left (a + c\right ) + \cos \left (b x + a\right ) \cos \left (a + c\right ) \sin \left (b x + a\right ) - \cos \left (b x + a\right )^{2} \sin \left (a + c\right )}{2 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x-c)*cos(b*x+a),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 3.50541, size = 58, normalized size = 2.15 \begin{align*} \begin{cases} \frac{x \sin{\left (a + b x \right )} \sin{\left (b x - c \right )}}{2} + \frac{x \cos{\left (a + b x \right )} \cos{\left (b x - c \right )}}{2} + \frac{\sin{\left (b x - c \right )} \cos{\left (a + b x \right )}}{2 b} & \text{for}\: b \neq 0 \\x \cos{\left (a \right )} \cos{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x-c)*cos(b*x+a),x)

[Out]

Piecewise((x*sin(a + b*x)*sin(b*x - c)/2 + x*cos(a + b*x)*cos(b*x - c)/2 + sin(b*x - c)*cos(a + b*x)/(2*b), Ne
(b, 0)), (x*cos(a)*cos(c), True))

________________________________________________________________________________________

Giac [A]  time = 1.11017, size = 31, normalized size = 1.15 \begin{align*} \frac{1}{2} \, x \cos \left (a + c\right ) + \frac{\sin \left (2 \, b x + a - c\right )}{4 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x-c)*cos(b*x+a),x, algorithm="giac")

[Out]

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