<s>[INST] Integration of trigonometric function $\int\frac{\sin(2x)}{\sin(x)-\cos(x)}dx$ 
$$\int\frac{\sin(2x)}{\sin(x)-\cos(x)}dx$$

My attempt: Firstly, $\sin(2x)=2\sin(x)\cos(x)$.
After that, eliminate the $\cos(x)$ seen in both the numerator and denominator to get
$$2\int\frac{\sin(x)}{\tan(x)-1}\ dx.$$
From here onwards, should I convert $\sin(x)$, $\tan(x)$ to half-angles and use $\tan(x/2)=t$?
But this would be a time consuming method. Any suggestions?
 [/INST] Hint:
$$\int\frac{\sin(2x)}{\sin(x)-\cos(x)}dx = \int\frac{2\sin(x)\cos(x) }{\sin(x)-\cos(x)}dx =  \int\frac{\sin(x)\cos(x)+\cos(x)\sin(x) }{\sin(x)-\cos(x)}dx\\
=\int\frac{\sin(x)\cos(x)-\sin^2(x)+\cos(x)\sin(x)-\cos^2(x)+1 }{\sin(x)-\cos(x)}dx \\=\int -\sin(x)dx+\int \cos(x)dx + \int \frac{1}{\sin(x) -\cos(x)}dx \\= \cos(x) + \sin(x) +\int \frac{1}{\sin(x) -\cos(x)}dx $$
For $\int \frac{1}{\sin(x) -\cos(x)}dx$:
Notice that $$\int \frac{1}{\sin(x) -\cos(x)}dx = \int \frac{1}{\sqrt{2} \sin(x-\frac{1}{4} \pi ) }dx$$
Let $u = x-\frac{1}{4} \pi$,
$$ \int \frac{1}{\sqrt{2} \sin\left(x-\frac{1}{4} \pi \right) }dx = \int \frac{1}{\sqrt{2} } \csc(u)du $$
</s>