The Gaussian

In mathematics, a Gaussian function (named after Carl Friedrich Gauss) is a function of the form:

f(x) = a e^{- { \frac{(x-b)^2 }{ 2 c^2} } }

for some real constants a, b, c > 0, and e ≈ 2.718281828 (Euler’s number).

The graph of a Gaussian is a characteristic symmetric “bell curve” shape that quickly falls off towards plus/minus infinity. The parameter a is the height of the curve’s peak, b is the position of the centre of the peak, and c controls the width of the “bell”.

Gaussian functions are widely used in statistics where they describe the normal distributions, in signal processing where they serve to define Gaussian filters, in image processing where two-dimensional Gaussians are used for Gaussian blurs, and in mathematics where they are used to solve heat equations and diffusion equations and to define the Weierstrass transform.

Properties

\int_{-\infty }^{\infty}\exp(-\pi x^2)\,dx=1

Gaussian functions arise by applying the exponential function to a general quadratic function. The Gaussian functions are thus those functions whose logarithm is a quadratic function.

The parameter c is related to the full width at half maximum (FWHM) of the peak according to

\mathrm{FWHM} = 2 \sqrt{2 \ln 2}\ c = 2.35482\ldots \cdot c.

Alternatively, the parameter c can be interpreted by saying that the two inflection points of the function occur at x = bc andx = b + c.

Gaussian functions are analytic, and their limit as x → ∞ is 0.

Gaussian functions are among those functions that are elementary but lack elementary antiderivatives; the integral of the Gaussian function is the error function. Nonetheless their improper integrals over the whole real line can be evaluated exactly, using theGaussian integral

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

and one obtains

\int_{-\infty}^\infty a e^{- { (x-b)^2 \over 2 c^2 } }\,dx=ac\cdot\sqrt{2\pi}.

This integral is 1 if and only if a = 1/(c√(2π)), and in this case the Gaussian is the probability density function of a normally distributed random variable with expected value μ = b and variance σ2 = c2. These Gaussians are graphed in the accompanying figure.

Gaussian functions centered at zero minimize the Fourier uncertainty principle.

The product of two Gaussian functions is a Gaussian, and the convolution of two Gaussian functions is again a Gaussian, with c = \sqrt{c_{1}^2 + c_{2}^2}.

Taking the Fourier transform of a Gaussian function with parameters a, b = 0 and c yields another Gaussian function, with parameters ac, b = 0 and 1/c. So in particular the Gaussian functions with b = 0 and c = 1 are kept fixed by the Fourier transform (they are eigenfunctions of the Fourier transform with eigenvalue 1).

The fact that the Gaussian function is an eigenfunction of the Continuous Fourier transform allows to derive the following interesting identity from the Poisson summation formula:

\sum_{k\in\mathbb{Z}}\exp\left(-\pi\cdot\left(\frac{k}{c}\right)^2\right) = c\cdot\sum_{k\in\mathbb{Z}}\exp(-\pi\cdot(kc)^2)

Multi-dimensional Gaussian function

In an n-dimensional space a Gaussian function can be defined as

<br /> f(x) = \exp(-x^TAx) \;,<br />

where x=\{x_1,\dots,x_n\} is a column of n coordinates, A is a positive-definite n\times n matrix, and T denotes transposition.

The integral of a Gaussian function over the whole n-dimensional space is given as

<br /> \int_{-\infty}^{+\infty}dx_1\dots dx_n \exp(-x^TBx) = \frac{\left(\sqrt{\pi}\right)^n}{\sqrt{\det{B}}} \;.<br />

It can be easily calculated by diagonalizing the matrix B and changing the integration variables to the eigenvectors of B.

More generally a shifted Gaussian function is defined as

<br /> f(x) = \exp(-x^TAx+s^Tx) \;,<br />

where s=\{s_1,\dots,s_n\} is the shift vector and the matrix A can be assumed to be symmetric, AT = A. The following integrals with this function can be calculated with the same technique,

<br /> \int d^nx e^{-x^TBx+v^Tx} = \frac{\left(\sqrt{\pi}\right)^n}{\sqrt{\det{B}}} \exp(\frac{1}{4}v^TB^{-1}v)\equiv \mathcal{M}\;.<br />
<br /> \int d^n x e^{- x^T B x + v^T x}  \left( a^T x \right) = (a^T u) \cdot<br /> \mathcal{M}\;,\; {\rm where}\;<br /> u = \frac{1}{2} B^{- 1} v \;.<br />
<br /> \int d^n x e^{- x^T B x + v^T x}  \left( x^T D x \right) = \left( u^T D u +<br /> \frac{1}{2} {\rm tr} (D B^{- 1}) \right) \cdot \mathcal{M}\;.<br />
<br /> \begin{align}<br /> & \int d^n x e^{- x^T A' x + s'^T x} \left( -<br /> \frac{\partial}{\partial x} \Lambda \frac{\partial}{\partial x} \right) e^{-<br /> x^T A x + s^T x} = \\<br /> & = \left( 2 {\rm tr} (A' \Lambda A B^{- 1}) + 4 u^T A' \Lambda A u - 2 u^T<br /> (A' \Lambda s + A \Lambda s') + s'^T \Lambda s \right) \cdot \mathcal{M}\;,<br /> \\ & {\rm where} \;<br /> u = \frac{1}{2} B^{- 1} v, v = s + s', B = A + A' \;.<br /> \end{align}<br />

Applications

Gaussian functions appear in many contexts in the natural sciences, the social sciences,mathematics, and engineering. Some examples include:

Gaussian integral

From Wikipedia, the free encyclopedia

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

The Gaussian integral, also known as the Euler-Poisson integral or 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:

\int_{-\infty}^\infty e^{-x^2}\,dx = \sqrt{\pi}.

This integral has wide applications. When normalized so that its value is 1, it is the density function of the normal distribution. It is closely related to the error function, which is the same integral with finite limits.

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 tools of calculus. That is, there is no elementary indefinite integral for \scriptstyle\int e^{-x^2}\,dx, but the definite integral \scriptstyle\int_{-\infty}^\infty e^{-x^2}\,dx can be evaluated.

Computation

By polar coordinates

A standard way to solve this integral is to take the square and change to polar coordinates

{(\int_{-\infty}^{\infty}\exp(-x^2)\, dx )}^2 = \int_{-\infty}^{\infty}(\exp(-x^2)\, dx \int_{-\infty}^{\infty}(\exp(-y^2)\, dy

\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\exp(-x^2-y^2)\, dy \,dx = \int_{0}^{2 \pi}\int_{0}^{\infty}\exp(-\rho^2)\, d \rho \,d \theta

\left(\int e^{-x^2}\,dx\right)^2;

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

Brief proof

Briefly, using the method above, one computes that on the one hand,

\begin{align}<br /> \int_{\mathbf{R}^2} e^{-(x^2+y^2)}\,dA = \int_{-\infty}^\infty \int_{-\infty}^\infty e^{-(x^2+y^2)}\,dx\,dy\\ = \left ( \int_{-\infty}^\infty e^{-x^2}\,dx \right ) \cdot \left ( \int_{-\infty}^\infty e^{-y^2}\,dy \right )\\ = \left ( \int_{-\infty}^\infty e^{-x^2}\,dx \right )^2<br /> \end{align}

On the other hand,

\begin{align}<br /> \int_{\mathbf{R}^2} e^{-(x^2+y^2)}\,dA<br /> &= \int_0^{2\pi} \int_0^{\infin} e^{-r^2}r\,dr\,d\theta\\<br /> &= 2\pi \int_0^\infty re^{-r^2}\,dr\\<br /> &= 2\pi \int_{-\infty}^0 \frac{1}{2} e^s\,ds<br /> = \pi \int_{-\infty}^0 e^s\,ds<br /> = \pi (e^0) \\<br /> & = \pi (1 - 0) = \pi,<br /> \end{align}

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), 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}.
Careful proof

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

I(a)=\int_{-a}^a e^{-x^2}dx.

so that the integral may be found by

\lim_{a\to\infty} I(a) = \int_{-\infty}^{\infty} e^{-x^2}\, dx,

since

\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.

Taking the square of I(a) yields

<br /> \begin{align}<br /> I(a)^2 & = \left ( \int_{-a}^a e^{-x^2}\, dx \right )\cdot \left ( \int_{-a}^a e^{-y^2}\, dy \right ) \\<br /> & = \int_{-a}^a \left ( \int_{-a}^a e^{-y^2}\, dy \right )\,e^{-x^2}\, dx \\<br /> &  = \int_{-a}^a \int_{-a}^a e^{-(x^2+y^2)}\,dx\,dy.<br /> \end{align}<br />

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

\int e^{-(x^2+y^2)}\,d(x,y),

taken over a square with vertices {(−a, a), (a, a), (a, −a), (−a, −a)} on the xyplane.

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

<br /> \begin{align}<br /> x & = r \cos \theta \\<br /> y & = r \sin\theta \\<br /> d(x,y) & = r\, d(r,\theta).<br /> \end{align}<br />
\int_0^{2\pi}\int_0^a re^{-r^2}\,dr\,d\theta < I^2(a) < \int_0^{2\pi}\int_0^{a\sqrt{2}} re^{-r^2}\,dr\,d\theta.

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

Integrating,

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

By the squeeze theorem, this gives the Gaussian integral

\int_{-\infty}^\infty e^{-x^2}\, dx = \sqrt{\pi}.
By Cartesian coordinates

Georgakis[2] wrote that the following is “a better alternative to the usual method of reduction to polar coordinates”.

Let

<br /> \begin{align}<br /> y & = xs \\<br /> dy & = x\,ds.<br /> \end{align}<br />

Since the limits on s as y goes to \pm\infty depend on the sign of x, it simplifies the calculation to use the fact that e^{-x^2} 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\ge 0, and the variables y and s have the same limits. This yields:

 I^2 = 4 \int_0^\infty \int_0^\infty e^{-(x^2 + y^2)} dy\,dx .

Then

<br /> \begin{align}<br /> \frac{I^2}{4} & = \int_0^\infty \left( \int_0^\infty e^{-(x^2 + y^2)} \, dy \right) \, dx = \int_0^\infty \left( \int_0^\infty e^{-x^2(1+s^2)} x\,ds \right) dx \\[5pt]<br /> & = \int_0^\infty \left( \int_0^\infty e^{-x^2(1 + s^2)} x \, dx \right) \, ds \\[5pt]<br /> & = \int_0^\infty \left[ \frac{1}{-2(1+s^2)} e^{-x^2(1+s^2)} \right]_0^\infty \, ds<br /> = \frac{1}{2} \int_0^\infty \frac{ds}{1+s^2} \\[5pt]<br /> & = \frac{1}{2} \left. \arctan s \frac{}{} \right|_0^\infty = \frac{\pi}{4}.<br /> \end{align}<br />

Finally,  I = \sqrt\pi, as expected.

s = \tan \theta

ds = \sec^2 \theta\, d\theta

\displaystyle \int_0^\infty \frac{1}{1+s^2}\, ds =\int_0^{\frac{\pi}{2}}\frac{\frac{1}{\cos^2 \theta}}{1+\frac{\sin^2\theta}{\cos^2 \theta}}\,d\theta =\frac{\pi}{2}

Also

\displaystyle \int_{-\infty}^{\infty} \frac{1}{1+s^2}\, ds = 2\pi i {\rm residue}(\frac{1}{1+s^2}, s = i)

Relation to the gamma function

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^{-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 \sqrt \pi. More generally,

\int_0^\infty e^{-ax^b} dx = \frac{1}{b}\ a^{-1/b} \, \Gamma\left(\frac{1}{b}\right) =  a^{-1/b} \,\Gamma\left(1+\frac{1}{b}\right).
Integrals of similar form
\begin{align}<br /> \int_0^\infty x^{2n}  e^{-x^2/a^2}\,dx<br />   &= \sqrt{\pi} \frac{(2n-1)!!}{2^{n+1}} a^{2n+1} =\sqrt{\pi}\frac{\left(2n\right)!}{n!}\left(\frac{a}{2}\right)^{2n+1}\\<br /> \int_0^\infty x^{2n+1}e^{-x^2/a^2}\,dx<br />   &= \frac{n!}{2} a^{2n+2}<br /> \end{align}

An easy way to derive these is by parameter differentiation.

\begin{align}<br /> \int_{-\infty}^\infty x^{2n} e^{-\alpha x^2}\,dx<br />   &= \left(-1\right)^n\int_{-\infty}^\infty \frac{\partial^n}{\partial \alpha^n} e^{-\alpha x^2}\,dx<br />   &= \left(-1\right)^n\frac{\partial^n}{\partial \alpha^n} \int_{-\infty}^{\infty}e^{-\alpha x^2}\,dx<br />   &= \sqrt{\pi} \left(-1\right)^n\frac{\partial^n}{\partial \alpha^n}\alpha^{-1/2}<br />   &= \sqrt{\frac{\pi}{\alpha}}\frac{(2n-1)!!}{\left(2\alpha\right)^{n}}<br /> \end{align}
Higher-order polynomials

Exponentials of other even polynomials can easily be solved using series. For example the solution to the integral of the exponential of a quartic polynomial is

<br /> \begin{align}<br /> & \int_{-\infty}^{\infty} e^{a x^4+b x^3+c x^2+d x+f}\,dx \\<br /> & {} \quad =<br />     \frac12<br />     e^f \!\!\!\!\!\!\!\!<br />     \sum_{\begin{smallmatrix}n,m,p=0 \\ n+p=0 \mod 2\end{smallmatrix}}^{\infty} \!\!\!\!<br />     \frac{b^n}{n!}<br />     \frac{c^m}{m!}<br />     \frac{d^p}{p!}<br />     \frac{\Gamma(\frac{3n+2m+p+1}4)}{(-a)^{\frac{3n+2m+p+1}4}}.<br /> \end{align}<br />

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.

The integral of an arbitrary Gaussian function is

\int_{-\infty}^{\infty} a\,e^{-(x+b)^2/c^2}\,dx=a |c| \sqrt{\pi}.

An alternative form is

\int_{-\infty}^{\infty}k\,e^{-f x^2 + g x + h}\,dx=\int_{-\infty}^{\infty}k\,e^{-f (x-g/2f)^2 +g^2/4f + h}\,dx=k\,\sqrt{\frac{\pi}{f}}\,\exp\left(g^2/4f + h\right),

where f must be strictly positive for the integral to converge.

Proof

The integral

\int_{-\infty}^{\infty} ae^{-(x+b)^2/c^2}\,dx

can be calculated by putting it into the form of a Gaussian integral. First, the constant a can simply be factored out of the integral. Next, the variable of integration is changed from x to y = x + b.

a\int_{-\infty}^\infty e^{-y^2/c^2}\,dy,

and then to z = y / | c |

a |c| \int_{-\infty}^\infty e^{-z^2}\,dz.

Then, using the Gaussian integral identity

\int_{-\infty}^\infty e^{-z^2}\,dz = \sqrt{\pi},

we have

\int_{-\infty}^{\infty} ae^{-(x+b)^2/c^2}\,dx=a |c| \sqrt{\pi}.

\displaystyle  \int_{-\infty}^{\infty}\exp^{\frac{-(x-X)^2}{2 \sigma^2}}\, dx

This integral is independent of the value of the mean because we can change the variable of integration to a new variable shifted by the mean, i.e.,
\displaystyle  \int_{-\infty}^{\infty}\exp^{\frac{-(x-X)^2}{2 \sigma^2}}\, dx  = \int_{-\infty}^{\infty}\exp^{\frac{-(\xi)^2}{2 \sigma^2}}\, d \xi.

\displaystyle   \int_{-\infty}^{\infty} \xi^n\exp^{\frac{-(\xi)^2}{2 \sigma^2}}\, d \xi vanishes for n odd because the integrand is an odd function and the integral cancels out.

Let’s prove 

\displaystyle   \int_{-\infty}^{\infty} \xi^n\exp^{\frac{-\xi^2}{2 \sigma^2}}\, d \xi = \sqrt{2 \pi \sigma^2}\frac{\sigma^{2n}(2n)!}{2^n n!}             

by induction. The case n=0 is just the Gaussian integral, so let’s assume the case n-1 and test n using integration by parts.

\displaystyle \int_{-\infty}^{\infty}\xi^{2n}\exp^{\frac{-\xi^2}{2\sigma^2}}\, d\xi= -\sigma^2 \int_{-\infty}^{\infty}\xi^{2n-1}\frac{-2 \xi}{2 \sigma^2}\exp^{\frac{-\xi^2}{2 \sigma^2}}\,d\xi

\displaystyle  \sigma^2 (2n-1)\int_{-\infty}^{\infty}\xi^{2(n-1)}\exp^{\frac{-\xi^2}{2 \sigma^2}}\,d\xi =2\sigma^2(2n-1)\sqrt{2\pi \sigma^2}\frac{\sigma^{2(n-1)}(2(n-1))!}{2^n(n-1)!}

\displaystyle 2n(2n-1)\sqrt{2\pi \sigma^2}\frac{\sigma^{2n}(2(n-1))!}{2^n n!}=\sqrt{2\pi \sigma^2}\frac{\sigma^{2n}(2n)!}{2^n n!}

References

http://en.wikipedia.org/wiki/Gaussian_function

http://en.wikipedia.org/wiki/Gaussian_integral

http://en.wikipedia.org/wiki/Integral_of_a_Gaussian_function

http://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution

http://galileo.phys.virginia.edu/classes/252/kinetic_theory.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s