I want to compute $\int_{0}^{2\pi}\frac{d\varphi}{2+\sin{\varphi}}$ by writing $\sin{\varphi}$ as $$\frac{1}{2i}(e^{i\varphi} - e^{-i\varphi})$$ and making the substitution $z = e^{i\varphi}$. This gives $$\sin{\varphi} = \frac{1}{2i}(z - \bar{z})$$ and $$d\varphi = \frac{dz}{ie^{i\varphi}} = \frac{dz}{iz}.$$ I substitute this into the original integral and obtain $$\int_{0}^{2\pi}\frac{d\varphi}{2+\sin{\varphi}} = \int_{C[0,1]}\frac{dz}{iz(2+\frac{1}{2i}(z - \bar{z}))} = \int_{C[0,1]}\frac{dz}{2iz+\frac{1}{2}(z^2 - |z|^2)} = \int_{C[0,1]}\frac{2dz}{z^2 + 4iz - 1}$$
It's not clear to me how to proceed from here and someone has told me that Cauchy's Integral Formula can be applied, but I can't see how to get to that form just yet.
After making the substitution $ \left\lbrace\begin{aligned}z&=\mathrm{e}^{\mathrm{i}\varphi}\\ \mathrm{d}\varphi &=\frac{\mathrm{d}z}{\mathrm{i}z}\end{aligned}\right. $, the sine can just be replaced by $ \frac{1}{2\mathrm{i}}\left(z-\frac{1}{z}\right) \cdot $ Note that we're no longer in the real line : $$ \int_{0}^{2\pi}{\frac{\mathrm{d}\varphi}{2+\sin{\varphi}}}=2\oint_{\left|z\right|=1}{\frac{\mathrm{d}z}{z^{2}+4\mathrm{i}z-1}}=4\pi\mathrm{i}\,\mathrm{Res}\left(z\mapsto\frac{1}{z^{2}+4\mathrm{i}z-1},\mathrm{i}\left(\sqrt{3}-2\right)\right)=\frac{2\pi}{\sqrt{3}} $$