# Find $\int \frac{1}{\sin x+\cos x }\, dx$

Attempt to find the indefinite integral:

$$\int \frac{1}{\sin x+\cos x}\, dx$$

WolframAlpha gives an unsatisfactory answer (this is one of the integrals that couldn't give the best answer):

$$(-1-i)(-1)^{\frac{3}{4}}\operatorname{arctanh}\frac{\tan(\frac{x}{2})-1}{\sqrt{2}}+C$$

Substitution also does not appear to work.

• use the tan-half angle substitution Feb 1, 2017 at 6:18
• Actually that's what WolframAlpha did haha Feb 1, 2017 at 6:20
• Hint: what's $(-1)^\frac{3}{4}$? Feb 1, 2017 at 6:29
• That's the result the computer gave Feb 1, 2017 at 6:41
• Wolfram Alpha gave an unsimplified result from symbolic manipulation. Taking the principal value, $$(-1-i)(-1)^{\frac{3}{4}}=\sqrt{2}$$ or try a more general case of $$\int \frac{dx}{a\sin x+b\cos x}$$ See the result here Feb 1, 2017 at 13:14

## 4 Answers

$$\int\frac{dx}{\sin x+\cos x}=\frac{\sqrt2}2\int\dfrac{dx}{\frac{\sqrt2}2\cos x+\frac{\sqrt2}2\sin x}=\frac{\sqrt2}2\int\sec(x-\frac{\pi}4)dx$$

Does this help?

• Yup exactly what I'm looking for. :P Feb 1, 2017 at 6:41

For $$I=\int\dfrac{dy}{A\sin2y+B\cos2y}=\int\dfrac{\sec^2y\ dy}{2A\tan y+B(1-\tan^2y)}$$

use Weierstrass substitution $t=\tan y$ to find $$I=\int\dfrac{dt}{2At+B(1-t^2)}=B\int\dfrac{dt}{B^2-A^2-(Bt+A)^2}$$

Here $2y=x$

• An interesring similar problem please check it out math.stackexchange.com/questions/2087128/… Feb 1, 2017 at 13:43
• @navinstudent, Posted an answer there. Feb 2, 2017 at 6:28

It is a bit unclear if you ask for another suggestion, or how to complete the calculation with $u=\tan(x/2)$.

I suggest that you instead let $u=\cos x-\sin x$. You will end up with $$-\int\frac{1}{2-u^2}\,du,$$ which I suppose you can handle.

• Then when you differentiate u you will get $\frac{du}{dx}=-sinx-cosx$ which would lead to further complications which are quite unnecessary. Feb 1, 2017 at 6:39
• I don't think they are complicated nor unnecessary. But I respect that you don't like the solution I gave. Feb 1, 2017 at 6:51

Hint $\int \frac{1+tan^2x/2}{2tanx/2 + 1-tan^2x/2}dx$ which is same as $\int \frac{sec^2x/2}{1+2tanx/2-tan^2x/2}dx$ Now put $tanx/2=t$ and proceed.

• Yup as mentioned WolframAlpha tried to use this half angle substitution and it gave the result shown above which is not satisfactory. Feb 1, 2017 at 14:12