# How to solve an integral of a gaussian distribution

1. Aug 19, 2009

### DragonPetter

1. The problem statement, all variables and given/known data
integrate

$$\int_{-\infty}^\infty\! e ^{(x-a)^{2}}\, dx$$

2. Relevant equations

$$\int \! e^u\, du = e^u + C$$
3. The attempt at a solution
i just know that du = 2(x-a), but there is no x to make use of substitution, so I am confused on how to go about solving this since I cannot use substitution

2. Aug 19, 2009

### foxjwill

EDIT: I'm assuming you mean
$$\int_{-\infty}^\infty\! e ^{-(x-a)^{2}}\, dx$$​
since what you wrote doesn't converge.

Anyway, this is a very tricky integral that requires a trick. By far the best way starts as follows:

First, letting I denote the original integral (after replacing x-a with x), notice that
$$I = 2\int_{0}^\infty\! e ^{-x^{2}}\, dx$$​
by symmetry. Next comes the first trick:
$$I^2 = 4 \int_{0}^\infty\! e ^{-x^{2}}\, dx \int_{0}^\infty\! e ^{-x^{2}}\, dx = 4 \int_{0}^\infty\! e ^{-x^{2}}\, dx \int_{0}^\infty\! e ^{-y^{2}}\, dy$$​
since the x in the integral is just a dummy variable. But then
$$I^2 = 4\int_0^\infty\int_0^\infty\! e ^{-(x^{2}+y^{2})}\,dx\,dy.$$​

The traditional method is to at this point switch to polar coordinates, but a better way (I think) involves the substitution y=xu (so dy=xdu):
$$I^2 = 4\int_0^\infty\int_0^\infty\! e^{-x^2(1+u^2)}x\,dx\,du.$$​
From here, I think you should be able to figure this out on your own.

3. Aug 20, 2009

### DragonPetter

hmm my text book is certainly not nice as it leaves this as an exercise with just telling me "(look up any integrals you need)"
and yes, i forgot to include the - sign for the exponential

4. Aug 20, 2009

### foxjwill

That's wierd.

5. Aug 21, 2009

On a wild hunch: this seems to be a traditional type problem in a first mathematical stat or calc-based probability course. If you've seen this (normal density integrating to 1)

$$\int_{-\infty}^\infty \frac 1 {\sqrt{2\pi} \sigma} e^{-\frac{(x-\mu)^2}{\sigma^2}} \, dx = 1$$

the "trick" is to identify your integrand as part of some normal density and go from there.

of course, the item i have posted could be what the hint "look up any integrals needed" refers to as well.

6. Aug 21, 2009

### foxjwill

You mean
$$\int_{-\infty}^\infty \frac 1 {\sqrt{2\pi} \sigma} e^{-\frac{(x-\mu)^2}{2\sigma^2}} \, dx = 1$$​
of course

7. Aug 22, 2009