# Gaussian integral

Probability Density Functions (1 of 7: Meeting the conditions)
Probability Density Functions (1 of 7: Meeting the conditions)

Integral of the Gaussian function, equal to sqrt(π)

This integral from statistics and physics is not to be confused with

, a method of numerical integration.

The Gaussian integral, also known as the Euler–Poisson integral, is the integral of the Gaussian function $f\left(x\right)={e}^{-{x}^{2}}$ over the entire real line. Named after the German mathematician Carl Friedrich Gauss, the integral is

${\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx=\sqrt{\pi }.$

Abraham de Moivre originally discovered this type of integral in 1733, while Gauss published the precise integral in 1809.[1] The integral has a wide range of applications. For example, with a slight change of variables it is used to compute the normalizing constant of the normal distribution. The same integral with finite limits is closely related to both the error function and the cumulative distribution function of the normal distribution. In physics this type of integral appears frequently, for example, in quantum mechanics, to find the probability density of the ground state of the harmonic oscillator. This integral is also used in the path integral formulation, to find the propagator of the harmonic oscillator, and in statistical mechanics, to find its partition function.

Although no elementary function exists for the error function, as can be proven by the Risch algorithm,[2] the Gaussian integral can be solved analytically through the methods of multivariable calculus. That is, there is no elementary indefinite integral for

$\int {e}^{-{x}^{2}}dx,$

but the

definite integral

${\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx$

can be evaluated. The definite integral of an arbitrary

Gaussian function

is

${\int }_{-\infty }^{\infty }{e}^{-a\left(x+b{\right)}^{2}}dx=\sqrt{\frac{\pi }{a}}.$

## Computation [ edit ]

### By polar coordinates [ edit ]

A standard way to compute the Gaussian integral, the idea of which goes back to Poisson,[3] is to make use of the property that:

${\left({\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx\right)}^{2}={\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx{\int }_{-\infty }^{\infty }{e}^{-{y}^{2}}dy={\int }_{-\infty }^{\infty }{\int }_{-\infty }^{\infty }{e}^{-\left({x}^{2}+{y}^{2}\right)}dxdy.$

Consider the function ${e}^{-\left({x}^{2}+{y}^{2}\right)}={e}^{-{r}^{2}}$on the plane ${R}^{2}$, and compute its integral two ways:

1. on the one hand, by double integration in the Cartesian coordinate system, its integral is a square:
${\left(\int {e}^{-{x}^{2}}dx\right)}^{2};$
2. on the other hand, by shell integration (a case of double integration in polar coordinates), its integral is computed to be $\pi$

Comparing these two computations yields the integral, though one should take care about the improper integrals involved.

$\begin{array}{cc}{\iint }_{{R}^{2}}{e}^{-\left({x}^{2}+{y}^{2}\right)}dxdy& ={\int }_{0}^{2\pi }{\int }_{0}^{\infty }{e}^{-{r}^{2}}rdrd\theta \\ =2\pi {\int }_{0}^{\infty }r{e}^{-{r}^{2}}dr\\ =2\pi {\int }_{-\infty }^{0}\frac{1}{2}{e}^{s}ds& s=-{r}^{2}\\ =\pi {\int }_{-\infty }^{0}{e}^{s}ds\\ =\pi \left({e}^{0}-{e}^{-\infty }\right)\\ =\pi ,\end{array}$

where the factor of

r

is the

Jacobian determinant

which appears because of the

transform to polar coordinates

(

r
dr

is the standard measure on the plane, expressed in polar coordinates

Wikibooks:Calculus/Polar Integration#Generalization

), and the substitution involves taking

s = −r2

, so

ds = −2r dr

.

Combining these yields

${\left({\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx\right)}^{2}=\pi ,$

so

${\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx=\sqrt{\pi }.$

#### Complete proof [ edit ]

To justify the improper double integrals and equating the two expressions, we begin with an approximating function:

$I\left(a\right)={\int }_{-a}^{a}{e}^{-{x}^{2}}dx.$

If the integral

${\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx$

were

absolutely convergent

we would have that its

Cauchy principal value

, that is, the limit

$\underset{a\to \infty }{lim}I\left(a\right)$

would coincide with

${\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx.$

To see that this is the case, consider that

${\int }_{-\infty }^{\infty }|{e}^{-{x}^{2}}|dx<{\int }_{-\infty }^{-1}-x{e}^{-{x}^{2}}dx+{\int }_{-1}^{1}{e}^{-{x}^{2}}dx+{\int }_{1}^{\infty }x{e}^{-{x}^{2}}dx<\infty .$

So we can compute

${\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx$

by just taking the limit

$\underset{a\to \infty }{lim}I\left(a\right).$

Taking the square of $I\left(a\right)$ yields

$\begin{array}{cc}I\left(a{\right)}^{2}& =\left({\int }_{-a}^{a}{e}^{-{x}^{2}}dx\right)\left({\int }_{-a}^{a}{e}^{-{y}^{2}}dy\right)\\ ={\int }_{-a}^{a}\left({\int }_{-a}^{a}{e}^{-{y}^{2}}dy\right){e}^{-{x}^{2}}dx\\ ={\int }_{-a}^{a}{\int }_{-a}^{a}{e}^{-\left({x}^{2}+{y}^{2}\right)}dydx.\end{array}$

Using Fubini’s theorem, the above double integral can be seen as an area integral

${\iint }_{\left[-a,a\right]×\left[-a,a\right]}{e}^{-\left({x}^{2}+{y}^{2}\right)}d\left(x,y\right),$

taken over a square with vertices

{(−a, a), (a, a), (a, −a), (−a, −a)}

on the

xy

plane

.

Since the exponential function is greater than 0 for all real numbers, it then follows that the integral taken over the square’s incircle must be less than $I\left(a{\right)}^{2}$, and similarly the integral taken over the square’s circumcircle must be greater than $I\left(a{\right)}^{2}$. The integrals over the two disks can easily be computed by switching from Cartesian coordinates to polar coordinates:

$\begin{array}{cc}x& =r\mathrm{cos}\theta \\ y& =r\mathrm{sin}\theta \end{array}$
$J\left(r,\theta \right)=\left[\begin{array}{cc}\frac{\partial x}{\partial r}& \frac{\partial x}{\partial \theta }\\ \frac{\partial y}{\partial r}& \frac{\partial y}{\partial \theta }\end{array}\right]=\left[\begin{array}{cc}\mathrm{cos}\theta & -r\mathrm{sin}\theta \\ \mathrm{sin}\theta & r\mathrm{cos}\theta \end{array}\right]$
$d\left(x,y\right)=|J\left(r,\theta \right)|d\left(r,\theta \right)=rd\left(r,\theta \right).$
${\int }_{0}^{2\pi }{\int }_{0}^{a}r{e}^{-{r}^{2}}drd\theta <{I}^{2}\left(a\right)<{\int }_{0}^{2\pi }{\int }_{0}^{a\sqrt{2}}r{e}^{-{r}^{2}}drd\theta .$

(See to polar coordinates from Cartesian coordinates for help with polar transformation.)

Integrating,

$\pi \left(1-{e}^{-{a}^{2}}\right)<{I}^{2}\left(a\right)<\pi \left(1-{e}^{-2{a}^{2}}\right).$

By the squeeze theorem, this gives the Gaussian integral

${\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx=\sqrt{\pi }.$

### By Cartesian coordinates [ edit ]

A different technique, which goes back to Laplace (1812),[3] is the following. Let

$\begin{array}{cc}y& =xs\\ dy& =xds.\end{array}$

Since the limits on s as y → ±∞ depend on the sign of x, it simplifies the calculation to use the fact that ex2 is an even function, and, therefore, the integral over all real numbers is just twice the integral from zero to infinity. That is,

${\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx=2{\int }_{0}^{\infty }{e}^{-{x}^{2}}dx.$

Thus, over the range of integration, x ≥ 0, and the variables y and s have the same limits. This yields:

$\begin{array}{cc}{I}^{2}& =4{\int }_{0}^{\infty }{\int }_{0}^{\infty }{e}^{-\left({x}^{2}+{y}^{2}\right)}dydx\\ =4{\int }_{0}^{\infty }\left({\int }_{0}^{\infty }{e}^{-\left({x}^{2}+{y}^{2}\right)}dy\right)dx\\ =4{\int }_{0}^{\infty }\left({\int }_{0}^{\infty }{e}^{-{x}^{2}\left(1+{s}^{2}\right)}xds\right)dx\end{array}$

Then, using

Fubini’s theorem

to switch the

order of integration

:

$\begin{array}{cc}{I}^{2}& =4{\int }_{0}^{\infty }\left({\int }_{0}^{\infty }{e}^{-{x}^{2}\left(1+{s}^{2}\right)}xdx\right)ds\\ =4{\int }_{0}^{\infty }{\left[\frac{{e}^{-{x}^{2}\left(1+{s}^{2}\right)}}{-2\left(1+{s}^{2}\right)}\right]}_{x=0}^{x=\infty }ds\\ =4\left(\frac{1}{2}{\int }_{0}^{\infty }\frac{ds}{1+{s}^{2}}\right)\\ =2\mathrm{arctan}\left(s\right){|}_{0}^{\infty }\\ =\pi .\end{array}$

Therefore, $I=\sqrt{\pi }$, as expected.

In Laplace approximation, we deal only with up to second-order terms in Taylor expansion, so we consider ${e}^{-{x}^{2}}\approx 1-{x}^{2}\approx \left(1+{x}^{2}{\right)}^{-1}$.

In fact, since $\left(1+t\right){e}^{-t}\le 1$ for all $t$, we have the exact bounds:

$1-{x}^{2}\le {e}^{-{x}^{2}}\le \left(1+{x}^{2}{\right)}^{-1}$

Then we can do the bound at Laplace approximation limit:

${\int }_{\left[-1,1\right]}\left(1-{x}^{2}{\right)}^{n}dx\le {\int }_{\left[-1,1\right]}{e}^{-n{x}^{2}}dx\le {\int }_{\left[-1,1\right]}\left(1+{x}^{2}{\right)}^{-n}dx$

That is,

$2\sqrt{n}{\int }_{\left[0,1\right]}\left(1-{x}^{2}{\right)}^{n}dx\le {\int }_{\left[-\sqrt{n},\sqrt{n}\right]}{e}^{-{x}^{2}}dx\le 2\sqrt{n}{\int }_{\left[0,1\right]}\left(1+{x}^{2}{\right)}^{-n}dx$

By trigonometric substitution, we exactly compute those two bounds: $2\sqrt{n}\left(2n\right)!!/\left(2n+1\right)!!$ and $2\sqrt{n}\left(\pi /2\right)\left(2n-3\right)!!/\left(2n-2\right)!!$

By taking the square root of the Wallis formula,

$\frac{\pi }{2}=\prod _{n=1}\frac{\left(2n{\right)}^{2}}{\left(2n-1\right)\left(2n+1\right)}$

we have

$\sqrt{\pi }=\underset{n\to \infty }{lim}2\sqrt{n}\frac{\left(2n\right)!!}{\left(2n+1\right)!!}$

, the desired upper bound limit. Similarly we can get the desired lower bound limit.
Conversely, if we first compute the integral with one of the other methods above, we would obtain a proof of the Wallis formula.

## Relation to the gamma function [ edit ]

The integrand is an even function,

${\int }_{-\infty }^{\infty }{e}^{-{x}^{2}}dx=2{\int }_{0}^{\infty }{e}^{-{x}^{2}}dx$

Thus, after the change of variable $x=\sqrt{t}$, this turns into the Euler integral

$2{\int }_{0}^{\infty }{e}^{-{x}^{2}}dx=2{\int }_{0}^{\infty }\frac{1}{2}{e}^{-t}{t}^{-\frac{1}{2}}dt=\Gamma \left(\frac{1}{2}\right)=\sqrt{\pi }$

where $\Gamma \left(z\right)={\int }_{0}^{\infty }{t}^{z-1}{e}^{-t}dt$ is the gamma function. This shows why the factorial of a half-integer is a rational multiple of $\sqrt{\pi }$. More generally,

${\int }_{0}^{\infty }{x}^{n}{e}^{-a{x}^{b}}dx=\frac{\Gamma \left(\left(n+1\right)/b\right)}{b{a}^{\left(n+1\right)/b}},$

which can be obtained by substituting

$t=a{x}^{b}$

in the integrand of the gamma function to get

$\Gamma \left(z\right)={a}^{z}b{\int }_{0}^{\infty }{x}^{bz-1}{e}^{-a{x}^{b}}dx$

.

## Generalizations [ edit ]

### The integral of a Gaussian function [ edit ]

The integral of an arbitrary Gaussian function is

${\int }_{-\infty }^{\infty }{e}^{-a\left(x+b{\right)}^{2}}dx=\sqrt{\frac{\pi }{a}}.$

An alternative form is

${\int }_{-\infty }^{\infty }{e}^{-a{x}^{2}+bx+c}dx=\sqrt{\frac{\pi }{a}}{e}^{\frac{{b}^{2}}{4a}+c}.$

This form is useful for calculating expectations of some continuous probability distributions related to the normal distribution, such as the log-normal distribution, for example.

### n-dimensional and functional generalization [ edit ]

Suppose A is a symmetric positive-definite (hence invertible) n × n precision matrix, which is the matrix inverse of the covariance matrix. Then,

${\int }_{{R}^{n}}\mathrm{exp}\left(-\frac{1}{2}\sum _{i,j=1}^{n}{A}_{ij}{x}_{i}{x}_{j}\right){d}^{n}x={\int }_{{R}^{n}}\mathrm{exp}\left(-\frac{1}{2}{x}^{T}Ax\right){d}^{n}x=\sqrt{\frac{\left(2\pi {\right)}^{n}}{detA}}=\sqrt{\frac{1}{det\left(A/2\pi \right)}}=\sqrt{det\left(2\pi {A}^{-1}\right)}$

This fact is applied in the study of the multivariate normal distribution.

Also,

$\int {x}_{{k}_{1}}\cdots {x}_{{k}_{2N}}\mathrm{exp}\left(-\frac{1}{2}\sum _{i,j=1}^{n}{A}_{ij}{x}_{i}{x}_{j}\right){d}^{n}x=\sqrt{\frac{\left(2\pi {\right)}^{n}}{detA}}\frac{1}{{2}^{N}N!}\sum _{\sigma \in {S}_{2N}}\left({A}^{-1}{\right)}_{{k}_{\sigma \left(1\right)}{k}_{\sigma \left(2\right)}}\cdots \left({A}^{-1}{\right)}_{{k}_{\sigma \left(2N-1\right)}{k}_{\sigma \left(2N\right)}}$

where

σ

is a

permutation

of

{1, …, 2N}

and the extra factor on the right-hand side is the sum over all combinatorial pairings of

{1, …, 2N}

of

N

copies of

A
−1

.

Alternatively,[4]

$\int f\left(\stackrel{\to }{x}\right)\mathrm{exp}\left(-\frac{1}{2}\sum _{i,j=1}^{n}{A}_{ij}{x}_{i}{x}_{j}\right){d}^{n}x=\sqrt{\frac{\left(2\pi {\right)}^{n}}{detA}}{\mathrm{exp}\left(\frac{1}{2}\sum _{i,j=1}^{n}{\left({A}^{-1}\right)}_{ij}\frac{\partial }{\partial {x}_{i}}\frac{\partial }{\partial {x}_{j}}\right)f\left(\stackrel{\to }{x}\right)|}_{\stackrel{\to }{x}=0}$

for some analytic function f, provided it satisfies some appropriate bounds on its growth and some other technical criteria. (It works for some functions and fails for others. Polynomials are fine.) The exponential over a differential operator is understood as a power series.

While functional integrals have no rigorous definition (or even a nonrigorous computational one in most cases), we can define a Gaussian functional integral in analogy to the finite-dimensional case.[citation needed] There is still the problem, though, that $\left(2\pi {\right)}^{\infty }$ is infinite and also, the functional determinant would also be infinite in general. This can be taken care of if we only consider ratios:

$\begin{array}{c}\frac{\int f\left({x}_{1}\right)\cdots f\left({x}_{2N}\right)\mathrm{exp}\left[-\iint \frac{1}{2}A\left({x}_{2N+1},{x}_{2N+2}\right)f\left({x}_{2N+1}\right)f\left({x}_{2N+2}\right){d}^{d}{x}_{2N+1}{d}^{d}{x}_{2N+2}\right]Df}{\int \mathrm{exp}\left[-\iint \frac{1}{2}A\left({x}_{2N+1},{x}_{2N+2}\right)f\left({x}_{2N+1}\right)f\left({x}_{2N+2}\right){d}^{d}{x}_{2N+1}{d}^{d}{x}_{2N+2}\right]Df}\\ =& \frac{1}{{2}^{N}N!}\sum _{\sigma \in {S}_{2N}}{A}^{-1}\left({x}_{\sigma \left(1\right)},{x}_{\sigma \left(2\right)}\right)\cdots {A}^{-1}\left({x}_{\sigma \left(2N-1\right)},{x}_{\sigma \left(2N\right)}\right).\end{array}$

In the DeWitt notation, the equation looks identical to the finite-dimensional case.

### n-dimensional with linear term [ edit ]

If A is again a symmetric positive-definite matrix, then (assuming all are column vectors)

$\int \mathrm{exp}\left(-\frac{1}{2}\sum _{i,j=1}^{n}{A}_{ij}{x}_{i}{x}_{j}+\sum _{i=1}^{n}{B}_{i}{x}_{i}\right){d}^{n}x=\int {e}^{-\frac{1}{2}{\stackrel{\to }{x}}^{T}A\stackrel{\to }{x}+{\stackrel{\to }{B}}^{T}\stackrel{\to }{x}}{d}^{n}x=\sqrt{\frac{\left(2\pi {\right)}^{n}}{detA}}{e}^{\frac{1}{2}{\stackrel{\to }{B}}^{T}{A}^{-1}\stackrel{\to }{B}}.$

### Integrals of similar form [ edit ]

${\int }_{0}^{\infty }{x}^{2n}{e}^{-\frac{{x}^{2}}{{a}^{2}}}dx=\sqrt{\pi }\frac{{a}^{2n+1}\left(2n-1\right)!!}{{2}^{n+1}}$
${\int }_{0}^{\infty }{x}^{2n+1}{e}^{-\frac{{x}^{2}}{{a}^{2}}}dx=\frac{n!}{2}{a}^{2n+2}$
${\int }_{0}^{\infty }{x}^{2n}{e}^{-b{x}^{2}}dx=\frac{\left(2n-1\right)!!}{{b}^{n}{2}^{n+1}}\sqrt{\frac{\pi }{b}}$
${\int }_{0}^{\infty }{x}^{2n+1}{e}^{-b{x}^{2}}dx=\frac{n!}{2{b}^{n+1}}$
${\int }_{0}^{\infty }{x}^{n}{e}^{-b{x}^{2}}dx=\frac{\Gamma \left(\frac{n+1}{2}\right)}{2{b}^{\frac{n+1}{2}}}$

where

$n$

is a positive integer and

$!!$

denotes the

double factorial

.

An easy way to derive these is by differentiating under the integral sign.

$\begin{array}{cc}{\int }_{-\infty }^{\infty }{x}^{2n}{e}^{-\alpha {x}^{2}}dx& ={\left(-1\right)}^{n}{\int }_{-\infty }^{\infty }\frac{{\partial }^{n}}{\partial {\alpha }^{n}}{e}^{-\alpha {x}^{2}}dx\\ ={\left(-1\right)}^{n}\frac{{\partial }^{n}}{\partial {\alpha }^{n}}{\int }_{-\infty }^{\infty }{e}^{-\alpha {x}^{2}}dx\\ =\sqrt{\pi }{\left(-1\right)}^{n}\frac{{\partial }^{n}}{\partial {\alpha }^{n}}{\alpha }^{-\frac{1}{2}}\\ =\sqrt{\frac{\pi }{\alpha }}\frac{\left(2n-1\right)!!}{{\left(2\alpha \right)}^{n}}\end{array}$

One could also integrate by parts and find a recurrence relation to solve this.

### Higher-order polynomials [ edit ]

Applying a linear change of basis shows that the integral of the exponential of a homogeneous polynomial in n variables may depend only on SL(n)-invariants of the polynomial. One such invariant is the discriminant,
zeros of which mark the singularities of the integral. However, the integral may also depend on other invariants.[5]

Exponentials of other even polynomials can numerically be solved using series. These may be interpreted as formal calculations when there is no convergence. For example, the solution to the integral of the exponential of a quartic polynomial is[citation needed]

${\int }_{-\infty }^{\infty }{e}^{a{x}^{4}+b{x}^{3}+c{x}^{2}+dx+f}dx=\frac{1}{2}{e}^{f}\sum _{\begin{array}{c}n,m,p=0\\ n+p=0\mathrm{mod}2\end{array}}^{\infty }\frac{{b}^{n}}{n!}\frac{{c}^{m}}{m!}\frac{{d}^{p}}{p!}\frac{\Gamma \left(\frac{3n+2m+p+1}{4}\right)}{\left(-a{\right)}^{\frac{3n+2m+p+1}{4}}}.$

The n + p = 0 mod 2 requirement is because the integral from −∞ to 0 contributes a factor of (−1)n+p/2 to each term, while the integral from 0 to +∞ contributes a factor of 1/2 to each term. These integrals turn up in subjects such as quantum field theory.

## References [ edit ]

### Sources [ edit ]

You are watching: Gaussian integral. Info created by THVinhTuy selection and synthesis along with other related topics.

Rate this post