# $\int \frac{dx}{\sin x-\cos x}$

Evaluate $$\int \frac{dx}{\sin{x}-\cos{x}}$$

I know it can be done by Weierstrass substitution. But I am looking for new/simple approach. For example I tried:

$$\int \frac{1}{\sin{x}-\cos{x}} \cdot \frac{\sin{x}+\cos{x}}{\sin{x}+\cos{x}}dx=\int \frac{\sin{x}+\cos{x}}{-\cos{2x}}dx ,$$ but I can't continue from here.

• Mar 2, 2020 at 9:48

Write $$\sin{x}-\cos{x}=\sqrt2\left(\frac1{\sqrt2}\sin{x}-\frac1{\sqrt2}\cos{x}\right)=\sqrt2\sin\left(x-\frac{\pi}4\right).$$

Hint Using an angle sum formula gives $$\sin x - \cos x = \sqrt{2} \sin \left(x - \frac{\pi}{4}\right) .$$

Multiply and divide the denominator by $$\frac{\sqrt{2}}{2}$$ which is equal to $$\sin(\frac{\pi}{4})=\cos(\frac{\pi}{4})$$

Now use the fact that $$\sin(u-v)=\sin(u)\cos(v)-\cos(u)\sin(v)$$.

• Down voters, kindly explain why? Oct 24, 2019 at 15:55
• There were already effectively two copies of this exact answer before yours. Why feel the need to add another? Oct 24, 2019 at 16:33
• It looks like they were all done at the same time. I see nothing wrong with independent answers. Oct 24, 2019 at 19:06
• @martycohen Exactly. We did it simultaneously. Dear users/readers, vote (Down) for wrong answers. But for right answers, if you will not vote (Up) then just do not vote. Down votes may confuse the questioner or other users. Not only for this question, but for all. Kindly think about voting. Thanks! Oct 25, 2019 at 11:50

$$\frac1{\sin x-\cos x}=\frac{\sin x+\cos x}{\sin^2x-\cos^2x}=\frac{\sin x}{1-2\cos^2x}+\frac{\cos x}{2\sin^2-1}$$

Then

$$I=-\frac1{\sqrt{2}}\tanh^{-1}(\sqrt{2}\cos x)-\frac1{\sqrt{2}}\tanh^{-1}(\sqrt{2}\sin x)+C$$