1

How to evaluate the integral $\int_{-\infty}^a e^{-x^2} dx$?

I know that $\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$ because if I let $I = \int_{-\infty}^{\infty} e^{-x^2} dx$, then

\begin{align*} I^2 &= \int_{-\infty}^{\infty}\int_{-\infty}^{\infty} e^{-x^2 -y^2} dx dy \\ &= \int_{0}^{\infty}\int_{0}^{2\pi} e^{-r} r dr d\theta\\ &= 2\pi \int_{0}^\infty e^{-r^2} r dr\\ &= \pi \end{align*} where the second equal sign follows from polar transformation. However, what if I'm interested in evaluating $\int_{-\infty}^a e^{-x^2} dx$? I'm having trouble translating $\int_{-\infty}^a$ into the correct bounds on $r$ and $\theta$.

Adrian
  • 1,976
  • 2
    You can't do it without the Error Function. – Joshua Wang Feb 22 '21 at 01:49
  • The technique you identify only works in the context you identify and does not cleanly evaluate the expression for arbitrary values of $a$ (there are exceptions, e.g. the value at $a=0$ can be deduced from your calculation). For arbitrary $a$ I do not know of a method that would result in an evaluation that is any simpler than simply just the integral expression itself. – leslie townes Feb 22 '21 at 01:53
  • If you are actually interested in evaluating the integral, rather than finding a closed form for the integral, this answer gives three methods, depending on the value of the argument and precision desired. – robjohn Feb 22 '21 at 02:09

1 Answers1

2

This integral is equal to $$\int\limits_{-\infty}^a e^{-x^2}\,\mathrm{d}x = \dfrac{\sqrt{{\pi}}\left(\operatorname{erf}\left(a\right)+1\right)}{2},$$ where the error function is defined as $$\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}}\int\limits_{0}^{x}e^{-\tau^2}\,\mathrm{d}\tau.$$

vitamin d
  • 5,783
  • 1
    ...yep... as is widely, widely known. – David G. Stork Feb 22 '21 at 01:54
  • This is because $$\displaystyle\int_{\infty}^{a}e^{-x^{2}}\ dx = \int_{-\infty}^{0}e^{-x^{2}}\ dx + \int_{0}^{a}e^{-x^{2}}\ dx = \frac{1}{2}\int_{-\infty}^{\infty}e^{-x^{2}}\ dx + \frac{\sqrt{\pi}}{2}\text{erf}(a) = \frac{\sqrt{\pi}}{2}+\frac{\sqrt{\pi}}{2}\text{erf}(a) = \frac{\sqrt{\pi}(\text{erf}(a)+1)}{2}$$. – Joshua Wang Feb 22 '21 at 01:56
  • Ok, so now how do I calculate the values of the error function? – Randall Feb 22 '21 at 16:54
  • You use a computer. It is a function... just like $\sin$, $\tan$, $\ln$, ... – David G. Stork Feb 22 '21 at 18:00