Computing the integral I have the following integral:
$$\int ^{2\pi}_0 \frac{d\phi}{3+\sin\phi+\cos\phi}$$
I write $\cos\phi=\frac{1}{2}(z+\frac{1}{z})$, $\sin\phi=\frac{1}{2i}(z-\frac{1}{z}) \, d\phi=\frac{1}{i} \frac{dz}{z}$, Now I plug these in the equation and I get $$\frac{2 \, dz}{6iz+z^2(i+1)+(i-1)}$$
I have no idea to proceed from here on. A methodological answer would help a lot. Thanks in advance!

Another approach that relies on real analysis only, is to use the Weierstrass Substitution $t=\tan (\phi/2)$.  We first simplify the denominator.  Note that 
$$\sin \phi +\cos \phi =\sqrt{2}\cos (\phi -\pi/4)$$ 
Then, exploiting the periodicity and evenness of the cosine function we can write
$$\int_0^{2\pi} \frac{1}{3+\sin \phi +\cos \phi}\,d\phi=2\int_0^\pi\frac{1}{3+\sqrt{2}\cos \phi}\,d\phi$$ 
Now, we enforce the substitution $t=\tan \phi/2$ so that $\cos \phi =\frac{1-t^2}{1+t^2}$ and $d\phi=\frac{2}{1+t^2}\,dt$.  Then, 
$$\begin{align}
2\int_0^\pi\frac{1}{3+\sqrt{2}\cos \phi}\,d\phi&=4\int_0^\infty \frac{1}{3(1+t^2)+\sqrt{2}(1-t^2)}\,dt\\\\
&=4\int_0^\infty \frac{1}{(3-\sqrt{2})t^2+(3+\sqrt{2})}\,dt\\\\
&=\frac{4}{3-\sqrt 2}\int_0^\infty \frac{1}{t^2+\frac{3+\sqrt 2}{3-\sqrt 2}}\,dt\\\\
&=2\pi \sqrt{\frac{1}{(3+\sqrt 2)(3-\sqrt 2)}}\\\
&=\frac{2\pi}{\sqrt 7}
\end{align}$$
