# Gaussian integral

(Redirected from Gaussian Integral)
A graph of ƒ(x) = ex2 and the area between the function and the x-axis, which is equal to ${\displaystyle \scriptstyle {\sqrt {\pi }}}$.

The Gaussian integral, also known as the Euler–Poisson integral is the integral of the Gaussian function ex2 over the entire real line. It is named after the German mathematician and physicist Carl Friedrich Gauss. The integral is:

${\displaystyle \int _{-\infty }^{+\infty }e^{-x^{2}}\,\mathrm {d} x={\sqrt {\pi }}}$

This 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 both to 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, also in the path integral formulation, and to find the propagator of the harmonic oscillator, we make use of this integral.

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

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

but the definite integral

${\displaystyle \int _{-\infty }^{+\infty }e^{-x^{2}}\,\mathrm {d} x}$

can be evaluated.

The Gaussian integral is encountered very often in physics and numerous generalizations of the integral are encountered in quantum field theory.

## Computation

### By polar coordinates

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

${\displaystyle \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^{-(x^{2}+y^{2})}\,dx\,dy}$

• consider the function e−(x2 + y2) = er2 on the plane R2, and compute its integral two ways:
1. on the one hand, by double integration in the Cartesian coordinate system, its integral is a square:
${\displaystyle \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 π.

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

On the other hand, {\displaystyle {\begin{aligned}\iint _{\mathbf {R} ^{2}}e^{-(x^{2}+y^{2})}\,d(x,y)&=\int _{0}^{2\pi }\int _{0}^{\infty }e^{-r^{2}}r\,dr\,d\theta \\&=2\pi \int _{0}^{\infty }re^{-r^{2}}\,dr\\&=2\pi \int _{-\infty }^{0}{\tfrac {1}{2}}e^{s}\,ds&&s=-r^{2}\\&=\pi \int _{-\infty }^{0}e^{s}\,ds\\&=\pi (e^{0}-e^{-\infty })\\&=\pi ,\end{aligned}}}

where the factor of r comes from 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

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

so

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

#### Careful proof

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

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

If the integral

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

were absolutely convergent we would have that its Cauchy principal value, that is, the limit

${\displaystyle \lim _{a\to \infty }I(a)}$

would coincide with

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

To see that this is the case, consider that

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

so we can compute

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

by just taking the limit

${\displaystyle \lim _{a\to \infty }I(a)}$.

Taking the square of ${\displaystyle I(a)}$ yields

{\displaystyle {\begin{aligned}I(a)^{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^{-(x^{2}+y^{2})}\,dy\,dx.\end{aligned}}}

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

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

taken over a square with vertices {(−aa), (aa), (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 ${\displaystyle I(a)^{2}}$, and similarly the integral taken over the square's circumcircle must be greater than ${\displaystyle I(a)^{2}}$. The integrals over the two disks can easily be computed by switching from cartesian coordinates to polar coordinates:

{\displaystyle {\begin{aligned}x&=r\cos \theta \\y&=r\sin \theta \end{aligned}}}
${\displaystyle \mathbf {J} (r,\theta )={\begin{bmatrix}{\dfrac {\partial x}{\partial r}}&{\dfrac {\partial x}{\partial \theta }}\\[1em]{\dfrac {\partial y}{\partial r}}&{\dfrac {\partial y}{\partial \theta }}\end{bmatrix}}={\begin{bmatrix}\cos \theta &-r\sin \theta \\\sin \theta &r\cos \theta \end{bmatrix}}}$
${\displaystyle d(x,y)=|J(r,\theta )|d(r,\theta )=r\,d(r,\theta ).}$
${\displaystyle \int _{0}^{2\pi }\int _{0}^{a}re^{-r^{2}}\,dr\,d\theta

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

Integrating,

${\displaystyle \pi (1-e^{-a^{2}})

By the squeeze theorem, this gives the Gaussian integral

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

### By Cartesian coordinates

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

{\displaystyle {\begin{aligned}y&=xs\\dy&=x\,ds.\end{aligned}}}

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,

${\displaystyle \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:

{\displaystyle {\begin{aligned}I^{2}&=4\int _{0}^{\infty }\int _{0}^{\infty }e^{-(x^{2}+y^{2})}dy\,dx\\&=4\int _{0}^{\infty }\left(\int _{0}^{\infty }e^{-(x^{2}+y^{2})}\,dy\right)\,dx\\&=4\int _{0}^{\infty }\left(\int _{0}^{\infty }e^{-x^{2}(1+s^{2})}x\,ds\right)\,dx\\&=4\int _{0}^{\infty }\left(\int _{0}^{\infty }e^{-x^{2}(1+s^{2})}x\,dx\right)\,ds\\&=4\int _{0}^{\infty }\left[{\frac {1}{-2(1+s^{2})}}e^{-x^{2}(1+s^{2})}\right]_{x=0}^{x=\infty }\,ds\\&=4\left({\tfrac {1}{2}}\int _{0}^{\infty }{\frac {ds}{1+s^{2}}}\right)\\&=2\left[\arctan s{\frac {}{}}\right]_{0}^{\infty }\\&=\pi \end{aligned}}}

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

## Relation to the gamma function

The integrand is an even function,

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

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

${\displaystyle 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 Γ is the gamma function. This shows why the factorial of a half-integer is a rational multiple of ${\displaystyle {\sqrt {\pi }}}$. More generally,

${\displaystyle \int _{0}^{\infty }e^{-ax^{b}}dx={\frac {\Gamma \left({\frac {1}{b}}\right)}{ba^{\frac {1}{b}}}}}$

## Generalizations

### The integral of a Gaussian function

The integral of an arbitrary Gaussian function is

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

An alternative form is

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

This form is very useful in calculating mathematical expectations of some continuous probability distributions concerning normal distribution.

See, for example, the expectation of the log-normal distribution.

### n-dimensional and functional generalization

Suppose A is a symmetric positive-definite (hence invertible) n×n covariance matrix. Then,

${\displaystyle \int _{-\infty }^{\infty }e^{\left(-{\frac {1}{2}}\sum \limits _{i,j=1}^{n}A_{ij}x_{i}x_{j}\right)}\,d^{n}x=\int _{-\infty }^{\infty }e^{\left(-{\frac {1}{2}}x^{T}Ax\right)}\,d^{n}x={\sqrt {\frac {(2\pi )^{n}}{\det A}}}}$

where the integral is understood to be over Rn. This fact is applied in the study of the multivariate normal distribution.

Also,

${\displaystyle \int x^{k_{1}}\cdots x^{k_{2N}}\,e^{\left(-{\frac {1}{2}}\sum \limits _{i,j=1}^{n}A_{ij}x_{i}x_{j}\right)}\,d^{n}x={\sqrt {\frac {(2\pi )^{n}}{\det A}}}\,{\frac {1}{2^{N}N!}}\,\sum _{\sigma \in S_{2N}}(A^{-1})_{k_{\sigma (1)}k_{\sigma (2)}}\cdots (A^{-1})_{k_{\sigma (2N-1)}k_{\sigma (2N)}}}$

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,[citation needed]

${\displaystyle \int f({\vec {x}})e^{\left(-{\frac {1}{2}}\sum \limits _{i,j=1}^{n}A_{ij}x_{i}x_{j}\right)}d^{n}x={\sqrt {(2\pi )^{n} \over \det A}}\,\left.e^{\left({1 \over 2}\sum \limits _{i,j=1}^{n}(A^{-1})_{ij}{\partial \over \partial x_{i}}{\partial \over \partial x_{j}}\right)}f({\vec {x}})\right|_{{\vec {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 ${\displaystyle (2\pi )^{\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:

${\displaystyle {\frac {\int f(x_{1})\cdots f(x_{2N})e^{-\iint {\frac {1}{2}}A(x_{2N+1},x_{2N+2})f(x_{2N+1})f(x_{2N+2})d^{d}x_{2N+1}d^{d}x_{2N+2}}{\mathcal {D}}f}{\int e^{-\iint {\frac {1}{2}}A(x_{2N+1},x_{2N+2})f(x_{2N+1})f(x_{2N+2})d^{d}x_{2N+1}d^{d}x_{2N+2}}{\mathcal {D}}f}}={\frac {1}{2^{N}N!}}\sum _{\sigma \in S_{2N}}A^{-1}(x_{\sigma (1)},x_{\sigma (2)})\cdots A^{-1}(x_{\sigma (2N-1)},x_{\sigma (2N)}).}$

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

### n-dimensional with linear term

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

${\displaystyle \int e^{-{\frac {1}{2}}\sum \limits _{i,j=1}^{n}A_{ij}x_{i}x_{j}+\sum \limits _{i=1}^{n}B_{i}x_{i}}d^{n}x=\int e^{-{\frac {1}{2}}{\vec {x}}^{T}{\mathbf {A}}{\vec {x}}+{\vec {B}}^{T}{\vec {x}}}d^{n}x={\sqrt {\frac {(2\pi )^{n}}{\det {A}}}}e^{{\frac {1}{2}}{\vec {B}}^{T}A^{-1}{\vec {B}}}.}$

### Integrals of similar form

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

(n positive integer)

An easy way to derive these is by parameter differentiation.

${\displaystyle \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 {(2n-1)!!}{\left(2\alpha \right)^{n}}}}$

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

### Higher-order polynomials

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. [2]

Exponentials of other even polynomials can numerically be solved using series. For example the solution to the integral of the exponential of a quartic polynomial is[citation needed]

${\displaystyle \int _{-\infty }^{\infty }e^{ax^{4}+bx^{3}+cx^{2}+dx+f}\,dx={\frac {1}{2}}e^{f}\ \sum _{\begin{smallmatrix}n,m,p=0\\n+p=0\mod 2\end{smallmatrix}}^{\infty }\ {\frac {b^{n}}{n!}}{\frac {c^{m}}{m!}}{\frac {d^{p}}{p!}}{\frac {\Gamma \left({\frac {3n+2m+p+1}{4}}\right)}{(-a)^{\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.