<s>[INST] 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?
 [/INST] The contour circles the singularities at $z=0$ and $z=2\pi$.
$$
\begin{align}
\frac{z}{\cos(z)-1}
&=\frac{z}{-\frac{z^2}2+\frac{z^4}{24}+O\left(z^6\right)}\\
&=-\frac2z\frac1{1-\frac{z^2}{12}+O\left(z^4\right)}\\
&=-\frac2z-\frac z6+O\left(z^3\right)
\end{align}
$$
Thus, the residue at $z=0$ is $-2$.
$$
\begin{align}
\frac{(z-2\pi)+2\pi}{\cos(z-2\pi)-1}
&=\frac{(z-2\pi)+2\pi}{-\frac{(z-2\pi)^2}2+\frac{(z-2\pi)^4}{24}+O\left((z-2\pi)^6\right)}\\
&=-\left(\frac2{z-2\pi}+\frac{4\pi}{(z-2\pi)^2}\right)\frac1{1-\frac{(z-2\pi)^2}{12}+O\left((z-2\pi)^4\right)}\\
&=-\frac{4\pi}{(z-2\pi)^2}-\frac2{z-2\pi}-\frac\pi3-\frac{z-2\pi}6+O\left((z-2\pi)^2\right)
\end{align}
$$
Thus, the residue at $z=2\pi$ is also $-2$.
Therefore, assuming the contour is counterclockwise, the integral is $2\pi i$ times the sum of the residues, which is
$$
-8\pi i
$$
</s>