<s>[INST] Antiderivative of $\frac{1}{1+\sin {x} +\cos {x}}$ How do we arrive at the following integral
$$\displaystyle\int\dfrac{dx}{1+\sin {x}+\cos {x}}=\log {\left(\sin {\frac{x}{2}}+\cos {\frac{x}{2}}\right)}-\log {\left(\cos {\frac{x}{2}}\right)}+C\ ?$$
 [/INST] You can use the standard substitution 
\begin{align}
u=\tan{\frac{x}{2}}
\end{align}
Then
\begin{align}
\sin{x}=\frac{2u}{1+u^2}\\
\cos{x}=\frac{1-u^2}{1+u^2}\\
dx=\frac{2}{1+u^2}du\\
\end{align} 
You will end up with a rational function as an integrand. Use partial fractions to integrate then.

Edit:
The evalaution of this integral isn't too tedious after all. Turns out that the $u^2$ terms cancel so we are left with a linear denominator.
\begin{align}
\int\frac{dx}{1+\sin x+\cos x}
&=2\int\frac{du}{1+u^2+2u+1-u^2}\\
&=\log(1+u)+c\\
&=\log\left(1+\tan{\frac{x}{2}}\right)+c\\
\end{align}
</s>