Calculating complex integral with Residue - where is my fault? \begin{align}\int_0^{2\pi} \frac{\cos(x)}{13+12\cos(x)} dx & = \displaystyle\int_0^{2\pi} \frac{(z+1/z)\frac{1}{2}}{13+12(z+1/z)\frac{1}{2}}\frac{1}{iz} dz \\
& = \cdots \\
&= -i\displaystyle\int_0^{2\pi} \frac{z^2+1}{\left(z+\frac{2}{3}\right)\left(z+\frac{3}{2}\right)z}dz \\
&= 2\pi i (-i) \operatorname{Res}\left(\frac{z^2+1}{\left(z+\frac{2}{3}\right)\left(z+\frac{3}{2}\right)z};0\right) \\
&=2\pi \lim_{z\to0}\frac{z^2+1}{\left(z+\frac{2}{3}\right)\left(z+\frac{3}{2}\right)}\\
&=2\pi \frac{0^2+1}{\left(0+\frac{2}{3}\right)\left(0+\frac{3}{2}\right)}\\
&=2\pi
\end{align}
But Wolfram Alpha says it's $\frac{4\pi}{15}$.
What am I doing wrong ?

On the right-hand side of the first line, the integral should no longer be over the real interval $[0,2\pi]$; rather, it should be over the unit circle in the complex plane. In addition to correcting that calculational step and subsequent ones, that also explains why the residue at $z=-\frac23$ is relevant: it's inside the unit circle.
