# Gaussian Integral Using Residues

• ghotra

#### ghotra

I am trying to to the Gaussian integral using contour integration.

What terrible mistake have I made.

$$I = \int_{-\infty}^\infty \mathrm{e}^{-x^2} \mathrm{d}x$$

I consider the following integral:

$$\int_C \mathrm{e}^{-z^2} \mathrm{d}z$$

where $C$ is the half-circle (of infinite radius) in the upper-half plane.
There are no singularities in the upper-half plane. So,

$$\int_C \mathrm{e}^{-z^2} \mathrm{d}z = 0$$

Now, I can break this integral up into two parts.

$$0 = \int_C \mathrm{e}^{-z^2} \mathrm{d}z = \int_{-\infty}^\infty \mathrm{e}^{-x^2} \mathrm{d}x + \int_{\theta=0}^{\theta=\pi} \mathrm{e}^{-z^2} \mathrm{d}z$$

Or...

$$\int_{-\infty}^\infty \mathrm{e}^{-x^2} \mathrm{d}x &= - \int_{\theta=0}^{\theta=\pi} \mathrm{e}^{-z^2} \mathrm{d}z = -\lim_{R\rightarrow \infty} \int_{0}^{\pi} \mathrm{e}^{-R^2 \exp(2\mathrm{i}\theta)}\cdot \mathrm{i} R \mathrm{e}^{\mathrm{i}\theta} \mathrm{d}\theta \stackrel{?}{=} \sqrt{\pi}$$

I know the answer should be $\sqrt{\pi}$...so the RHS must give this result! But it does not...at least, I have convinced myself that the RHS actually goes to zero. The exponential dominates the linear term, so in the limit as R goes to infinity, the RHS equals zero.

How can this be...it seems I have shown that the gaussian integral is zero.

I should cry.

The terrible mistake have you made is the Gaussian diverges to infinity on the arc. You could show that all the integrals of the Gaussian from 0 to points r*exp(i theta) are equal when sin(theta)<=cos(theta). This won't answer any thing though as you would still need to calculate one such integral. I feel that this integral is not best done by contour integration (though it is possible and I have seen it done). There are other easier ways.

lurflurf said:
The terrible mistake have you made is the Gaussian diverges to infinity on the arc.
...which becomes painfully obvious when I include the effect of the oscillations. It is true that R->infinity makes exp(-R^2 exp(2*I*theta)) very large...but the oscillation causes it to go back and forth between +infinity and -infinity.

It seems that no matter which contour I pick (as far as infinite semi-circles go), I will have this issue. At iR and -iR, e^(-z^2) will have trouble. Thus, it seems that my contour CANNOT be anything that goes to infinity in the imaginary part.

I know that the Guassian integral can be done easily in polar coordinates...that doesn't concern me. I _want_ to do it when complex integration. So how do you do it?