A proof for the The Gaussian Integral

The definite integral of \(e^{-x^2}\) over the entire real line does have a beautiful result involving \(\pi\):
$$\boxed{ \int_{-\infty}^{\infty} e^{-x^2}dx = \sqrt \pi}$$
Consider the square of the integral: Let \(\displaystyle I=\int_{-\infty}^{\infty} e^{-x^2}dx\), then\(\displaystyle I^2=\int_{-\infty}^{\infty} e^{-x^2}dx\int_{-\infty}^{\infty} e^{-x^2}dx\)
Use Fubini's theorem to convert to a double integral: \(\displaystyle I^2=\int_{-\infty}^{\infty} e^{-x^2}dx\int_{-\infty}^{\infty} e^{-y^2}dy\)
Simplify and convert to polar coordinates: \(\displaystyle I^2=\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} e^{-(x^2 + y^2)}dxdy\)
Now, convert to polar coordinates:
$$\begin{align*} &x = r \cos \theta \\ &y = r \sin \theta \\ &dx.dy = r.dr.d\theta \end{align*}$$
So \(I^2 = \displaystyle \int_{0}^{2\pi}\int_{0}^{\infty} e^{-r^2}rdrd\theta\)
Evaluate the double integral: First, evaluate the inner integral with respect to $r$. We can use a simple substitution: let \(u=r^2, du=2rdr\)
$$\displaystyle \int_{0}^{\infty} e^{-r^2}rdr = \frac 1 2 \int_0^{\infty}e^{-u}du = \frac 1 2 \left[-e^{-u}\right]_0^{\infty} = \frac 1 2$$
Now, substitute this back into the double integral:
$$I^2 = \int_0^{2\pi}\frac 1 2 d\theta = \frac 1 2[\theta]_0^{2\pi}=\pi$$
Take the square root \(I^2 = \pi \implies I=\sqrt \pi\). So we have proven that:
$$\boxed{ \int_{-\infty}^{\infty} e^{-x^2}dx = \sqrt \pi}$$