I work out some of the properties of the gaussian function from its generating differential equation including its first integral.
In the previous post, I wrote about the exponential and its definition as the function proportional to its first derivative, namely:
dtdy+λy(t)=0 .(1)
There are many functions of mathematics that derive from differential equations like this one. Take the following example where the funtion of a single space variable, y(x), is not just proportional to its first derivative, but rather satisfies
dxdy+σ2xy(x)=0 ,(2)
where σ is a constant real number. In order to solve the above we can use the technique of separation of variables (pardon the lack of mathematical rigour):
dxdy↔∫ydy↔log(y)↔y(x)=−σ2xy(x)=−∫σ2xdx=−21σ2x2+B=Ae−21σ2x2 ,(3)
where log(x) is the natural logarithm (the inverse of the exponential function, ex) and A and B≡logA are constants. This function is the gaussian function centred at the origin and has many applications in many areas of mathematics including probability theory, statistics, information theory, quantum mechanics, etc… Equation (2) is a perfectly valid – although not very common – definition of this function and has the advantage of explicitly showing some of the function’s properties. For example, it is invariant under the transformation that takes x to −x, contrary to Eq.(1) when t goes to −t.
By taking the derivative on both sides of Eq.(1), we obtain the following second order differential equation :
dx2d2y+σ4σ2−x2y=0 .(4)
Since the sign of y is constant for all values of x, this means that dx2d2y changes sign at x=±σ corresponding to the location of inflection points in the original function. By inserting these values back into Eq.(3), we find that these correspond to y(±σ)=√eA≈0.607A. You can see the plot of the function for different values of σ on the figure below.
![bell curve](/images/posts_data/bell-curve/bell.png)
Because of its shape, the gaussian function is sometimes referred to as the bell curve. From Eq.(\ref{eq:dydx}), we see that its first derivative is simply (assuming A=1)
dxdy=σ2xe−21σ2x2 .
Its first integral, however, cannot be evaluated in terms of simple functions. There is however a notable exception when the integral covers the entire real line:
I≡∫−∞∞e−21σ2x2dx=?(5)
The trick is to start by taking the square of the above and then change to the polar set of coordinates
I2=∫−∞∞e−21σ2x2dx∫−∞∞e−21σ2y2dy=∫−∞∞∫−∞∞e−21σ2x2+y2dxdy=∫02πdθ∫0∞re−21σ2r2dr .
The integrand on the right is equivalent to the right-hand-side of Eq.(2) where x→r. By substituting the left-hand-side, we arrive at
I2↔I=2πσ2∫0∞drde−21σ2r2dr=2πσ2{e−21σ2r2}0∞=√2π σ .
The Error function is a special case of Eq.(5) defined as
Erf(x)Erf(√2σx)=√π2∫0xe−u2du=√2πσ2∫0xe−21σ2u2du(6)
The figure below shows the plot of Eq. (6) for different values of σ.
![error function](/images/posts_data/bell-curve/error.png)
From Eq. (4) and the definition of the error function, one can compute the following weighted gaussian integral:
∫0xσ2u2e−21σ2u2du=∫0xe−21σ2u2du+σ2∫0xdu2d2(e−21σ2u2)du=∫0xe−21σ2u2du+σ2{dud(e−21σ2u2)}0x=√2πσ Erf(√2σx)−e−21σ2x2x .