Find value of integral: $I=\int_0^{2\pi}\frac{dx}{(2+\cos x)^2}$ Find value of integral: $$I_1=\int_0^{2\pi}\frac{dx}{(2+\cos x)^2}$$ and  $$I_2=\int_0^{2\pi}\frac{dx}{(2+\sin x)^2}$$
I don't know how, i need a solution, please

We can also use contour integration.
Let $z=e^{ix}$, then $\mathrm{d}x=-i\,\mathrm{d}z/z$ and $\cos(x)=\frac{z+1/z}{2}$
$$
\begin{align}
\int_0^{2\pi}\frac{\mathrm{d}x}{(2+\cos(x))^2}
&=\oint\frac{-i\,\mathrm{d}{z}/z}{\left(2+\frac{z+1/z}{2}\right)^2}\\
&=\oint\frac{-4iz\,\mathrm{d}{z}}{(z^2+4z+1)^2}\tag{1}
\end{align}
$$
The zeros of $z^2+4z+1$ are $-2\pm\sqrt3$. $-2-\sqrt3$ is outside the unit circle, so the only pole that matters is at $-2+\sqrt3$.
Partial fractions gives
$$
\frac{z}{(z-a)^2(z-b)^2}=\frac{\frac{a+b}{(b-a)^3}}{z-a}+\frac{\frac{b+a}{(a-b)^3}}{z-b}+\frac{\frac{a}{(a-b)^2}}{(z-a)^2}+\frac{\frac{b}{(b-a)^2}}{(z-b)^2}\tag{2}
$$
With $a=-2+\sqrt3$ and $b=-2-\sqrt3$, we get the residue of $(2)$ at $z=a$ to be $\frac1{6\sqrt3}$. Plugging this into $(1)$ gives
$$
\begin{align}
\int_0^{2\pi}\frac{\mathrm{d}x}{(2+\cos(x))^2}
&=(2\pi i)(-4i)\frac1{6\sqrt3}\\
&=\frac{4\pi}{3\sqrt3}\tag{3}
\end{align}
$$

My original inclination was to use Igor's substitution, just to verify the previous answer, I will compute using the substitution $z=\tan(x/2)$, where $\mathrm{d}x=\frac{2\,\mathrm{d}z}{1+z^2}$ and $\cos(x)=\frac{1-z^2}{1+z^2}$ :
$$
\begin{align}
&\int_0^{2\pi}\frac{\mathrm{d}x}{(2+\cos(x))^2}\\
&=\int_{-\infty}^\infty\frac{\frac{2\,\mathrm{d}z}{1+z^2}}{\left(2+\frac{1-z^2}{1+z^2}\right)^2}\\
&=\int_{-\infty}^\infty\frac{2(1+z^2)\,\mathrm{d}z}{\left(3+z^2\right)^2}\\
&=\int_{-\infty}^\infty\frac{2\,\mathrm{d}z}{3+z^2}-\int_{-\infty}^\infty\frac{4\,\mathrm{d}z}{\left(3+z^2\right)^2}\\
&=\frac2{\sqrt3}\left[\tan^{-1}\left(\frac{z}{\sqrt3}\right)\right]_{-\infty}^\infty-\frac2{3\sqrt3}\left[\tan^{-1}\left(\frac{z}{\sqrt3}\right)+\frac{\sqrt3z}{3+z^2}\right]_{-\infty}^\infty\\
&=\frac{4\pi}{3\sqrt3}\tag{4}
\end{align}
$$
