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
 A: 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}$$
A: After setting
$$
t=\tan\frac{x}{2},
$$
we get
\begin{eqnarray}
I:&=&\int_0^\pi\frac{1}{(5+4\cos x)^2}\,dx=\int_0^\infty\frac{2}{1+t^2}\cdot\left(\frac{1+t^2}{9+t^2}\right)^2\,dt=2\int_0^\infty\frac{1+t^2}{(9+t^2)^2}\,dt\\
&=&2\int_0^\infty\frac{9+t^2-8}{(9+t^2)^2}\,dt=2\int_0^\infty\frac{1}{9+t^2}\,dt-16\int_0^\infty\frac{1}{(9+t^2)^2}\,dt\\
&=&\frac23\arctan\frac{t}{9}\Big|_0^\infty-16\int_0^\infty\frac{1}{(9+t^2)^2}\,dt=\frac\pi3-16\int_0^\infty\frac{1}{(9+t^2)^2}\,dt\\
&=&\frac\pi3-8\int_{-\infty}^\infty\frac{1}{(9+x^2)^2}\,dx=:\frac\pi3-8J.
\end{eqnarray}
Since the function
$$
f:\mathbb{C}\setminus\{3i\} \to \mathbb{C},\ z\mapsto \frac{1}{(9+z^2)^2}
$$
is holomorphic, we have thanks to the Residue Theorem:
$$
\int_{-r}^rf(x)\,dx+ir\int_0^\pi e^{it}f(re^{it})\,dt=2\pi i\text{Res}\left(f,3i\right)=2\pi i\cdot\frac{-i}{3\cdot36}=\frac{\pi}{54} \quad \forall r>3.
$$
Since
$$
\left|ir\int_0^\pi e^{it}f(re^{it})\,dt\right|\le \int_0^\pi\frac{r}{(r^2-9)^2}\,dt=\frac{\pi r}{(r^2-9)^2} \to 0 \text{ as } r \to \infty,
$$
we have
$$
J=\lim_{r\to \infty}\int_{-r}^rf(x)\,dx=\frac{\pi}{54}.
$$
Hence
$$
I=\frac\pi3-\frac{8\pi}{54}=\frac{5\pi}{27}.
$$
A: HINT
Let $$u = \tan(\frac{x}{2})$$
Using the trig. identity $\tan(x) = \frac{\sin(x)}{\cos(x)}$ (1)
$$u = \tan(\frac{x}{2}) = \frac{\sin \frac{x}{2}}{\cos \frac{x}{2}}$$
Squaring both sides $$u^2 \cdot \cos^2(\frac{x}{2}) = \sin^2(\frac{x}{2})$$
Using the trig. identity $\sin^2(x) + cos^2(x) = 1$ (2) This becomes
$$u^2 \cdot \cos^2(\frac{x}{2}) = 1 - \cos^2(\frac{x}{2})$$
$$u^2 \cdot \cos^2(\frac{x}{2}) + \cos^2(\frac{x}{2}) = 1 \implies \cos^2(\frac{x}{2}) \cdot (u^2 + 1) = 1 \implies \cos^2(\frac{x}{2}) = \frac{1}{(u^2 + 1)}$$
Using trig identity (2) again becomes
$$\sin^2(\frac{x}{2}) = 1 - \frac{1}{(u^2 + 1)} = \frac{u^2}{(u^2 + 1)}$$
Then 
$$\cos(x) = \cos^2(\frac{x}{2}) - \sin^2(\frac{x}{2}) = \frac{1}{(u^2 + 1)} - \frac{u^2}{(u^2 + 1)} = \frac{1 - u^2}{u^2 + 1}$$
Back to the original statement, $$u = \tan(\frac{x}{2})$$ inverse $\tan$ both sides to get
$$\tan^{-1}u = \frac{x}{2}$$
Then differentiate both sides and using trig. identity $\frac{d}{dx} \tan^{-1}(x) = \frac{1}{x^2 + 1}$
$$dx = \frac{2 \cdot du}{u^2 + 1}$$
Substitute these back into the integral and solve. 
