<s>[INST] Integration Example How can i find the integration of this example
$$\int \frac{\sin x}{\sin x - \cos x } dx$$
I tried first add cos and then substracting cos but then what about $$\int \frac{\cos x}{\sin x - \cos x } dx\ ?$$ 
 [/INST] Let $f(a) = \int \frac{\sin(ax)}{\sin(x) - \cos(x)}dx$.
Differentiating throughout by a, we get
$$f'(a) = a\int \frac{\cos(ax)}{\sin(x) - \cos(x)}dx$$
Therefore, $$af(a) - f'(a) = a\int \frac{\sin(ax) - \cos(ax)}{\sin(x) - \cos(x)}dx$$
Substituting $a = 1$, we get
$$f(1) - f'(1) = x + C_1$$
Also,
$$af(a) + f'(a) = a\int \frac{\sin(ax) + \cos(ax)}{\sin(x) - \cos(x)}dx$$
Substituting $a = 1$ gives,
$$f(1) + f'(1) = \int \frac{\sin(x) + \cos(x)}{\sin(x) - \cos(x)}dx = \ln(\sin(x) - \cos(x)) + C_2$$
The integral was simply solved using the substitution $t = \sin(x) - \cos(x)$.
Solving the above two equations for $f(1)$ gives,
$$2f(1) = x + \ln(\sin(x) - \cos(x)) + C_1 + C_2$$
Therefore,
$$f(1) = \frac{1}{2}(x + \ln(\sin(x) - \cos(x)) + C_1 + C_2)$$
which is what we sought.
</s>