Integration of the Gaussian function

1   Derivation

Let $f(x)$ denote a generalized Gaussian function \begin{equation} f(x)=ae^{-b(x-c)^2} \label{eq:gaussian} \end{equation} where $b>0$.

We can obtain the integral of Eq. \eqref{eq:gaussian} by taking the square root of the squared integral as follows: \begin{equation} \begin{split} \int_{-\infty}^\infty ae^{-b(x-c)^2}\,dx &=\sqrt{\left(\int_{-\infty}^\infty ae^{-b(x-c)^2}\,dx\right)^2}\\ &=\sqrt{\int_{-\infty}^\infty ae^{-b(x-c)^2}\,dx\,\int_{-\infty}^\infty ae^{-b(y-c)^2}\,dy}\\ &=\sqrt{\int_{-\infty}^\infty\int_{-\infty}^\infty a^2e^{-b\left[(x-c)^2+(y-c)^2\right]}\,dx\,dy}\\ &=a\sqrt{\int_{-\infty}^\infty\int_{-\infty}^\infty e^{-b\left[(x-c)^2+(y-c)^2\right]}\,dx\,dy}.\\ \end{split} \label{eq:integral} \end{equation}

Letting $x’=x-c$, $dx’=dx$, $y’=y-c$, and $dy’=dy$ yields \begin{equation} \begin{split} \int_{-\infty}^\infty ae^{-b(x-c)^2}\,dx &=a\sqrt{\int_{-\infty}^\infty\int_{-\infty}^\infty e^{-b\left(x’^2+y’^2\right)}\,dx’\,dy’}.\\ \end{split} \label{eq:integral_2} \end{equation}

To change the two variables $x’$ and $y’$ in the Cartesian coordinate system to $r$ and $\theta$ in the polar coordinate system, we define \begin{align} x’&=r\cos\theta\\ y’&=r\sin\theta\\ \end{align} where $0\leq r<\infty$ and $0\leq\theta\leq 2\pi$.

Now, we can rewrite Eq. \eqref{eq:integral_2} in terms of $r$ and $\theta$ as \begin{equation} \begin{split} \int_{-\infty}^\infty ae^{-b(x-c)^2}\,dx &=a\sqrt{\int_{0}^{2\pi}\int_0^\infty e^{-br^2}r\,dr\,d\theta}\\ &=a\sqrt{\int_0^\infty\int_{0}^{2\pi}e^{-br^2}r\,d\theta\,dr}\\ &=a\sqrt{\int_0^\infty e^{-br^2}r\int_{0}^{2\pi}\,d\theta\,dr}\\ &=a\sqrt{2\pi\int_0^\infty e^{-br^2}r\,dr}. \end{split} \label{eq:integral_3} \end{equation} Note that $r\,dr\,d\theta$ is equivalent to $dx’\,dy’$ (both are the infinitesimal area of the double integral). The infinitesimal area in the polar coordinate system is $dr\times r\,d\theta$.

Letting $s=br^2$ and $ds=2br\,dr$, and rewriting Eq. \eqref{eq:integral_2} in terms of $s$ gives us \begin{equation} \begin{split} \int_{-\infty}^\infty ae^{-b(x-c)^2}\,dx &=a\sqrt{2\pi\int_0^\infty e^{-s}\frac{r}{2br}\,ds}\\ &=a\sqrt{\frac{\pi}{b}\int_0^\infty e^{-s}\,ds}\\ &=a\sqrt{\frac{\pi}{b}\left[-e^{-s}\right]_0^\infty}\\ &=a\sqrt{\frac{\pi}{b}\left(-e^{-\infty}+e^0\right)}\\ &=a\sqrt{\frac{\pi}{b}(0+1)}\\ &=a\sqrt{\frac{\pi}{b}}. \end{split} \label{eq:integral_4} \end{equation}

2   $e^{-\pi x^2}$

Substituting $a=1$, $b=\pi$, and $c=0$ (in fact, $c$ is ignored on the right-hand side) in Eq. \eqref{eq:integral_4} results in \begin{equation} \int_{-\infty}^\infty e^{-\pi x^2}\,dx=1. \label{eq:integral_ex_1} \end{equation}