Solution (source code)

= Solution

Put $w=z-1$. Then
$$
f(z)=\frac1{(w+1)(w-1)}
=-\frac1{1-w^2}.
$$
Thus
$$
\boxed{f(z)=-\sum_{n=0}^{\infty}(z-1)^{2n}},
\qquad 0<|z-1|<1.
$$
This is actually a <Taylor series>, because $z=1$ is a regular point. The point $z=0$ is a <simple pole>. At infinity,
$$
f(1/w)=\frac{w^2}{1-2w}
$$
extends analytically to $w=0$, so infinity is a <removable singularity> of $f$, with extended value zero.

For the real integral, first write
$$
\frac{2-\cos\theta}{5-4\cos\theta}
=\frac14+\frac{3}{4(5-4\cos\theta)}.
$$
Let
$$
J=\int_0^{2\pi}\frac{d\theta}{5-4\cos\theta}.
$$
With $z=e^{i\theta}$,
$$
J=\oint_{|z|=1}\frac{dz}{i(-2z^2+5z-2)}.
$$
The denominator has roots $1/2$ and $2$, so only $1/2$ lies inside the contour. Its <residue> is $1/(3i)$, and the <residue theorem> gives
$$
J=2\pi i\frac1{3i}=\frac{2\pi}{3}.
$$
Consequently
$$
\boxed{\int_0^{2\pi}\frac{2-\cos\theta}{5-4\cos\theta}\,d\theta
=\frac{\pi}{2}+\frac34\frac{2\pi}{3}
=\pi}.
$$