$$\int_{0}^{2\pi}\frac{d\theta}{1+2cos(\theta)}$$
My attempt:
parametrise using $z=e^{i\theta}$ (i think we always use a unit circle for CPV's)
$\therefore dz = ie^{i\theta}d\theta$ $\implies d\theta=\frac{dz}{iz}$
and $2cos(\theta) = e^{i\theta}+e^{-i\theta} = z+z^{-1}$
we can then re-write the integral as follows:
$$\int_{0}^{2\pi}\frac{d\theta}{1+2cos(\theta)} = \displaystyle\oint_{|z|=1}\frac{1}{(1+z+z^{-1})}\frac{dz}{iz}$$
$$\displaystyle\oint_{|z|=1}\frac{1}{(1+z+z^{-1})}\frac{dz}{iz} = \frac{1}{i}\displaystyle\oint_{|z|=1}\frac{dz}{(z^{2}+z+1)}$$
poles are at $z^2+z+1=0$ and know that $z^2+z+1=\frac{z^3-1}{z-1}$
therefore we require that $z\ne 1$ and $z^3=1$ and we know that $z=e^{i\theta}$
$\therefore z^3=e^{\pm2ki\pi}=1 \implies z = e^{\pm 2ki\pi/3}$
now the integral can be rewritten as:
$$\frac{1}{i}\displaystyle\oint_{|z|=1}\frac{dz}{(z-e^{2ki\pi/3})(z-e^{-2ki\pi/3})}$$
i think CPV = $2\pi i\sum Residues\space at\space the\space poles$=$$2\pi i\frac{1}{i} \left( \frac{1}{e^{2ki\pi/3}-e^{-2ki\pi/3}}+\frac{1}{e^{-2ki\pi/3}-e^{2ki\pi/3}}\right) = 2\pi \left( \frac{1-1}{e^{2ki\pi/3}-e^{-2ki\pi/3}}\right)=0$$
Is what i have done here correct, is this the right way the Cauchy integral theorem to find the CPV. Thanks for any help you can offer me.
Your method is correct, but just to make sure there are no questions, I am adding a diagram of the contour and description of the method I used.
The Cauchy Principal Value of $$ \int_0^{2\pi}\frac{\mathrm{d}\theta}{1+2\cos(\theta)} $$ is the contour integral $$ \int_{\gamma^-}\frac1{1+z+z^{-1}}\frac{\mathrm{d}z}{iz} =\frac1i\int_{\gamma^-}\frac{\mathrm{d}z}{z^2+z+1} $$ where $\gamma$ is the closed contour
and $\gamma^-$ is $\gamma$ minus the two small arcs around the singularities at $e^{2\pi i/3}$ and $e^{4\pi i/3}$ as the radius of the arcs goes to $0$.
There are no singularities inside $\gamma$. Thus, the integral along $\gamma$ is $0$. This means that the integral along $\gamma^-$ is $\pi i$ times the sum of the residues at $e^{2\pi i/3}$ and $e^{4\pi i/3}$ (each of the small arcs is $\frac12$ a circle clockwise and we want to subtract them).
That is $$ \begin{align} \mathrm{PV}\int_0^{2\pi}\frac{\mathrm{d}\theta}{1+2\cos(\theta)} &=\pi i\left[\operatorname*{Res}_{z=e^{2\pi i/3}}\left(\frac1i\frac1{z^2+z+1}\right)+\operatorname*{Res}_{z=e^{4\pi i/3}}\left(\frac1i\frac1{z^2+z+1}\right)\right]\\ &=\pi i\left[\frac{-1}{\sqrt3}+\frac1{\sqrt3}\right]\\[6pt] &=0 \end{align} $$