6

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.

Travis Willse
  • 99,363
Aligator
  • 1,454
  • 1
    for a generalization see https://math.stackexchange.com/questions/3241866/integrate-int-fracdxa-sin-xb-cos-x https://math.stackexchange.com/questions/3421982/last-step-in-evaluating-int-dx-over-a-cos-x-b-sin-x https://math.stackexchange.com/questions/1492113/int-fracdxa-sin-x-b-cos-x-using-complex-numbers – Stupid Questions Inc Mar 02 '20 at 09:48

5 Answers5

8

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

cqfd
  • 12,219
  • 6
  • 21
  • 51
3

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

Travis Willse
  • 99,363
3

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)$.

Hussain-Alqatari
  • 5,065
  • 2
  • 13
  • 39
  • 3
    Down voters, kindly explain why? – Hussain-Alqatari Oct 24 '19 at 15:55
  • There were already effectively two copies of this exact answer before yours. Why feel the need to add another? – Peter Foreman Oct 24 '19 at 16:33
  • 1
    It looks like they were all done at the same time. I see nothing wrong with independent answers. – marty cohen Oct 24 '19 at 19:06
  • 2
    @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! – Hussain-Alqatari Oct 25 '19 at 11:50
3

A continuation to your work

$$\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$$

Ali Shadhar
  • 25,498
0

Similarly to the other answers, notice that: \begin{align*} \sin(x) - \cos(x) & = \sqrt{2}\left(\sin(x)\frac{1}{\sqrt{2}} - \frac{1}{\sqrt{2}}\cos(x)\right)\\\\ & = -\sqrt{2}\left(\cos(x)\cos\left(\frac{\pi}{4}\right) - \sin(x)\sin\left(\frac{\pi}{4}\right)\right)\\\\ & = -\sqrt{2}\cos\left(x + \frac{\pi}{4}\right) \end{align*}

This is a slightly different approach from the answer proposed here.