# Example 1
Consider for example $\int_{-\infty}^{\infty} \frac{1}{1+x^2} \mathrm{~d} x$The idea is to consider the contours $\gamma_1$ and $\gamma_2$ in the figure below.
![[Drawing 2025-04-10 13.34.50.excalidraw|200]]
The closed contour $\gamma_1$ is formed by the segment joining $-R$ and $R$, together with the half circle or radius $R$. The contour $\gamma_2$ is a circle centred at i and of radius $r<1$. To understand the choice of curves, notice that we can rewrite the integral as $\int_{-\infty}^{\infty} \frac{1}{(x-\mathrm{i})(x+\mathrm{i})} \mathrm{d} x$
Notice that in the region enclosed by $\gamma_2$ the function (the integrand extended to a function on $\mathbb{C}$)
$f(z):=\frac{1}{(z-\mathrm{i})(z+\mathrm{i})}$
is analytic except for at $z=\mathrm{i}$. By the deformation of contours Theorem we know that $\int_{\gamma_1} f(z) \mathrm{d} z=\int_{\gamma_2} f(z) \mathrm{d} z$since the two curves have the same orientation. Now $\int_{\gamma_1} f(z) \mathrm{d} z=\int_{-R}^R f(z) \mathrm{d} z+\int_{\operatorname{arc}} f(z) \mathrm{d} z.$
We parametrise the arc by $R \mathrm{e}^{\mathrm{it}}$ for $t \in[0, \pi)$. We have $\int_{\operatorname{arc}} f(z) \mathrm{d} z=\int_{\operatorname{arc}} \frac{1}{1+z^2} \mathrm{~d} z=\int_0^\pi \frac{1}{1+R^2 \mathrm{e}^{2 i t}} R \mathrm{i}^{\mathrm{i} t} \mathrm{~d} t$
Therefore $\left|\int_{\operatorname{arc}} f(z) \mathrm{d} z\right| \leqslant \int_0^\pi \frac{R}{R^2-1} \mathrm{~d} t=\pi \frac{R}{R^2-1}$(by reverse triangle inequality $\lvert 1+R^2 e^{2it} \rvert\geq R^{2} -1$; in general $\lvert a +b \rvert \geq \lvert \lvert a \rvert - \lvert b \rvert \rvert$).
As $R$ tends to infinity the $\int_{\operatorname{arc}} f(z) \mathrm{d} z$ equals zero. Therefore $\int_{-\infty}^{\infty} f(z) \mathrm{d} z=\int_{\gamma_1} f(z) \mathrm{d} z=\int_{\gamma_2} f(z) \mathrm{d} z$
Now $\int_{\gamma_2} f(z) \mathrm{d} z=\int_{\partial B_r(\mathrm{i})} \frac{1}{z+i} \frac{1}{z-i} \mathrm{~d} z .$
Recall that by [[Cauchy's Integral Formula]], if $g(z)$ is analytic in the interior of a positively oriented curve then
$\int_\gamma \frac{g(z)}{z-a} \mathrm{~d} z=2 \pi \mathrm{i} g(a)$
Therefore, taking $g(z)=\frac{1}{z+i}$ we obtain $\int_{\partial B_r(\mathrm{i})} \frac{1}{z+i} \frac{1}{z-i} \mathrm{~d} z=2 \pi \mathrm{i} \frac{1}{2 \mathrm{i}}=\pi$
which yields $\int_{-\infty}^{\infty} \frac{1}{1+x^2} \mathrm{~d} x=\pi.$
# Example 2
...
# Example 3
For example, evaluate $\int_{-\infty}^{\infty} \frac{\cos(3x)}{4+x^2} \, dx.$
# Example 4
$\int_{-\infty}^{\infty} \frac{x\sin x}{1+x^2} \, dx$
# Example 5
$\int_{-\infty}^{\infty} \frac{\sin x}{x} \, dx$
# References
[^1] Analysis 3.