Applying the Residue theorem to the function $ f:z\mapsto\frac{1}{z^{2}+4z+1} $ on the unit cercle : $$ 2\pi\mathrm{i}\,\mathrm{Res}\left(f,\sqrt{3}-2\right)=\oint_{\left|z\right|=1}{f\left(z\right)\mathrm{d}z} $$
$ \bullet \ \textrm{Res}\left(f,\sqrt{3}-2\right)=\lim\limits_{z\to \sqrt{3}-2}{\left(z+2-\sqrt{3}\right)f\left(z\right)}=\lim\limits_{z\to \sqrt{3}-2}{\frac{1}{z+2+\sqrt{3}}}=\frac{1}{2\sqrt{3}} $
$ \bullet\ \textrm{Substituting }\small\left\lbrace\begin{aligned}z&=\mathrm{e}^{\mathrm{i}x}\\ \mathrm{d}z&=\mathrm{i}\,\mathrm{e}^{\mathrm{i}x}\,\mathrm{d}x\end{aligned}\right.\textrm{, we get that : }\oint_{\left|z\right|=1}{f\left(z\right)\mathrm{d}z}=\frac{\mathrm{i}}{2}\int_{0}^{2\pi}{\frac{\mathrm{d}x}{2+\cos{x}}} $
Thus : $$ \int_{0}^{2\pi}{\frac{\mathrm{d}x}{2+\cos{x}}}=\frac{2\pi}{\sqrt{3}} $$
Hence : $$ \int_{0}^{2\pi}{\frac{\cos{x}}{2+\cos{x}}\,\mathrm{d}x}=2\pi-2\int_{0}^{2\pi}{\frac{\mathrm{d}x}{2+\cos{x}}}=2\pi-\frac{4\pi}{\sqrt{3}} $$