Example 1. Compute the integral

$$
\int_{|z|=2} \frac{\operatorname{ch} i z}{z^{2}+4 z+3} d z
$$
Solution. Inside the circle $|z|=2$, the denominator of the fraction becomes zero at the point $z_{0}=-1$. To apply formula (1), we rewrite the integral as follows:

$$
\int_{|z|=2} \frac{\operatorname{ch} i z}{z^{2}+4 z+3} d z=\int_{|z|=2} \frac{\operatorname{ch} i z}{(z+1)(z+3)} d z=\int_{|z|=2} \frac{\frac{\operatorname{ch} i z}{z+3}}{z-(-1)} d z
$$

Here $z_{0}=-1$ and the function $f(z)=\frac{\text { ch } i z}{z+3}$ is analytic in the disk $|z| \leqslant 2$. Therefore,

$$
\int_{|z|=2} \frac{\operatorname{ch} i z}{z^{2}+4 z+3} d z=2 \pi i f(-1)=2 \pi i \frac{\operatorname{ch}(-i)}{2}=\pi i \operatorname{ch} i=\pi i \cos 1
$$

□