Indefinite Integration

Evaluate $\displaystyle\int \dfrac{dx}{\sin\left(x - a\right) \sin \left(x - b\right)}$


$\begin{aligned} \text{Let } I & = \int \dfrac{dx}{\sin \left(x-a\right) \sin \left(x - b\right)} \\\\ & = \dfrac{1}{\sin \left(b - a\right)} \int \dfrac{\sin \left(b - a\right)}{\sin \left(x - a\right) \sin \left(x - b\right)} \; dx \\\\ & = \dfrac{1}{\sin \left(b - a\right)} \int \dfrac{\sin \left[\left(x - a\right) - \left(x - b\right)\right]}{\sin \left(x - a\right) \sin \left(x - b\right)} \; dx \\\\ & = \dfrac{1}{\sin \left(b - a\right)} \int \dfrac{\sin \left(x - a\right) \cos \left(x - b\right) - \cos \left(x - a\right) \sin \left(x - b\right)}{\sin \left(x - a\right) \sin \left(x - b\right)} \; dx \\\\ & \left[\text{Note: } \sin \left(\alpha - \beta\right) = \sin \alpha \cos \beta - \cos \alpha \sin \beta\right] \\\\ & = \dfrac{1}{\sin \left(b - a\right)} \int \left[\int \dfrac{\cos \left(x - b\right)}{\sin \left(x - b\right)} \; dx - \int \dfrac{\cos \left(x - a\right)}{\sin \left(x - a\right)} \; dx\right] \\\\ & = \dfrac{1}{\sin \left(b - a\right)} \left[\int \cot \left(x - b\right) \; dx - \int \cot \left(x - a\right) \; dx\right] \\\\ & = \dfrac{1}{\sin \left(b - a\right)} \left[\log \left|\sin \left(x - b\right)\right| - \log \left|\sin \left(x - a\right)\right|\right] + c \\\\ & = \dfrac{1}{\sin \left(b - a\right)} \log \left|\dfrac{\sin \left(x - b\right)}{\sin \left(x - a\right)}\right| + c \end{aligned}$