Gaussian integral


A Gaussian integral is an integral of the form

ea(x+b)2 dx=πa\int_{-\infty}^{\infty} e^{-a(x+b)^{2}} \ dx=\sqrt{ \frac{\pi}{a} }

where the integrand is reminiscent of a standard normal distribution, hence the name. Strictly speaking, the Gaussian integral is the one with a=b=1a=b=1:

ex2 dx=π\int_{-\infty}^{\infty} e^{-x^{2}} \ dx =\sqrt{ \pi }

This integral commonly occurs in quantum mechanics (e.g. in the quantum harmonic oscillator energy eigenstates), statistical mechanics (e.g. in canonical and grand canonical partition functions) and statistics (e.g. in calculating Function moments).

Solution

There are several methods for solving this integral. The simplest just consists of using the evenness of the function, making the substitution x=tx=\sqrt{ t } and noticing the definition of the Gamma function:

ex2 dx=20ex2 dx=2012ett1/2 dt=Γ(12)=π\int_{-\infty}^{\infty} e^{-x^{2}} \ dx =2\int_{0}^{\infty}e^{-x^{2}}\ dx=2\int_{0}^{\infty} \frac{1}{2}e^{-t}t^{-1/2} \ dt =\Gamma\left( \frac{1}{2} \right)=\sqrt{ \pi }

A related integral is

x2eax2 dx=π2a3/2\int_{-\infty}^{\infty} x^{2}e^{-ax^{2}} \ dx=\frac{\sqrt{ \pi }}{2a^{3/2}}

The relation between the two can be seen by applying integration by parts on 11 and ex2e^{-x^{2}} on the Gaussian integral:

eax2 dx=2ax2eax2 dx\int_{-\infty}^{\infty} e^{-ax^{2}} \ dx=2a\int_{-\infty}^{\infty} x^{2}e^{-ax^{2}} \ dx

General solution

An analytical solution can be derived for the more general case

0xneax2 dx=(1a)(n+1)/20ettn/2t1/22 dt=12(1a)(n+1)/20ett(n1)/2 dt=12(1a)(n+1)/2Γ(n+12)\begin{align} \int_{0}^{\infty}x^{n}e^{-ax^{2}}\ dx&=\left( \frac{1}{a} \right)^{(n+1)/2}\int_{0}^{\infty}e^{-t}t^{n/2} \frac{t^{-1/2}}{2} \ dt \\ &=\frac{1}{2}\left( \frac{1}{a} \right)^{(n+1)/2}\int_{0}^{\infty}e^{-t}t^{(n-1)/2}\ dt \\ &=\frac{1}{2}\left( \frac{1}{a} \right)^{(n+1)/2}\Gamma\left( \frac{n+1}{2} \right) \end{align}

where nNn\in \mathbb{N} and we again made the x=tx=\sqrt{ t } substitution, then used the definition of Gamma function. Careful with the integration bounds, as they are [0,[[0,\infty[ here, not ],+[]-\infty,+\infty[.

Alternatively, we can find solutions for even nn by taking the solution for the n=0n=0 case and differentiating both sides by aa:

(dda)n/2eax2 dx=(dda)n/2πafor even n\int_{-\infty}^{\infty} \left( \frac{d}{da} \right)^{n/2}e^{-ax^{2}} \ dx =\left( \frac{d}{da} \right)^{n/2} \sqrt{ \frac{\pi}{a} }\qquad\text{for even }n