Calculate $\int_{-\infty}^{+\infty}e^{-\frac{(x-it)^2}{2}}dx$ using contour integration When one wants to calculate the characteristic function of a random variable which is of normal distribution, things boil down to calculate:
$$\int_{-\infty}^{+\infty}e^{-\frac{(x-it)^2}{2}}dx$$
There are several ways to calculate this integral. 
I tried to calculate this integral using contour integration:
$$
\oint_C f(z)dz=\int_{-a}^af(z)dz+\int_{Arc(a)}f(z)dz
$$
where
$$
f(z)=e^{-\frac{(z-z_0)^2}{2}}, z_0=it
$$
and $C$ is the union of a semicircle and $[-a,a]$. How can I calculate 
$$
\lim_{a\to+\infty}\int_{Arc(a)}f(z)dz?
$$
Alternatively, from the very beginning, I get
$$
\lim_{a\to+\infty}\int_{-a-z_0}^{a-z_0}e^{-\frac{z^2}{2}}dz.
$$
But I have no idea how to choose contour. 
 A: This assumes you already know that $\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$. If that is not already known, this proof will not work.
For $N>0$, let $C_N$ be the rectangle curve that goes from $-N+0i$ to $N+0i$, then $N+0i$ to $N+ti$, then from $N+ti$ to $-N+ti$ and finally from $-N+ti$ to $-N+0i$.
Then $\int_{C_N} e^{-z^2} dz=0$.  Note that the size of the contribution of the sides of the rectangle approach zero as $N\to\infty$, so that means that $\lim_{N\to\infty} \left(\int _{-N}^N e^{-x^2}dx - \int_{-N}^N e^{-(x+ti)^2} dx\right) = 0$
A: Read the 8-th proof in this delightful paper by K. Conrad. Since he defines a complex function that seems taken out of the blue, you can read there also an explanation for it and references for past papers and books that have that idea.
A: Why not just do this?:
$$
\begin{eqnarray}
I\left(t\right) &=& \int_{-\infty}^{\infty} dx \exp\left[-\frac{1}{2}\left(x-i t\right)^2\right] \\
&=& \int_{-\infty-i t}^{\infty - i t} du \exp\left(-\frac{1}{2} u^2\right)
\end{eqnarray}
$$
Now deform the contour so that part of it goes along the real axis:
$$
\begin{eqnarray}
I\left(t\right)&=& \lim_{r \rightarrow \infty} \left\{\int_{-t}^{0} dy \exp\left[-\frac{1}{2} \left(-r+iy\right)^2\right] + \int_{0}^{-t} dy \exp\left[-\frac{1}{2} \left(r+iy\right)^2\right]\right\} \\
&+& \int_{-\infty}^{\infty} dx \exp\left(-\frac{1}{2} x^2\right) \\
&=& \lim_{r \rightarrow \infty} \int_{-t}^{0} dy\left\{ \exp\left[-\frac{1}{2} \left(-r+iy\right)^2\right] -  \exp\left[-\frac{1}{2} \left(r+iy\right)^2\right]\right\} + \sqrt{2 \pi} \\
&=& 2 i  \lim_{r \rightarrow \infty} e^{-r^2/2} \int_{-t}^{0} dy\left\{  e^{y^2/2} \sin \left(r y\right)\right\} + \sqrt{2 \pi} \\
&=& \sqrt{2 \pi}
\end{eqnarray}
$$
