Science, dev & cartoons

Gaussian integral

The so-called Gaussian integral is the following:

\[\begin{equation} I = \int_{x=-\infty}^{x=+\infty}{e^{-x^2}}dx \tag{1} \end{equation}\]

It is hereby suggested to calculate the value of this integral using a mathematical trick. To do so, one needs not to calculate the integral \(I\) but its square \(I^2\):

\[\begin{equation} I^2 = \int_{x=-\infty}^{x=+\infty}{e^{-x^2}}dx \times \int_{y=-\infty}^{y=+\infty}{e^{-y^2}}dy \tag{2} \end{equation}\]

Using Fubini’s theorem, one can write:

\[\begin{equation} I^2 = \int_{x=-\infty}^{x=+\infty}\int_{y=-\infty}^{y=+\infty}{e^{-\left(x^2+y^2\right)}}dxdy \tag{3} \end{equation}\]

Now we can make a change of variables \(x = r \cos \theta\) and \(y = r \sin \theta\). Therefore:

\[\begin{equation} dx = r d\left(\cos\theta\right) + \cos \theta dr = -r \sin \theta d\theta + \cos \theta dr \tag{4} \end{equation}\]

\[\begin{equation} dy = r d\left(\sin\theta\right) + \sin \theta dr = r \cos \theta d\theta + \sin \theta dr \tag{5} \end{equation}\]

Knowing that \(d\theta \times d\theta\) and \(dr \times dr\) are equal to \(0\) and \(dr d\theta = - d\theta dr\), \(dxdy\) writes:

\[\begin{equation} \begin{aligned} dx dy & = \left(-r \sin \theta d\theta + \cos \theta dr\right) \times (r \cos \theta d\theta + \sin \theta dr) \\ & = -r \sin^2 \theta d\theta dr + r \cos^2 \theta dr d\theta \\ & = r \sin^2 \theta dr d\theta + r \cos^2 \theta dr d\theta \\ & = r \left(\sin^2 \theta + \cos^2 \theta\right) dr d\theta \\ & = r dr d\theta \end{aligned} \tag{6} \end{equation}\]

In the original integral, \(x\) and \(y\) vary between \(-\infty\) and \(+\infty\) meaning that the whole \(x-y\) plan is covered during the integration. Using the polar coordinates \(r\) and \(\theta\), the whole plan can be integrated making \(r\) vary between \(0\) and \(+\infty\) and \(\theta\) vary between \(0\) and \(2\pi\).

Therefore \(I^2\) rewrites:

\[\begin{equation} I^2 = \int_{r=0}^{r=+\infty}\int_{\theta=0}^{\theta=2\pi}{e^{-r^2}}rdrd\theta \tag{7} \end{equation}\]

Using Fubini’s theorem, this integral can be split:

\[\begin{equation} I^2 = \int_{r=0}^{r=+\infty}{e^{-r^2}}rdr \times \int_{\theta=0}^{\theta=2\pi}d\theta \tag{8} \end{equation}\]


\[\begin{equation} \begin{aligned} I^2 = & \left[-\frac{1}{2}e^{-r^2}\right]_{r=0}^{r=+\infty} \times \left[\theta\right]_{\theta=0}^{\theta=2\pi} \\ & = \left(0+\frac{1}{2}\right) \times \left(2\pi - 0\right) \\ & = \pi \end{aligned} \tag{9} \end{equation}\]


\[\begin{equation} I = \int_{x=-\infty}^{x=+\infty}{e^{-x^2}}dx = \sqrt{\pi} \tag{10} \end{equation}\]