How do I compute $\int_{-\infty}^\infty e^{-\frac{x^2}{2t}} e^{-ikx} \, \mathrm dx$ for $t \in \mathbb{R}_{>0}$ and $k \in \mathbb{R}$? Let $t \in \mathbb{R}_{>0}$ and $k \in \mathbb{R}$. I want to find
$$\int_{-\infty}^\infty e^{-\frac{x^2}{2t}} e^{-ikx} \, \mathrm dx.$$
A hint told me to first determine $\int_{-\infty}^\infty e^{-\frac{x^2}{2}} \, \mathrm dx$ which I found to be equal to $\sqrt{2 \pi}$. Now I am told to compute the integral using Cauchy's formula for a convenient Cauchy contour. As I have not yet practically applied Cauchy's formula and I have no idea how it would be helpful in this case, I ask for a little help, a hint would be enough really. Thanks in advance.
 A: Here is a method which circumvents complex analysis. As DonAntonio pointed out, we have 
$$ \exp\left\{ -\frac{x^2}{2t} - ikx \right\} = \exp\left\{ -\frac{1}{2t}\left( x + ikt \right)^2 - \frac{k^2t}{2} \right\} $$
Since 
$$ \frac{d}{du} \exp\left\{ -\frac{1}{2t}\left( x + iut \right)^2 \right\} = -i(x+iut) \exp\left\{ -\frac{1}{2t}\left( x + iut \right)^2 \right\}, $$
we have
$$ \begin{align*}
& \int_{-\infty}^{\infty} \exp\left\{ -\frac{1}{2t}\left( x + ikt \right)^2 \right\} \, dx
- \int_{-\infty}^{\infty} \exp\left\{ -\frac{x^2}{2t} \right\} \, dx \\
&= \int_{-\infty}^{\infty} \left[ \frac{d}{du} \exp\left\{ -\frac{1}{2t}\left( x + iut \right)^2 \right\} \right]_{u=0}^{u=k} \, dx \\
&= -i \int_{-\infty}^{\infty} \int_{0}^{k} (x+iut) \exp\left\{ -\frac{1}{2t}\left( x + iut \right)^2 \right\} \, dudx.
\end{align*}$$
Since the integrand is Lebesgue integrable on $(x,u) \in \Bbb{R} \times [0, k]$, we can apply Fubini's theorem and we have
$$ \begin{align*}
& \int_{-\infty}^{\infty} \exp\left\{ -\frac{1}{2t}\left( x + ikt \right)^2 \right\} \, dx
- \int_{-\infty}^{\infty} \exp\left\{ -\frac{x^2}{2t} \right\} \, dx \\
&= -i \int_{0}^{k} \int_{-\infty}^{\infty} (x+iut) \exp\left\{ -\frac{1}{2t}\left( x + iut \right)^2 \right\} \, dxdu.  \\
&= \int_{0}^{k} \left[ it \exp\left\{ -\frac{1}{2t}\left( x + iut \right)^2 \right\} \right]_{x=-\infty}^{x=\infty} \, du
= 0.
\end{align*}$$
Therefore
$$ \begin{align*}
\int_{-\infty}^{\infty} \exp\left\{ -\frac{x^2}{2t} - ikx \right\} \, dx
&= \int_{-\infty}^{\infty} \exp\left\{ -\frac{1}{2t}\left( x + ikt \right)^2 - \frac{k^2t}{2} \right\} \, dx \\
&= \exp\left\{  - \frac{k^2t}{2} \right\} \int_{-\infty}^{\infty} \exp\left\{ -\frac{x^2}{2t} \right\} \, dx \\
&= \sqrt{2\pi t} \exp\left\{  - \frac{k^2t}{2} \right\}.
\end{align*}$$
A: After completing the square of the exponential argument, use the following contour to justify the change of variables,

Here is what $c$ is
$$\displaystyle \int_{-\infty}^\infty e^{-p(t+c)^2}dt = \sqrt{\frac{\pi}{p}}, \quad p,c\in {\bf C},\;\mathrm{Re}\displaystyle \left\{p\right\}>0$$
A: Complete the square:
$$\frac{x^2}{2t}+ikx=\frac{1}{2t}(x^2+2tikx)=\frac{1}{2t}(x+tik)^2+\frac{t^2k^2}{2t}=\frac{1}{2t}\left[(x+tik)^2+t^2k^2\right]\Longrightarrow$$
$$\Longrightarrow e^{-\frac{x^2}{2t}-ikx}=e^{-\frac{1}{2t}(x+tik)^2}\,e^{-\frac{1}{2}tk^2}$$
Now, substituting 
$$u:=\frac{1}{\sqrt{2t}}(x+tik)\Longrightarrow du=\frac{1}{\sqrt{2t}}dx\Longrightarrow$$
$$\Longrightarrow \int_{-\infty}^\infty e^{-\frac{1}{2t}(x+tik)^2}dx=\sqrt{2t}\int_{-\infty}^\infty e^{-u^2}du=\sqrt {2t\pi}$$
End now the exercise.
