Example. Compute the integral

$$
\oint_{|z-1|=1} \frac{d z}{z^{4}+1}
$$
Solution.

1. We find the singular points of the function $f(z)$. The singular points of the function

$$
f(z)=\frac{1}{z^{4}+1}
$$

are the zeros of the denominator. We find all values of $z_{k}=\sqrt[4]{-1}$

$$
z_{k}=e^{\frac{\pi+2 \pi k}{4}}=\cos \frac{\pi+2 \pi k}{4}+i \sin \frac{\pi+2 \pi k}{4}, \quad k=0,1,2,3
$$

We determine which of these points lie inside the contour $\Gamma$.

The integration contour is the circle $|z-1|=1$. Since $\left|z-z_{0}\right|1$ and $\left|z-z_{2}\right|>1$, the points inside the contour $\Gamma$ are

$$
z_{0}=e^{\frac{\pi}{4} i}=\frac{\sqrt{2}}{2}+i \frac{\sqrt{2}}{2}, \quad z_{3}=e^{\frac{7 \pi}{4} i}=\frac{\sqrt{2}}{2}-i \frac{\sqrt{2}}{2}
$$

2. We determine the type of singular points $z_{0}$ and $z_{3}$. For this, we represent the function $f(z)$ in the form

$$
f(z)=\frac{\varphi(z)}{\psi(z)}
$$

where $\varphi(z)=1$ and $\psi(z)=z^{4}$ are analytic at the points $z_{k}$ and $\varphi\left(z_{k}\right)=1 \neq 0$, $\psi\left(z_{k}\right)=0$ and $\psi^{\prime}\left(z_{k}\right)=4 z_{k}^{3} \neq 0(k=0,3)$. Therefore, $z_{0}$ and $z_{3}$ are poles of the first order of the function $f(z)$.

3. We compute the residues at the points $z_{0}$ and $z_{3}$ using the formula

$$
\operatorname{res}_{z=z_{k}} \frac{\varphi(z)}{\psi(z)}=\frac{\varphi\left(z_{k}\right)}{\psi^{\prime}\left(z_{k}\right)}
$$

We get

$$
\begin{aligned}
& \operatorname{res}_{z=z_{0}} \frac{1}{z^{4}+1}=\frac{1}{4 z_{0}^{3}}=\frac{1}{4} e^{-\frac{3 \pi i}{4}}=\frac{1}{4}\left(-\frac{\sqrt{2}}{2}-i \frac{\sqrt{2}}{2}\right) \\
& \operatorname{res}_{z=z_{3}} \frac{1}{z^{4}+1}=\frac{1}{4 z_{3}^{3}}=\frac{1}{4} e^{\frac{3 \pi i}{4}}=\frac{1}{4}\left(-\frac{\sqrt{2}}{2}+i \frac{\sqrt{2}}{2}\right)
\end{aligned}
$$

4. We compute the integral using the Cauchy residue theorem:

$$
\begin{aligned}
& \oint_{-1 \mid=1} \frac{d z}{z^{4}+1}=2 \pi i\left(\operatorname{res}_{z=z_{0}} \frac{1}{z^{4}+1}+\operatorname{res}_{z=z_{3}} \frac{1}{z^{4}+1}\right)= \\
& =2 \pi i \frac{1}{4}\left(-\frac{\sqrt{2}}{2}-i \frac{\sqrt{2}}{2}-\frac{\sqrt{2}}{2}+i \frac{\sqrt{2}}{2}\right)=-\frac{\sqrt{2}}{2} \pi i .
\end{aligned}
$$

Answer. $\oint_{|z-1|=1} \frac{d z}{z^{4}+1}=-\frac{\sqrt{2}}{2} \pi i$.

Conditions of the Problems. Compute the integrals using residues.

1. $\oint_{|z|=1} z^{3} e^{1 / z} d z$.
2. $\oint_{|z-1|=1} \sin \left(1+\frac{1}{z}\right) d z$.
3. $\oint_{|z|=2} \frac{d z}{z^{2}+1}$.
4. $\oint_{|z|=1 / 2} \frac{\ln (1+z)}{z^{3}} d z$.
5. $\oint_{|z-\pi / 2|=2} \operatorname{ctg} 2 z d z$.
6. $\oint_{|z-3 i|=3} \frac{z^{5}+8 z}{z^{4}-16} d z$.
7. $\oint_{|z+i|=2} \frac{e^{z} d z}{z \sin z}$.
8. $\oint_{|z-2|=3} \frac{\cos ^{2} z+1}{z^{2}-\pi^{2}} d z$.
9. $\oint_{|z-2|=3} \frac{\cos ^{2} z+1}{(z-\pi)^{2}} d z$.
10. $\oint_{|z|=5 / 2} \frac{d z}{z^{2}(z-2)(z+3)^{2}}$.

Answers. 1. $\pi i / 12$. 2. $2 \pi i \cos 1 . \quad 3.0$. 4. $-\pi i$. 5. $3 \pi i$. 6. $-3 \pi i$. 7. $2 \pi i$. 8. 2i. 9. 0. $10.26 \pi i / 675$.

### 1.17. Computation of Definite Integrals Using Residues

Problem Statement. Compute the integral

$$
\int_{0}^{2 \pi} R(\cos x, \sin x) d x
$$

where $R(\cos x, \sin x)$ is a rational function of $\sin x$ and $\cos x$.

Plan of Solution.

1. Introduce the complex variable $z=e^{i x}$. In this case, the integration interval $[0,2 \pi]$ is mapped to the circle $|z|=1,0 \leqslant \arg z \leqslant 2 \pi$. 2. Compute

$$
d z=i e^{i x} d x \Longrightarrow d x=\frac{d z}{i z}
$$

By Euler's formulas

$$
\begin{aligned}
& \cos x=\frac{e^{i x}+e^{-i x}}{2}=\frac{1}{2}\left(z+\frac{1}{z}\right) \\
& \sin x=\frac{e^{i x}-e^{-i x}}{2 i}=\frac{1}{2 i}\left(z-\frac{1}{z}\right)
\end{aligned}
$$

3. Substituting the results from point 2 into the given integral, we get

$$
\begin{aligned}
& \int_{0}^{2 \pi} R(\cos x, \sin x) d x= \\
& =\oint_{|z|=1} R\left(\frac{1}{2}\left(z+\frac{1}{z}\right), \frac{1}{2 i}\left(z-\frac{1}{z}\right)\right) \frac{d z}{i z}=\oint_{|z|=1} f(z) d z
\end{aligned}
$$

where

$$
f(z)=\frac{1}{i z} R\left(\frac{1}{2}\left(z+\frac{1}{z}\right), \frac{1}{2 i}\left(z-\frac{1}{z}\right)\right)
$$

4. Compute the contour integral of the function $f(z)$ of the complex variable $z$ using residues:

a) find the singular points $z_{1}, z_{2}, \ldots, z_{n}$ of the function $f(z)$ located inside the contour $|z|=1$;

b) determine the type of each singular point $z_{1}, z_{2}, \ldots, z_{n}$;

c) compute the residues at these singular points;

d) compute the integral using the Cauchy residue theorem:

$$
\oint_{|z|=1} f(z) d z=2 \pi i \sum_{k=1}^{n} \operatorname{res}_{z=z_{k}} f(z)
$$