Example 2. Find the logarithmic residue of the function

$$
f(z)=\frac{\operatorname{ch} z}{e^{i z}-1}
$$

with respect to the contour $C:|z|=8$.
Solution. We find the zeros $z_{k}$ of the function $f(z)$. For this, we solve the equation $\cosh z=0$ or $e^{z}+e^{-z}=0$. Writing the last equation as $e^{2 z}=-1$, we find
$2 z=\operatorname{Ln}(-1)=(2 k+1) \pi i$, so $z_{k}=\frac{2 k+1}{2} \pi i(k=0, \pm 1, \pm 2, \ldots)$ (all zeros are simple). To find the poles of the function $f(z)$, we solve the equation $e^{i z}-1=0$ or $e^{i z}=1$. We have $i z=\operatorname{Ln} 1=2 m \pi i, z_{m}=2 m \pi(m=0, \pm 1, \pm 2, \ldots)$. In the circle $|z|<8$ there are zeros

$$
z_{k}=\frac{2 k+1}{2} \pi i \quad(k=0, \pm 1, \pm 2,-3)
$$

and simple poles

$$
z_{m}=2 m \pi \quad(m=0, \pm 1)
$$

of the function $f(z)$. The number of zeros $N=6$, the number of poles $P=3$. Therefore,

$$
\frac{1}{2 \pi i} \int_{|z|=8} \frac{f^{\prime}(z)}{f(z)} d z=6-3=3
$$