Guidance or advice with $I=\int_0^{2\pi}\frac{1}{4+\cos t}dt$ Let
$$
\begin{align}
I=\int_0^{2\pi}\frac{1}{4+\cos t}dt
\end{align}
$$
I would like to evaluate this integral using cauchhy's Integral formula, I understand that I have to convert this into a form like $\int_{\gamma}\frac{f(z)}{z-z_0}dz$ .
I tried using $\cos t=\frac{e^{it}+e^{-it}}{2}$, but I didn't get anywhere. I haven't seen an example like this.

Let $z=e^{it}$, then $dz=ie^{it}\ dt$ or $dt=\dfrac{dz}{iz}$, and $\cos t=\dfrac{e^{it}+e^{-it}}{2}=\dfrac{z+z^{-1}}{2}$.
\begin{align}
\int_0^{2\pi}\frac{1}{4+\cos t}dt&=\oint_C\frac{1}{4+\frac{z+z^{-1}}{2}}\cdot\frac{dz}{iz}\\
&=\frac2i\oint_C\frac{1}{z^2+8z+1}dz,
\end{align}
where $C$ is the circle of unit radius with its center at the origin. The poles are $z_1=-4-\sqrt{15}$ and $z_2=\sqrt{15}-4$, but only $z_2$ lies inside $C$. The rest is finding the residue at $z_2$.
