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.

Note that your integral can be rewritten as follows:

$$\color{blue}{ I = \int^{2\pi}_0 \frac{2}{8+ e^{it}+ e^{-it}} \, \mathrm{d}t = \int^{2\pi}_0 \frac{2 e^{it}}{e^{i 2 t} + 8 e^{it} + 1} \, \mathrm{d}t}$$

Define now $z \equiv e^{it}$, $\mathrm{d}z = ie^{it} \, \mathrm{d}t = i z \, \mathrm{d}t $, so:

$$ \color{blue}{I = \frac{2}{i} \int_\gamma \frac{\mathrm{d}z}{z^2 + 8 z + 1}}$$

What should then $\gamma$ be? Can you take it from here?
Cheers!

Spoiler:

 $$ I = \dfrac{2}{i}\times 2\pi i \times \displaystyle\lim_{z\to z_1} \frac{z-z_1}{z^2+8z+1} = \frac{2 \pi}{\sqrt{15}}, \quad z_1 = -4+\sqrt{15}$$

