Evaluate: $ \int \frac{\sin x}{\sin x - \cos x} dx $ Consider
$$ \int \frac{\sin x}{\sin x - \cos x} dx $$
Well I tried taking integrand as $ \frac{\sin x - \cos x + \cos x}{\sin x - \cos x} $ so that it becomes,
$$ 1 + \frac{\cos x}{\sin x - \cos x} $$
But does not helps.
I want different techniques usable here.
 A: Set
$$ I = \int \frac{\sin x}{\sin x - \cos x} dx = \int 1 + \frac{\cos x}{\sin x - \cos x} dx$$
Therefore:
$$ 2I = \int 1 + \frac{\sin x +\cos x}{\sin x - \cos x} dx $$
$$ 2I = x + \log(\sin x - \cos x) + C$$
$$ I = \frac{x}{2} + \frac{1}{2} \log(\sin x - \cos x) + C$$
A: The shortest way, according to Bioche's rules, is to use the substitution
$$t=\tan x, \quad \mathrm dx=\frac{ \mathrm dt}{1+t^2},$$
which transforms the integral into the inthe integral of the rational function
$$\int\frac{t\,\mathrm dt}{(t-1)(1+t^2)}$$
There remains to decompose this fraction in partial fractions.
A: The substitution that generally works when you are integrating a function containing sines and cosines is
$$ u = \tan \frac{x}{2}.$$
Then you can show that
$$ dx = \frac{2\,du}{1+x^2}, \quad \sin x= \frac{2x}{1+x^2}, \quad \text{and} \quad \cos x = \frac{1-x^2}{1+x^2}, $$
which should transform your integrand into a rational function.
A: Let $$I_{1} = \int \frac{\sin x}{\sin x - \cos x}dx, \quad I_{2} = \int \frac{\cos x}{\sin x - \cos x}dx$$ 
Then $$I_{1}-I_{2} = \int 1\, dx =  x + c_{1}$$
$$I_{1}+I_{2} = \int \frac{\sin x + \cos x}{\sin x - \cos x} dx = \ln(\sin x - \cos x) + c_{2} $$ 
Then solve simultaneously 
$$I_{1} = \frac{1}{2}\left(x+ \ln(\sin x - \cos x) \right) + c$$
A: Take$$I=\int\mathrm dx\,\frac {\sin x}{\sin x-\cos x}$$$$J=\int\mathrm dx\,\frac {\cos x}{\sin x-\cos x}$$Subtracting gives$$I-J=\int\mathrm dx\,=x$$Adding gives$$I+J=\int\mathrm dx\,\frac {\sin x+\cos x}{\sin x-\cos x}=\log(\sin x-\cos x)$$Take the average of the two to see that$$\int\mathrm dx\,\frac {\sin x}{\sin x-\cos x}\color{blue}{=\frac 12x+\frac 12\log(\sin x-\cos x)+C}$$
A: Hint:
In general for 
$\displaystyle\dfrac{d\left(\dfrac{a\sin x+b\cos x}{c\sin x+d\cos x}\right)}{dx}$
write numerator$(a\sin x+b\cos x)$ as  $A(c\sin x+d\cos x)+B\cdot\dfrac{d(c\sin x+d\cos x)}{dx}$ 
Compare the coefficients of $\sin x,\cos x$ to find $A,B$
