Where is this proof of the Gaussian integral being zero wrong

complex-analysiscontour-integrationgaussian-integral

I'm relatively new to complex analysis, but have been diving into it since it's been proving useful in tackling some of my recent problems. However, apparently I've misunderstood something. The following is a "proof" that the Gaussian integral vanishes:

We want to find
$$\int_{-\infty}^\infty e^{-x^2} \mathrm{d}x.$$
On the real line, the integrand coincides with $e^{-|x|^2}$, so we will use this instead.

Now consider a closed, mathematically positive path going first along the real line from $-\infty$ to $\infty$ and then closing the loop via a semicircle in the upper half-plane (strictly speaking, consider the limit of the closed semicircular path from $-R$ to $R$ with $R\to\infty$).

Since the integrand has no poles, the contour integral along the closed path is zero by the residue theorem or Cauchy's integral theorem. On the other hand, by the estimation lemma and by virtue of $e^{-|x|^2}$ being a Schwartz function, the contribution of the large arc vanishes in the limit $R\to\infty$. Therefore, since the sum of the contributions of the two paths equals the total integral, which is zero, the integral along the real line must also be zero, which is famously not true.

Where is this wrong?

Best Answer

$e^{-|z|^2}$ is not complex differentiable (other than exactly at $0$), so Cauchy's integral theorem doesn't apply to it.

(And of course, if you use $e^{-z^2}$ instead, that will blow up where your large semicircular path crosses the imaginary axis).