Calculation of $\int_{0}^{\pi}\frac{1}{(5+4\cos x)^2}dx$ Calculation of $\displaystyle \int_{0}^{\pi}\frac{1}{(5+4\cos x)^2}dx$
$\bf{My\; Try}::$ Using $\displaystyle \cos x = \frac{1-\tan^2 \frac{x}{2}}{1+\tan^2 \frac{x}{2}}$
Let $\displaystyle I = \int_{0}^{\pi}\frac{1}{\left(5+\frac{4-4\tan^2 \frac{x}{2}}{1+\tan^2 \frac{x}{2}}\right)^2}dx = \int_{0}^{\pi}\frac{1+\tan^2 \frac{x}{2}}{\left(9+\tan^2 \frac{x}{2}\right)^2}dx$
$\displaystyle I = \int_{0}^{\pi}\frac{\sec^2 \frac{x}{2}}{\left(9+\tan^2 \frac{x}{2}\right)^2}dx$
Now Let $\tan \frac{x}{2} = t$ and $\sec^2 \frac{x}{2}dx = 2dt$
$\displaystyle I = 2\int_{0}^{\infty}\frac{1}{(9+t^2)^2dt}$
Now I did not understand how can i solve after that
Help Required
Thanks

Using Weierstrass substitution, we get
$$\int_0^\pi \frac{dx}{(5+4\cos x)^2}=\int_0^\infty\frac{1}{(5+4\frac{1-t^2}{1+t^2})^2}\frac{2dt}{1+t^2}=2\int_0^\infty \frac{t^2+1}{(t^2+9)^2}dt=\int_{-\infty}^\infty \frac{t^2+1}{(t^2+9)^2}dt$$
Now let
$$f(z)=\frac{z^2+1}{(z^2+9)^2}$$
Then, $f$ has a poles of order 2 at $\pm 3i$. We get
$$\mathrm{res}_{z=3i}f=\lim_{z\to 3i}\frac{d}{dz}\frac{z^2+1}{(z+3i)^2}=\lim_{z\to 3i}\left(\frac{-2(1+z^2)}{(z+3i)^3}+\frac{2z}{(z+3i)^2}\right)=-\frac{5i}{54}$$
Hence, letting $\gamma$ be the semi circle of radius $R>3$ centered at the origin and in the upper half-plane, we get that $\gamma$ encloses the pole $z=3i$, so
$$\int_\gamma f(z)dz=2\pi i\ \mathrm{res}_{z=3i}f=\frac{5\pi}{27}$$
Letting $R\to\infty$, we see that the integral on the arc-section vanish so that we are left with
$$\int_0^\pi \frac{dx}{(5+4\cos x)^2}=\frac{5\pi}{27}$$
