Writing \(f(z)=\cos z/(z\sin z)\text{,}\) we see that \(f\) is analytic everywhere except at the points \(z=\pi n\text{,}\) \(n\in \Z\text{.}\) It is easy to see that \(\sin z\) has a simple pole at each \(z_0=n\pi\) for all \(n\text{,}\) and that \(1/z\) has a simple pole at \(z_0=0\text{.}\) Since furthermore \(\cos z\) is nonzero at these points, it follows from our order arithmetic corollary that
\begin{equation*}
\ord_f (n\pi)=\begin{cases}
-1 \amp \text{if } n\ne 0\\
-2 \amp \text{if } n=0
\end{cases}\text{.}
\end{equation*}
For
\(z_0=n\pi\) with
\(n\ne 0\text{,}\) we conclude, using
Theorem 1.21.7 that
\begin{align*}
\res_f z_0 \amp = \frac{\cos z_0}{\frac{d}{dz}(z\sin z)\vert_{z=z_0}}\\
\amp = \frac{\cos(n\pi)}{\sin(n\pi)+(n\pi)\cos(n\pi)}\\
\amp = \frac{1}{n\pi}\text{.}
\end{align*}
For \(z_0=0\text{,}\) we have
\begin{align*}
\frac{\cos z}{z\sin z} \amp =\frac{\cos z}{z^2(1-z^2/6+z^4/120-\cdots}\\
\amp = \frac{\cos z}{z^2g(z)}
\end{align*}
where \(g(z)=1-z^2/6+z^4/120-\cdots\text{.}\) Since \(h(z)=\cos z/g(z)\) is analytic about \(0\) we have
\begin{equation*}
h(z)=\cos z/g(z)=a_0+a_1z+\cdots \text{,}
\end{equation*}
and thus
\begin{equation*}
f(z)=\frac{1}{z^2}h(z)=\frac{a_0}{z^2}+\frac{a_1}{z}+\cdots\text{.}
\end{equation*}
Thus \(\res_f 0=a_1\text{.}\) Lastly, since \(a_n=\frac{h^{(n)}(0)}{n!}\text{,}\) we see that
\begin{equation*}
a_1=h'(0)=\frac{\sin(0)g(0)-\cos(0)g'(0)}{g(0)^2}=\frac{0-0}{1}=0\text{.}
\end{equation*}
We conclude that
\begin{equation*}
\res_f 0=a_1=0\text{.}
\end{equation*}