# Use path integrals to solve another integral.

Let $f(z) = e^{-z^2/2}$ and $\gamma = \gamma_1 + \gamma_2 + \gamma_3 + \gamma_4$ be this path, where $a > 0$ and $R > 0$. I need to show that $$\int_0^\infty e^{-t^2/2} \cos(at) dt = \sqrt{\frac{\pi}{2}} e^{-a^2/2}. \quad\quad (*)$$

The first part of the exercise was to show that $$\lim_{R \to \infty}\int_{\gamma_2} f(z)dz = \lim_{R \to \infty}\int_{\gamma_4} f(z)dz = 0.$$ I was able to do that. I can also use that $f$ has a primitive. Because $\gamma$ is closed it is also clear, that $$\lim_{R\to\infty} \int_{\gamma_1} f(z)dz + \lim_{R\to\infty} \int_{\gamma_3} f(z)dz = 0.$$ I am unsure what to do next to solve the integral (*).

Let $\gamma_{1}$ be the curve $t$ for $t\in [-R,R]$ and $\gamma_{3}$ be the curve $ia -t$ for $t\in [-R,R]$.
$$\lim_{R\rightarrow \infty}\int_{\gamma_{1}} f(z)\operatorname{d}\!z + \lim_{R\rightarrow\infty}\int_{\gamma_{2}} f(z) \operatorname{d}\!z = \lim_{R\rightarrow\infty} \int_{-R}^{R} e^{-t^{2}/2} - e^{-(ia-t)^{2}/2}\operatorname{d}\!t.$$
$$\operatorname{Re}\left[ \lim_{R\rightarrow\infty} \int_{-R}^{R} e^{-t^{2}/2} - e^{-(ia-t)^{2}/2}\operatorname{d}\!z\right] = 0$$