Q:

Evaluating $\int\frac{\sin x}{\sin (x-a)\cdot \sin (x-b)}\,\mathrm dx$

$$\int\frac{\sin x}{\sin (x-a)\cdot \sin (x-b)}\,\mathrm dx$$
My Try:: 
\begin{align}
&\displaystyle \frac{1}{\sin (b-a)}\int\frac{\sin \{(x-a)-(x-b)\}}{\sin (x-a)\cdot \sin (x-b)}\cdot\sin x\,\mathrm dx\\ =& \frac{1}{\sin (b-a)}\int \left\{\cot (x-b)-\cot (x-a)\right\}\cdot \sin x \,\mathrm dx
\end{align}
Now how can I proceed after that?

A:

Wrong answer for now.
First let's rewrite: 
$$\frac{1}{\sin(x-a)\sin(x-b)}=\frac{p}{\sin(x-a)}+\frac{q}{\sin(x-b)} \quad(1)$$
Now multiplying $(1)$ by $\sin(x-a)$ followed by letting $x=a$ yields: 
$$\left(\frac{1}{\sin(x-b)}=p+q\underset{\rightarrow 0}{\frac{\sin(x-a)}{\sin(x-b)}}\right)\bigg|_{x=a}\Rightarrow p=\frac{1}{\sin(a-b)}$$
Similarly to obtain q, multiply $(1)$ by $\sin(x-b)$ and plugg $x=b$ gives: 
$$\left(\frac{1}{\sin(x-a)}=p\underset{\rightarrow 0}{\frac{\sin(x-b)}{\sin(x-a)}}+q\right)\bigg|_{x=b}\Rightarrow q=\frac{1}{\sin(b-a)}=-p$$
Back to the original integral, we have:
$$I=\int\frac{\sin x}{\sin (x-a)\cdot \sin (x-b)}dx=\frac{1}{\sin(a-b)}\left(\int\frac{\sin x}{\sin (x-a)}dx-\int\frac{\sin x}{\sin(x-b)}dx\right)$$
Now, it's enough to solve only one of these integrals. 
$$\int\frac{\sin x}{\sin(x-t)}dx=\int\frac{\sin(x-t+t)}{\sin (x-t)}dx=\cos t\int\frac{\sin(x-t)}{\sin(x-t)}dx+\sin t\int\frac{\cos(x-t)}{\sin(x-t)}dx=$$
$$=\cos t \cdot x +\sin t \cdot \ln|\sin(x-t)|+c$$
Thus replacing $t$ by $a$ and $b$ we get the answer to be:
$$I=\frac{1}{\sin(a-b)}\left((\cos a-\cos b)x+\sin a \ln|\sin(x-a)|-\sin b \ln|\sin(x-b)|\right)+C$$

