A Gaussian integral is an integral of the form
∫ − ∞ ∞ e − a ( x + b ) 2 d x = π a \int_{-\infty}^{\infty} e^{-a(x+b)^{2}} \ dx=\sqrt{ \frac{\pi}{a} } ∫ − ∞ ∞ e − a ( x + b ) 2 d x = 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 = 1 a=b=1 a = b = 1 :
∫ − ∞ ∞ e − x 2 d x = π \int_{-\infty}^{\infty} e^{-x^{2}} \ dx =\sqrt{ \pi } ∫ − ∞ ∞ e − x 2 d x = π
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 = t x=\sqrt{ t } x = t and noticing the definition of the Gamma function :
∫ − ∞ ∞ e − x 2 d x = 2 ∫ 0 ∞ e − x 2 d x = 2 ∫ 0 ∞ 1 2 e − t t − 1 / 2 d t = Γ ( 1 2 ) = π \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 } ∫ − ∞ ∞ e − x 2 d x = 2 ∫ 0 ∞ e − x 2 d x = 2 ∫ 0 ∞ 2 1 e − t t − 1/2 d t = Γ ( 2 1 ) = π
A related integral is
∫ − ∞ ∞ x 2 e − a x 2 d x = π 2 a 3 / 2 \int_{-\infty}^{\infty} x^{2}e^{-ax^{2}} \ dx=\frac{\sqrt{ \pi }}{2a^{3/2}} ∫ − ∞ ∞ x 2 e − a x 2 d x = 2 a 3/2 π
The relation between the two can be seen by applying integration by parts on 1 1 1 and e − x 2 e^{-x^{2}} e − x 2 on the Gaussian integral:
∫ − ∞ ∞ e − a x 2 d x = 2 a ∫ − ∞ ∞ x 2 e − a x 2 d x \int_{-\infty}^{\infty} e^{-ax^{2}} \ dx=2a\int_{-\infty}^{\infty} x^{2}e^{-ax^{2}} \ dx ∫ − ∞ ∞ e − a x 2 d x = 2 a ∫ − ∞ ∞ x 2 e − a x 2 d x
General solution#
An analytical solution can be derived for the more general case
∫ 0 ∞ x n e − a x 2 d x = ( 1 a ) ( n + 1 ) / 2 ∫ 0 ∞ e − t t n / 2 t − 1 / 2 2 d t = 1 2 ( 1 a ) ( n + 1 ) / 2 ∫ 0 ∞ e − t t ( n − 1 ) / 2 d t = 1 2 ( 1 a ) ( n + 1 ) / 2 Γ ( n + 1 2 ) \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} ∫ 0 ∞ x n e − a x 2 d x = ( a 1 ) ( n + 1 ) /2 ∫ 0 ∞ e − t t n /2 2 t − 1/2 d t = 2 1 ( a 1 ) ( n + 1 ) /2 ∫ 0 ∞ e − t t ( n − 1 ) /2 d t = 2 1 ( a 1 ) ( n + 1 ) /2 Γ ( 2 n + 1 )
where n ∈ N n\in \mathbb{N} n ∈ N and we again made the x = t x=\sqrt{ t } x = t substitution, then used the definition of Gamma function. Careful with the integration bounds, as they are [ 0 , ∞ [ [0,\infty[ [ 0 , ∞ [ here, not ] − ∞ , + ∞ [ ]-\infty,+\infty[ ] − ∞ , + ∞ [ .
Alternatively, we can find solutions for even n n n by taking the solution for the n = 0 n=0 n = 0 case and differentiating both sides by a a a :
∫ − ∞ ∞ ( d d a ) n / 2 e − a x 2 d x = ( d d a ) n / 2 π a for 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 ∫ − ∞ ∞ ( d a d ) n /2 e − a x 2 d x = ( d a d ) n /2 a π for even n