\(\int \sin (c-b x) \sin (a+b x) \, dx\) [136]

   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 = 14, antiderivative size = 27 \[ \int \sin (c-b x) \sin (a+b x) \, dx=-\frac {1}{2} x \cos (a+c)+\frac {\sin (a-c+2 b x)}{4 b} \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4665, 2717} \[ \int \sin (c-b x) \sin (a+b x) \, dx=\frac {\sin (a+2 b x-c)}{4 b}-\frac {1}{2} x \cos (a+c) \]

[In]

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

[Out]

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

Rule 2717

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

Rule 4665

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*} \text {integral}& = \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] (verified)

Time = 0.03 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.96 \[ \int \sin (c-b x) \sin (a+b x) \, dx=\frac {-2 b x \cos (a+c)+\sin (a-c+2 b x)}{4 b} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.47 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89

method result size
default \(-\frac {x \cos \left (a +c \right )}{2}+\frac {\sin \left (2 x b +a -c \right )}{4 b}\) \(24\)
risch \(-\frac {x \cos \left (a +c \right )}{2}+\frac {\sin \left (2 x b +a -c \right )}{4 b}\) \(24\)
parallelrisch \(-\frac {2 x \cos \left (a +c \right ) b -\sin \left (2 x b +a -c \right )+\sin \left (a +c \right )}{4 b}\) \(31\)
norman \(\frac {\frac {\tan \left (\frac {a}{2}+\frac {x b}{2}\right )}{b}-\frac {x}{2}+\frac {x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}}{2}+\frac {x \tan \left (\frac {x b}{2}-\frac {c}{2}\right )^{2}}{2}-2 x \tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (\frac {x b}{2}-\frac {c}{2}\right )-\frac {x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2} \tan \left (\frac {x b}{2}-\frac {c}{2}\right )^{2}}{2}-\frac {\tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (\frac {x b}{2}-\frac {c}{2}\right )^{2}}{b}}{\left (1+\tan \left (\frac {x b}{2}-\frac {c}{2}\right )^{2}\right ) \left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right )}\) \(148\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.63 \[ \int \sin (c-b x) \sin (a+b x) \, dx=-\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} \]

[In]

integrate(-sin(b*x-c)*sin(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] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 61, normalized size of antiderivative = 2.26 \[ \int \sin (c-b x) \sin (a+b x) \, dx=- \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 (a + b x \right )} \cos {\left (b x - c \right )}}{2 b} & \text {for}\: b \neq 0 \\- x \sin {\left (a \right )} \sin {\left (c \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(-sin(b*x-c)*sin(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(a + b*x)*cos(b*x - c)/(2*b), N
e(b, 0)), (-x*sin(a)*sin(c), True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.85 \[ \int \sin (c-b x) \sin (a+b x) \, dx=-\frac {1}{2} \, x \cos \left (a + c\right ) + \frac {\sin \left (2 \, b x + a - c\right )}{4 \, b} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.85 \[ \int \sin (c-b x) \sin (a+b x) \, dx=-\frac {1}{2} \, x \cos \left (a + c\right ) + \frac {\sin \left (2 \, b x + a - c\right )}{4 \, b} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 27.34 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.33 \[ \int \sin (c-b x) \sin (a+b x) \, dx=\left \{\begin {array}{cl} x\,\sin \left (a\right )\,\sin \left (c\right ) & \text {\ if\ \ }b=0\\ \frac {\sin \left (a-c+2\,b\,x\right )}{4\,b}-\frac {x\,\cos \left (a+c\right )}{2} & \text {\ if\ \ }b\neq 0 \end {array}\right . \]

[In]

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

[Out]

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