y=e−x2 substitutes u=−x2 into the exponent of eu, tracing a symmetric bell curve. As the kernel of the normal distribution in statistics it is one of the most important functions there is, appearing throughout probability and statistics and on into physics and signal processing.
Domain and range
It is defined for every real x. Since −x2≤0 we have 0<e−x2≤1, so the range is (0,1].
The domain is all real numbers
The range is (0,1]
The maximum is 1, at x=0
There is no minimum; the lower bound 0 is never reached
The further x moves from the origin the smaller the value, but the exponential takes only positive values, so it never becomes zero.
Symmetry
Since f(−x)=e−(−x)2=e−x2=f(x), the function is even and its graph is symmetric about the y-axis. It pairs with y=xe−x2, which carries the same exponent and is odd, symmetric about the origin.
Monotonicity and extremum
The chain rule gives the derivative.
f′(x)=e−x2⋅dxd(−x2)=−2xe−x2
Since e−x2>0 the sign is decided by −2x alone: the function increases for x<0 and decreases for x>0. It therefore attains its maximum at the peak (0,1), and there is no local minimum.
Inflection points
The product rule gives the second derivative.
f′′(x)=(4x2−2)e−x2
It vanishes at x=±21≈±0.707, where the value is y=e−1/2≈0.607. Those are the shoulders of the bell, where the curve turns from concave down to concave up.
How fast it decays
As x→±∞ we have −x2→−∞ and hence e−x2→0, so the x-axis, the line y=0, is a horizontal asymptote. Because the exponent carries a square, the decay is far faster than that of e−x.
x
y=e−x2
0
1
0.5
0.7788
1
0.3679
1.5
0.1054
2
0.0183
3
0.0001234
Full width at half maximum
A common measure of the spread of the bell is the width at which the value falls to half its maximum, the full width at half maximum. Solving e−x2=21 gives x=±ln2, so the width is as follows.
2ln2≈1.6651
The Gaussian integral
Although it has no elementary antiderivative, the integral over the whole line has a closed form1.
∫−∞∞e−x2dx=π
The standard proof squares it and moves the resulting double integral to polar coordinates.
Since I>0 we get I=π. The version with a coefficient, ∫−∞∞e−ax2dx=aπ for a>0, follows the same way.
The antiderivative and the error function
The indefinite integral cannot be written with elementary functions, so the error function is defined as follows3.
erf(x)=π2∫0xe−t2dt
With it the antiderivative takes this form.
∫e−x2dx=2πerf(x)+C
Relation to the normal distribution
The density of the standard normal distribution has the following form.
φ(t)=2π1e−t2/2
Putting t=2x turns e−t2/2 into e−x2. The density is thus the Gaussian function stretched horizontally by a factor of 2 and normalized so that the total area is 12.
Quantity
Gaussian function
Standard normal
Formula
e−x2
2π1e−t2/2
Maximum
1
2π1≈0.3989
Position of the inflection points
±21
±1
Total area
π
1
Moments
Being even, all of its odd moments vanish. The even ones are given by a formula using the double factorial.
∫−∞∞x2ne−x2dx=2n(2n−1)!!π
n=1
2π
n=2
43π
n=3
815π
Fourier transform
The Fourier transform of a Gaussian is again a Gaussian.
∫−∞∞e−x2e−ikxdx=πe−k2/4
The narrower the original, the wider the transform. That trade-off recurs wherever width and spread cannot both be small at once, from the uncertainty principle of quantum mechanics to the window functions of signal processing.
The heat equation
The fundamental solution of the heat equation ut=uxx is a Gaussian as well.
u(x,t)=4πt1e−x2/(4t)
As t→0+ it concentrates at the origin, and as time passes it widens and flattens. Heat placed at a single point spreading out is exactly the widening of the bell.
Taylor expansion
Substituting u=−x2 into the series for eu gives an expansion that converges for every real number.
e−x2=n=0∑∞n!(−1)nx2n
That no odd powers appear is how evenness shows up on the side of the series.
Numerical computation
Since the antiderivative is not elementary, the area over a concrete interval is found by numerical integration. Computing the interval [0,3] with the trapezoidal rule goes as follows.
functiongaussian(x:number):number{return Math.exp(-x * x)}functiontrapezoid(from:number, to:number, count:number):number{const step =(to - from)/ count
let total =(gaussian(from)+gaussian(to))/2for(let index =1; index < count; index++){
total +=gaussian(from + index * step)}return total * step
}
The result is 0.8862, matching 2π≈0.8862 almost exactly, because the contribution beyond x=3 is already negligible.
History
In Theoria Motus of 1809, Gauss derived the following form as the most probable distribution of observational error.
φ(Δ)=πhe−h2Δ2
De Moivre reached the curve as an approximation to the binomial distribution, and Gauss and Laplace established it as the distribution of error2. The view of it as the curve at the center of the theory of errors was settled from there.
Applications
The distribution of measurement error, that is the normal distribution
The fundamental solution of the heat equation
Blurring in image processing, the Gaussian filter
The RBF kernel in the kernel methods of machine learning
The ground state of the harmonic oscillator in quantum mechanics