# Thread: Integration e^-x^2

1. ## Integration e^-x^2

How would you integrate? I'm thinking maybe by parts.

$\int{e^{-x^2}}dx$

2. This integral has no elementary anti-derivative. However, there's a dirty trick you can use, if your integral has the limits from $-\infty$ to $\infty$: square the integral, and switch to polar coordinates.

3. $\int e^{-x^2}dx = \dfrac{\sqrt{\pi}}{2} \text{erf}(x) + c$

5. Thanks for that clarification. See, I was just wandering whether you could determine if the integral converges or diverges by integrating it?

6. Mr fantastic previously showed you how to recognise this as a transformation of a very common PDF. All PDFs converge to 1 when integrated.

7. Originally Posted by SpringFan25
Mr fantastic previously showed you how to recognise this as a transformation of a very common PDF. All PDFs converge to 1 when integrated.
Sorry, didn't really notice this. This is for my calculus course, and has nothing to do with probability.

8. The 'error function' ...

$\displaystyle erf (x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^{2}}\ dt$ (1)

... and the 'complementary error functions' ...

$erfc (x) = 1 - erf (x)$ (2)

... play a central role in comminication and informatic technologies. In most cases (2) is more important than (1) because it supplies a direct indication of the 'error rate' of a process. Sometime is required an 'error rate' not greater that $10^{-12} - 10^{-15}$ and that explains the criticity of the accurate computation of the erf (x) for x 'large enough'. The most 'natural' approach to the computation of erf(x) is based on the Taylor expansion...

$\displaystyle e^{-t^{2}} = \sum_{n=0}^{\infty} (-1)^{n} \frac{t^{2n}}{n!}$ (3)

... from which, integrating 'term by term', You derive...

$\displaystyle erf(x) = \frac{2}{\sqrt{\pi}} \sum_{n=0}^{\infty} (-1)^{n} \frac{x^{2n+1}}{(2n+1)\ n!}$ (4)

At first it seems that we can be 'optimist' because the (4) is an 'alternate sigh series' and the absolute value of the error is less that the absolute value of the last term 'discharged'. Example: how many terms You need to have four correct digits?... Because is...

$\displaystyle |a_{n}| = \frac{2}{\sqrt{\pi}} \frac{x^{2n+1}}{(2n+1)\ n!}$ (5)

... is $|a_{n}|< 10^{-4}$ if...

$\displaystyle x^{2n+1} < 10^{-4}\ \frac{\sqrt{\pi}}{2}\ (2n+1)\ n!$ (6)

If x=1 You need 8 terms to meet the result. For x=2 the terms are 15 and for x=2.5 the terms are 20. For larger value of x the number of terms that have to be added produces a 'rounding error' that is comparable or superior to the desired accuracy ... it is evident that at this point a more efficient approach has to be found ...

Kind regards

$\chi$ $\sigma$

9. Originally Posted by acevipa
Thanks for that clarification. See, I was just wandering whether you could determine if the integral converges or diverges by integrating it?
There is a fairly standard way of finding $\int_{-\infty}^\infty e^{-x^2}dx$ or $\int_0^\infty e^{-x^2}dx$

Let $A= \int_0^\infty e^{-x^2} dx$. Then it is also true that $A= \int_0^\infty e^{-y^2} dy$ since that is only a change in the "dummy" variable.

Then, by Fubini's theorem, $A^2= \int_0^\infty e^{-x^2}dx\int_0^\infty e^{-y^2} dy$ $= \int_0^\infty\int_0^\infty e^{-x^2} e^{-y^2}dy dx= \int_0^\infty \int_0^\infty e^{-(x^2+ y^2)}dydx$

That integral is over the first quadrant. If we change to polar coordinates, r runs from 0 to $\infty$ while $\theta$ runs from 0 to $\pi/2$. Since $x^2+ y^2= r^2$ and $dy dx= r drd\theta$, we have
$\int_0^{\pi/2}\int_0^\infty e^{-r^2} rdr d\theta= \frac{\pi}{2}\int_0^\infty e^{-r^2} rdr$

With that additional "r" in the integrand, we can let $u= r^2$ so that $du= 2r dr$ and that integral becomes
$A^2= \frac{\pi}{2}\int_0^\infty e^{-u}du= \frac{\pi}{2}(-e^{-u})_0^\infty= \frac{\pi}{2}$.
Thus, $\int_0^\infty e^{-x^2}dx= A= \sqrt{\pi/2}$ and, because $e^{(-x)^2}= e^{-x^2}$, $\int_{-\infty}\infty e^{-x^2}dx= 2\sqrt{\pi/2}= \sqrt{2\pi}$.

The fact that the integral exist on the entire real line implies that it exists on any subinterval.

10. Originally Posted by acevipa
Sorry, didn't really notice this. This is for my calculus course, and has nothing to do with probability.
One thing you need to learn and understand is that mathematical topics are not islands that exist independently of each other. There are rich links between topics (sometimes unexpectedly). Failure to understand this has been the downfall of many a student (who, for example, think that s/he can forget all that they learn in a previous year because they are starting a new topic).