Artificial intelligent assistant

Why do we consider an infinite semicircular contour for the integral $\int_{-\infty}^{\infty}f(x) dx$ I have noticed that $\begin{align*}\int_{-\infty}^{\infty}f(x) dx \end{align*}$ can be solved using residue theorem. My question is that while the actual integral doesn't have a closed path, it's a line integral that goes from $-\infty$ to $\infty$, so while using residue theorem and after replacing $x$ by $z$ why do we consider a semi-circular contour over positive imaginary plane. How does an open line integral change into a closed loop integral? It would be better if someone can explain it intuitively.

Assuming the integral exists,

$$\int_{-\infty}^{\infty} = \lim_{r \to \infty} \int_{-r}^r = \lim_{r \to \infty} \left( \oint_{\text{boundary of semicircle}} - \int_{\text{semicircular arc}} \right) $$

A typical proof method using this fact is:

* Compute $\oint_{\text{boundary of semicircle}}$ by the residue theorem
* Show that $\int_{\text{semicircular arc}}$ converges to zero. This is often done by showing the magnitude of the integrand is asymptotically smaller than the arclength

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 2a4dca7520fb67fdbcb8b070170d6e90