# Gaussian distribution

Reference: Griffiths, David J. (2005), Introduction to Quantum Mechanics, 2nd Edition; Pearson Education – Problem 1.3.

Probably the most common continuous probability density is the gaussian distribution, specified by

$\displaystyle \rho\left(x\right)=Ae^{-\lambda\left(x-a\right)^{2}} \ \ \ \ \ (1)$

First, we need to normalize the distribution by finding ${A}$. That is, we must have

$\displaystyle A\int_{-\infty}^{\infty}e^{-\lambda\left(x-a\right)^{2}}dx=1 \ \ \ \ \ (2)$

The gaussian integral is very common, and the result is that

 $\displaystyle \int_{-\infty}^{\infty}e^{-\lambda\left(x-a\right)^{2}}dx$ $\displaystyle =$ $\displaystyle \sqrt{\frac{\pi}{\lambda}}\ \ \ \ \ (3)$ $\displaystyle A$ $\displaystyle =$ $\displaystyle \sqrt{\frac{\lambda}{\pi}} \ \ \ \ \ (4)$

Although there is no closed form indefinite integral, the definite integral can be found by a cute trick.

 $\displaystyle \left[\int_{-\infty}^{\infty}e^{-x^{2}}dx\right]^{2}$ $\displaystyle =$ $\displaystyle \int_{-\infty}^{\infty}e^{-x^{2}}dx\int_{-\infty}^{\infty}e^{-y^{2}}dy\ \ \ \ \ (5)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-x^{2}-y^{2}}dx\;dy \ \ \ \ \ (6)$

We can now transform to polar coordinates using

 $\displaystyle r^{2}$ $\displaystyle =$ $\displaystyle x^{2}+y^{2}\ \ \ \ \ (7)$ $\displaystyle dx\;dy$ $\displaystyle =$ $\displaystyle r\;dr\;d\theta\ \ \ \ \ (8)$ $\displaystyle \int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-x^{2}-y^{2}}dx\;dy$ $\displaystyle =$ $\displaystyle \int_{0}^{\infty}\int_{0}^{2\pi}re^{-r^{2}}d\theta\;dr\ \ \ \ \ (9)$ $\displaystyle$ $\displaystyle =$ $\displaystyle 2\pi\int_{0}^{\infty}re^{-r^{2}}dr\ \ \ \ \ (10)$ $\displaystyle$ $\displaystyle =$ $\displaystyle -\pi\left.e^{-r^{2}}\right|_{0}^{\infty}\ \ \ \ \ (11)$ $\displaystyle$ $\displaystyle =$ $\displaystyle \pi \ \ \ \ \ (12)$

Therefore

$\displaystyle \int_{-\infty}^{\infty}e^{-x^{2}}dx=\sqrt{\pi} \ \ \ \ \ (13)$

Using Maple (or integration by parts) we can work out the average and variance.

 $\displaystyle \left\langle x\right\rangle$ $\displaystyle =$ $\displaystyle \sqrt{\frac{\lambda}{\pi}}\int_{-\infty}^{\infty}xe^{-\lambda\left(x-a\right)^{2}}dx=a\ \ \ \ \ (14)$ $\displaystyle \left\langle x^{2}\right\rangle$ $\displaystyle =$ $\displaystyle \sqrt{\frac{\lambda}{\pi}}\int_{-\infty}^{\infty}x^{2}e^{-\lambda\left(x-a\right)^{2}}dx=\frac{1}{2\lambda}+a^{2}\ \ \ \ \ (15)$ $\displaystyle \sigma^{2}$ $\displaystyle =$ $\displaystyle \left\langle x^{2}\right\rangle -\left\langle x\right\rangle ^{2}=\frac{1}{2\lambda} \ \ \ \ \ (16)$

The distribution has the standard bell shape. Here’s a plot for ${\lambda=2}$ and ${a=1}$:

## 15 thoughts on “Gaussian distribution”

1. Bùi Việt Anh

I can’t understand how we use integration by parts to find the result. Could you explain me just a bit details, please?

1. gwrowe Post author

The integration by parts applies to ${\left\langle x^{2}\right\rangle }$. For ${\left\langle x\right\rangle }$, we can use the substitution ${u=x-a}$ to get

 $\displaystyle \int_{-\infty}^{\infty}xe^{-\lambda\left(x-a\right)^{2}}dx$ $\displaystyle =$ $\displaystyle \int_{-\infty}^{\infty}\left(u+a\right)e^{-\lambda u^{2}}du$ $\displaystyle$ $\displaystyle =$ $\displaystyle a\int_{-\infty}^{\infty}e^{-\lambda u^{2}}du$

which can be done using (13). The integral ${\int_{-\infty}^{\infty}ue^{-\lambda u^{2}}du=0}$ because the integrand is an odd function.

For (15), use the same substitution to get

 $\displaystyle \int_{-\infty}^{\infty}x^{2}e^{-\lambda\left(x-a\right)^{2}}dx$ $\displaystyle =$ $\displaystyle \int_{-\infty}^{\infty}\left(u+a\right)^{2}e^{-\lambda u^{2}}du$ $\displaystyle$ $\displaystyle =$ $\displaystyle \int_{-\infty}^{\infty}\left(u^{2}+2au+a^{2}\right)e^{-\lambda u^{2}}du$ $\displaystyle$ $\displaystyle =$ $\displaystyle \int_{-\infty}^{\infty}\left(u^{2}+a^{2}\right)e^{-\lambda u^{2}}du$

The integral ${\int_{-\infty}^{\infty}u^{2}e^{-\lambda u^{2}}du}$ can be done by parts

 $\displaystyle \int_{-\infty}^{\infty}u^{2}e^{-\lambda u^{2}}du$ $\displaystyle =$ $\displaystyle -\frac{1}{2\lambda}\left.ue^{-\lambda u^{2}}\right|_{-\infty}^{\infty}+\frac{1}{2\lambda}\int_{-\infty}^{\infty}e^{-\lambda u^{2}}du$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{1}{2\lambda}\int_{-\infty}^{\infty}e^{-\lambda u^{2}}du$

which again can be done using (13).

1. Moose

I don’t know why I keep getting 1/lamda instead of 1/(2*lamda) for the constant in front of the last integral above. I get a factor of 2 that cancels, since I let u’=u^2, so du’=2u du, everything else matches perfect though. Hmm. I don’t know what I must be missing. Please excuse my oversight.

1. Cory

I am having the same error as Moose. I used that same substitution, but still don’t see where my error is. Could someone please make a suggestion as to what to look at to resolve the issue?

2. Cory

Never mind, I figured out that the substitution I chose provides a different answer. I am not sure why that is the case though. I get the author’s solution if I choose u’=u, but I get Moose’s extra factor of 2 with Moose’s substitution of u’=u^2.

3. gwrowe Post author

If you’re referring to the integral ${\int_{-\infty}^{\infty}u^{2}e^{-\lambda u^{2}}du}$ I don’t see why you need a substitution at all. As I say, you can do it by parts

 $\displaystyle \int_{-\infty}^{\infty}u^{2}e^{-\lambda u^{2}}du$ $\displaystyle =$ $\displaystyle \int_{-\infty}^{\infty}\left(u\right)\left(ue^{-\lambda u^{2}}\right)du=$ $\displaystyle$ $\displaystyle$ $\displaystyle -\frac{1}{2\lambda}\left.ue^{-\lambda u^{2}}\right|_{-\infty}^{\infty}+\frac{1}{2\lambda}\int_{-\infty}^{\infty}e^{-\lambda u^{2}}du$ $\displaystyle$ $\displaystyle =$ $\displaystyle \frac{1}{2\lambda}\int_{-\infty}^{\infty}e^{-\lambda u^{2}}du$

which again can be done using (13).

4. Cory

Thanks for the quick response. I was incorrect before when I said substituting. I was using integration by parts both times, but I think I understand now why one of the arrangements that I tried does not work mathematically. Thank you again for posting these. It has helped immensely with my learning of the material.

2. ramona

I’m curious about (5), i accept it on a gut level, and i could explain a guess at why it makes sense–or why it seems to make sense to me… but i don’t feel like my “feeling” of it is really good enough to go on,in saying i actually “understand” it…
might you give some explanation why it works?

3. Joey Contreras

I was working on this very problem earlier today, but I noticed the problem says “look up any integrals you need.”

One of my buddies was telling me that there are specific integrals in the back of the Griffith’s book that are can simply be looked up, but that for anything beyond those integrals it’s customary to simplify one’s integral down to a form where that table in the back of the book can be applied.

Do you know if he’s right or if there are certain integrals which are necessary to solve problems like these? Part of my confusion with this problem is that I’m not sure when I have to simplify and when I can just look up what the integral evaluates out to.

Thanks.

1. gwrowe Post author

There aren’t any integral tables in the two books by Griffiths that I have (Electrodynamics and Quantum Mechanics) so you’d just have to look up the integrals in other books or on the web. Integrals can be tricky, which is why I use software (Maple) to do a lot of them. If you have to do them by hand, I’d try a few basic techniques like integration by parts, trig substitutions or other algebraic substitutions. If none of those works, you’ll just have to look them up.

1. gwrowe Post author

See the comment from 12 March 2016. ${f\left(x\right)=xe^{-\lambda\left(x-a\right)^{2}}}$ is not an odd function (${f\left(-x\right)\ne-f\left(x\right)}$) so it’s not anti-symmetric about ${x=0}$ so we wouldn’t expect its integral to be zero.