# Is there really no way to integrate $e^{-x^2}$?

Today in my calculus class, we encountered the function $e^{-x^2}$, and I was told that it was not integrable.

I was very surprised. Is there really no way to find the integral of $e^{-x^2}$? Graphing $e^{-x^2}$, it appears as though it should be.

$$\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$$

This is from -infinity to infinity. If the function can be integrated within these bounds, I'm unsure why it can't be integrated with respect to $(a, b)$.

Is there really no way to find the integral of $e^{-x^2}$, or are the methods to finding it found in branches higher than second semester calculus?

• There is no antiderivative written in elementary functions (imagine the roots for a polynomial of degree, e.g., five, for which there is no formula). Jun 7 '12 at 5:11
• There is no elementary function whose derivative is $e^{-x^2}$. By elementary function we mean something obtained using arithmetical operations and composition from the standard functions we all know and love. But this is not a serious problem. A few important definite integrals involving $e^{-x^2}$ have pleasant closed form. Jun 7 '12 at 5:12
• Try reading this note of Brian Conrad's and the article by Rosenlicht referenced therein. Jun 7 '12 at 5:20
• Well, in someway it is no more surprising than stating that $\frac{1}{2}$ cannot be written as an integer. As noted by others, it is integrable, it is just that the collection of 'standard' functions is not rich enough to express the answer. Jun 7 '12 at 6:08
• Unfortunately there are three or four different meanings being given to the word "integrable" here: (1) $f(x)$ is Riemann integrable on intervals $[a,b]$ (yes, every continuous function is) (2) $f(x)$ has an antiderivative that is an elementary function (no, it doesn't: the antiderivative $\sqrt{\pi}\ \text{erf}(x)/2$ is not an elementary function) (3) $\int_{-\infty}^\infty |f(x)|\ dx < \infty$ (yes, and this is the usual meaning of "integrable" in analysis) (4) $\int_{-\infty}^\infty f(x)\ dx$ can be expressed in "closed form" (yes, it is $\sqrt{\pi}$). Jun 7 '12 at 6:54

That function is integrable. As a matter of fact, any continuous function (on a compact interval) is Riemann integrable (it doesn't even actually have to be continuous, but continuity is enough to guarantee integrability on a compact interval). The antiderivative of $e^{-x^2}$ (up to a constant factor) is called the error function, and can't be written in terms of the simple functions you know from calculus, but that is all.

• But the evaluation of the integral over the whole real line is relatively easy! Jun 7 '12 at 6:33
• Easy for Lord Kelvin. Jun 7 '12 at 6:41
• You probably mean that any continuous function is Riemann integrable on a compact interval. Mar 13 '13 at 7:25
• How to show that the function is non-elementary? I cannot remember seeing a proof of that.
– M.B.
Aug 10 '13 at 16:32
• @M.B.: see for example M.P. Wiener's text here. Aug 10 '13 at 16:44

To build on kee wen's answer and provide more readability, here is an analytic method of obtaining a definite integral for the Gaussian function over the entire real line:

Let $$I=\int_{-\infty}^\infty e^{-x^2} dx$$.

Then, \begin{align} I^2 &= \left(\int_{-\infty}^\infty e^{-x^2} dx\right) \times \left(\int_{-\infty}^{\infty} e^{-y^2}dy\right) \\ &=\int_{-\infty}^\infty\left(\int_{-\infty}^\infty e^{-(x^2+y^2)} dx\right)dy \\ \end{align}

Next we change to polar form: $$x^2+y^2=r^2$$, $$dx\,dy=dA=r\,d\theta\,dr$$. Therefore

\begin{align} I^2 &= \iint e^{-(r^2)}r\,d\theta\,dr \\ &=\int_0^{2\pi}\left(\int_0^\infty re^{-r^2}dr\right)d\theta \\ &=2\pi\int_0^\infty re^{-r^2}dr \end{align}

Next, let's change variables so that $$u=r^2$$, $$du=2r\,dr$$. Therefore, \begin{align} 2I^2 &=2\pi\int_{r=0}^\infty 2re^{-r^2}dr \\ &= 2\pi \int_{u=0}^\infty e^{-u} du \\ &= 2\pi \left(-e^{-\infty}+e^0\right) \\ &= 2\pi \left(-0+1\right) \\ &= 2\pi \end{align}

Therefore, $$I=\sqrt{\pi}$$.

Just bear in mind that this is simpler than obtaining a definite integral of the Gaussian over some interval (a,b), and we still cannot obtain an antiderivative for the Gaussian expressible in terms of elementary functions.

• If $e^{-x^2}$ is the area under the curve then $I^2$ should have units of $area^{2}$. But \begin{align} I^2 &= \iint e^{-(r^2)}r\,d\theta\,dr \\ \end{align} has units of volume. How is it possible? Jan 24 '20 at 16:00
• @user599310 The units of $I^2$ are indeed units of $area^2$, but so too are the units of $\iint e^{-(r^2)}r\,d\theta\,dr$ in $area^2$. First note that $dA = r\,d\theta\,dr = dx\,dy$, all of which are in units of $area$. Second note that $e^{-r^2}$ is equivalent to $e^{-x^2}e^{-y^2}$. In words, the base shift that we performed from $dx\,dy$ to $r\,d\theta\,dr$ changes us from measuring the function in terms of two lengths, to measuring it in terms of chunks of areas. Hence why $e^{-r^2}$ is a function that returns areas, where $e^{-x^2}$ returns lengths. Feb 6 '20 at 19:04
• @CopaceticMan What I don't understand is if we plot the function $f(x,y)=e^{-(x^2+y^2)}$ then shouldn't the integral give us back the volume under the surface? Feb 7 '20 at 16:20
• @user599310, I am going to attempt some pseudo math to show it: $$I^2 = \int e^-x^2 dx \times \int e^-x^2 dx = Area \times Area = Area^2$$ We can replace one x, with a dummy variable, move the dummy copy into the first integral to get a double integral. $$I^2 = \int \int e^{-x^2-y^2} dA$$ In context, the integrand a function that returns two Area, as it is the product of two functions which return a distance, specifically the height above one axis. So $fdA$ is still in terms of $area^2$. You are correct in your confusion, as the leap may not appear obvious, but it's valid. Jun 16 '20 at 19:42