Integrate $\int e^{-iax^2/2} dx$ with real a I have seen the proof that $\int e^{-ax^2/2} dx=\sqrt{2\pi/a}$ for real a. If we substitute a with -ib, with b real, the formula still holds, why is this valid? Is this a sufficient proof? Does it hold in general to just substitute imaginary things into such formula?
Isnt the intepretation of what e^-ax means wildly different for real and imaginary a?
How to prove the formula for imaginary a?
 A: Actually $\int_{-\infty}^\infty e^{-a x^2/2}\ dx = \sqrt{2\pi/a}$ is true for $a > 0$ (certainly not for $a < 0$).  It's easy to show that both sides of the equation are analytic in $a$ on the open right half plane ($\text{Re}(a) > 0$), 
so the equation is automatically true there.  The boundary $\text{Re}(a) = 0$ is more delicate.   It's not even obvious that the (improper Riemann) integral exists there.  You have to prove that it does, and that it is the limit of the values in the right half plane as $\text{Re}(a) \to 0+$.
A: $\newcommand{\+}{^{\dagger}}%
 \newcommand{\angles}[1]{\left\langle #1 \right\rangle}%
 \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}%
 \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}%
 \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}%
 \newcommand{\dd}{{\rm d}}%
 \newcommand{\ds}[1]{\displaystyle{#1}}%
 \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}%
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}%
 \newcommand{\fermi}{\,{\rm f}}%
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}%
 \newcommand{\half}{{1 \over 2}}%
 \newcommand{\ic}{{\rm i}}%
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}%
 \newcommand{\isdiv}{\,\left.\right\vert\,}%
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}%
 \newcommand{\ol}[1]{\overline{#1}}%
 \newcommand{\pars}[1]{\left( #1 \right)}%
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}%
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,}%
 \newcommand{\sech}{\,{\rm sech}}%
 \newcommand{\sgn}{\,{\rm sgn}}%
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}%
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
By doing a double integration in the $xy$ plane, we'll arrive to something likes:
$\ds{\root{\pi\int_{0}^{\infty}\expo{-\ic x}\,\dd x}}$
\begin{align}
\pi\int_{0}^{\infty}\expo{-\ic x}\,\dd x&=
\int_{-\infty}^{\infty}\Theta\pars{x}\expo{-\ic x}\,\dd x
=
\pi\int_{-\infty}^{\infty}
\int_{-\infty}^{\infty}{\dd k \over 2\pi\ic}{\expo{\ic kx} \over k - \ic 0^{+}}\,
\expo{-\ic x}\,\dd x
\\[3mm]&=
\pi\int_{-\infty}^{\infty}{\dd k \over \ic}{1 \over k - \ic 0^{+}}
\int_{-\infty}^{\infty}\expo{\ic\pars{k - 1}x}\,\,{\dd x \over 2\pi}
=
-\ic\pi\int_{-\infty}^{\infty}{\delta\pars{k - 1} \over k - \ic 0^{+}}\,\dd k
\\[3mm]&=
-\ic\pi\,{1 \over 1 - \ic 0^{+}} = -\ic\pi\bracks{\pp\, 1 + \ic\pi\delta\pars{1}}
=
-\ic\pi
\end{align}
$$\color{#0000ff}{\large%
\root{\pi\int_{0}^{\infty}\expo{-\ic x}\,\dd x} = \root{-\ic\pi}
= \root{\pi \over \ic}}
$$
This is equivalent to include the limit $\Re a \to 0^{+}$ already pointed out by $\tt\color{#4444ff}{\mbox{@Robert Israel}}$
