Contour intergal of a rational trigonometric function, can't find my mistake. This is the integral :
$$I = \int_{0}^{2\pi} \frac{dx}{(5+4\cos x)^2}\ $$
Which, according to wolfram alpha, should evaluate to $\frac{10\pi}{27} $,
but the value i find is $\frac{20\pi}{27} $.

These are my calculations :
Using complex form of cosine i get $ \cos x = \frac{t^2+1}{2t}$
where $ t = e^{ix}$ and $ dx = \frac{dt}{it}$.
If $\partial{D} $ is the unit circle
$$ I = \int_{\partial{D}} \frac{-i}{t(\frac{5t+2t^2+2}{t})^2} dt = 
 -i \int_{\partial{D}}\frac{t}{(t+2)^2(t+1/2)^2}dt = -i I_a$$
$I_a = \pi i $ times the residue in -$\frac{1}{2}$ 
The residue is equal to 
\begin{align}
\lim_{z\to-\frac{1}{2}} \frac{d}{dz} \left( \frac{t(t+1/2)^2}{(t+2)^2(t+1/2)^2}\right) 
&= \lim_{z\to-\frac{1}{2}} \frac{d}{dz}  \frac{t}{(t+2)^2} 
\\&= \lim_{z\to-\frac{1}{2}} \frac{(t+2)^2-2t(t+2)}{(t+2)^4} 
\\&= \lim_{z\to-\frac{1}{2}} \frac{2-t}{(t+2)^3} 
= \frac{2+1/2}{(-1/2+2)^3} 
\\&= \frac{5/2}{27/9} = \frac{20}{27} 
\end{align}
so $ I_a = i\pi\frac{20}{27}$
So our original integral $$I = -i I_a   =  -i^2 \pi\frac{20}{27}  =  \frac{20\pi}{27}$$

Your mistake is when using the residue theorem:
$$\oint_{C^+} f(z) dz = 2\pi i\sum_{singularities} Res(f,singularity)$$
You forgot the factor $2$ in this formula.

Another mistake: $$5t + 2t^2 + 2 = 2(t+2)(t+1/2)$$
You again forgot a factor 2 (which will yield a factor $4$ eventually)

You also made a mistake in calculating the residue.
Note that $(-1/2 + 2)^3 = (3/2)^3 = 27/8$

Correcting these two mistakes, we easily find the correct answer.
