Integrating $\int\dfrac{1}{1+\sin x+\cos x}$ 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.

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