Example 1. Compute the integral

$$
\int_{|z|=4} \frac{e^{z}-1}{z^{2}+z} d z
$$
Solution. In the region $|z|<4$, the function $f(z)=\frac{e^{z}-1}{z^{2}+z}$ is analytic everywhere except at $z=0$ and $z=-1$.

By the residue theorem of Cauchy,

$$
\int_{|z|=4} \frac{e^{z}-1}{z^{2}+z} \mathrm{~d} z=2 \pi i(\operatorname{res} f(0)+\operatorname{res} f(-1))
$$

The point $z=0$ is a removable singularity of the function $f(z)$, since

$$
\lim _{z \rightarrow 0} \frac{e^{z}-1}{z(z+1)}=1
$$

Therefore, $\operatorname{res} f(0)=0$. The point $z=-1$ is a pole of the first order,

$$
\operatorname{res} f(-1)=\lim _{z \rightarrow-1}\left(\frac{e^{z}-1}{z(z+1)}(z+1)\right)=1-e^{-1}
$$

Thus,

$$
\int_{|z|=4} \frac{e^{z}-1}{z^{2}+z} d z=2 \pi i\left(1-e^{-1}\right)
$$