Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having a hard time with this integration: $$\int\frac{1}{1+\sin x+\cos x}$$

I would prefer a hint to solve this.

Also, any other method except the conventional method is also welcome.

share|cite|improve this question
You could use the Weierstrass substitution. It's straightforward, but will work for sure. – barto Jun 4 '14 at 7:10
up vote 7 down vote accepted


For problem, of this type, Weierstrass substitution (or tangent half-angle substitution) is extremely useful. Using $t=\tan(x/2)$, you have $$\sin(x)=\frac{2t}{1+t^2}$$ $$\cos(x)=\frac{1-t^2}{1+t^2}$$ $$dx=\frac{2dt}{1+t^2}$$ So, for the integral $$\int\frac{dx}{1+\sin x+\cos x}=\int\frac{dt}{1+t}$$

I am sure that you can take from here.

share|cite|improve this answer

The $1+\cos x$ suggests replacing it by $2\cos^2\frac x2$. Knowing that $\sin x=2\sin\frac x2\cos\frac x2$, it becomes $$\frac12\int\frac{dx}{\cos\frac x2(\sin\frac x2+\cos\frac x2)}.$$ The next thing we could do is partial fraction decomposition, to get rid of the product in the denominator. Writing $$\frac1{\cos y(\sin y+\cos y)}=\frac{a\sin y +b\cos y}{\sin y+\cos y}+\frac{c\sin y+d\cos y}{\cos y}$$ we find $a=-1$, $b=1$, $c=1$ and $d=0$.
Using this we get $$\int\frac{\cos\frac x2-\sin\frac x2}{\sin\frac x2+\cos\frac x2}\frac{dx}2-\int\frac{-\sin\frac x2}{\cos\frac x2}\frac{dx}2.$$ Coincidentally, this is precisely $$\int\frac{d(\sin\frac x2+\cos\frac x2)}{\sin\frac x2+\cos\frac x2}-\int\frac{d(\cos\frac x2)}{\cos\frac x2}$$ wich is $$\log\left|\sin\frac x2+\cos\frac x2\right|-\log\left|\cos\frac x2\right|=\log\left|1+\tan\frac x2\right|.$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.