3.135 \(\int \sin (a+b x) \sin (c+b x) \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {4569, 2637} \[ \frac {1}{2} x \cos (a-c)-\frac {\sin (a+2 b x+c)}{4 b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2637

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

Rule 4569

Int[Sin[v_]^(p_.)*Sin[w_]^(q_.), x_Symbol] :> Int[ExpandTrigReduce[Sin[v]^p*Sin[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]

Rubi steps

\begin {align*} \int \sin (a+b x) \sin (c+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.05, 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[Sin[a + b*x]*Sin[c + b*x],x]

[Out]

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

________________________________________________________________________________________

fricas [B]  time = 0.62, size = 50, normalized size = 1.85 \[ \frac {b x \cos \left (-a + c\right ) - \cos \left (b x + c\right ) \cos \left (-a + c\right ) \sin \left (b x + c\right ) + \cos \left (b x + c\right )^{2} \sin \left (-a + c\right )}{2 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.12, size = 23, normalized size = 0.85 \[ \frac {1}{2} \, x \cos \left (a - c\right ) - \frac {\sin \left (2 \, b x + a + c\right )}{4 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.05, size = 24, normalized size = 0.89 \[ \frac {x \cos \left (a -c \right )}{2}-\frac {\sin \left (2 b x +a +c \right )}{4 b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 23, normalized size = 0.85 \[ \frac {1}{2} \, x \cos \left (-a + c\right ) - \frac {\sin \left (2 \, b x + a + c\right )}{4 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 2.48, size = 36, normalized size = 1.33 \[ \left \{\begin {array}{cl} x\,\sin \relax (a)\,\sin \relax (c) & \text {\ if\ \ }b=0\\ \frac {x\,\cos \left (a-c\right )}{2}-\frac {\sin \left (a+c+2\,b\,x\right )}{4\,b} & \text {\ if\ \ }b\neq 0 \end {array}\right . \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

piecewise(b == 0, x*sin(a)*sin(c), b ~= 0, (x*cos(a - c))/2 - sin(a + c + 2*b*x)/(4*b))

________________________________________________________________________________________

sympy [A]  time = 0.74, size = 58, normalized size = 2.15 \[ \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 \sin {\relax (a )} \sin {\relax (c )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(b*x+a)*sin(b*x+c),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*sin(a)*sin(c), True))

________________________________________________________________________________________