Integrate $\oint\frac{z}{\cos z-1}dz$ with residue theorem $$\oint\limits_{|z-3|=4}^{}\frac{z}{\cos z-1}dz$$
My attempt:
$$\cos z=1$$
$$z=2\pi k$$
The set includes only $z=0$ and $z=2\pi$. What next?

$$\DeclareMathOperator*{\res}{Res}
\oint_C\frac{z}{\cos z-1}\,dz=2\pi i\res_{z=0}\frac{z}{\cos z-1}+2\pi i\res_{z=2\pi}\frac{z}{\cos z-1}$$
Use the fact that around $z=0$ we have $$\cos(z)\simeq 1-\tfrac12z^2$$
Then $$\frac{z}{\cos z-1}\simeq \frac{z}{1-\tfrac12z^2-1}=-\frac{2}{z}$$
$$\res_{z=0}\frac{z}{\cos z-1}=\res_{z=0}\frac{-2}{z}=-2$$
And around $z=2\pi$:
$$\cos(z)\simeq 1-\tfrac12(z-2\pi)^2$$
$$\res_{z=2\pi}\frac{z}{\cos z-1}=\res_{z=2\pi}\frac{z}{1-\tfrac12(z-2\pi)^2-1}=-\res_{z=2\pi}\frac{2z-4\pi+4\pi}{(z-2\pi)^2}$$
$$=-2-\res_{z=2\pi}\frac{4\pi}{(z-2\pi)^2}=-2$$
Hence $$\oint_C\frac{z}{\cos z-1}\,dz=-8\pi i$$
Why does Taylor approximation work?
$$\cos(z)=1-\tfrac12z^2+\tfrac{1}{24}z^4+...$$
$$\frac{z}{\cos(z)-1}=\frac{z}{-\tfrac12z^2+\tfrac{1}{24}z^4+...}$$
$$=\frac{-2}{z-\tfrac{1}{12}z^3+...}=\frac{-2}{z(1-\tfrac{1}{12}z^2+...)}=g(z)$$
We can break this into
$$g(z)=\frac{A}{z}+\frac{f(z)}{1-\tfrac{1}{12}z^2+...}$$
$$-2\equiv A(1-\tfrac{1}{12}z^2+...)+z\cdot f(z)$$
Especially for $z=0$:
$$-2=A$$
So $$\res_{z=0} g(z)=\res_{z=0} \frac{-2}{z}+\res_{z=0}\frac{f(z)}{1-\tfrac{1}{12}z^2+...}=-2$$
