# Homework Help: Integration Involving a Gaussian Function

1. Feb 9, 2010

### ríomhaire

This is a University quantum physics problem but I'm posting it in this section as what I'm having trouble with is the integration.

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

2. Relevant equations
Normalisation condition: $$\int ^{\infty}_{-\infty} \left| \psi(x)^2 \right| dx = 1$$

3. The attempt at a solution
So the integral that I'm having trouble with is
$$\int ^{\infty}_{-\infty} \left| x^{2}e^{- \frac{x^{2}}{a^{2}}} \right| dx$$

I tried integration by parts but I really don't know how to handle the $$e^{- \frac{x^{2}}{2a^{2}}}$$ part. After some initial confusion I realise this is a Gaussian and the integral of it from minus infinity to infinity is $$a \sqrt{\pi}$$ which would be fine if it wasn't being multiplied by $$x^{2}$$.

So integration by parts, setting $$u = x^{2}$$ and $$dv = e^{- \frac{x^{2}}{2a^{2}}} dx$$ doesn't work as then I have to integrate dv without limits, which gives the http://mathworld.wolfram.com/Erf.html" [Broken] which I only just heard of by putting this integral into Wolfram Alpha and don't know what to do with.

Putting $$u = e^{- \frac{x^{2}}{2a^{2}}}$$ is even worse as when I differentiate $$du = \frac{x}{a^{2}} e^{- \frac{x^{2}}{2a^{2}}} dx$$ which means I would have to do integration by parts on this new integral and I think you can see why that's not going to work.

Of course I can just get the answer but I want to know how to solve this problem myself. Do I have to work with the error function or is there a way of getting around it by an application of the limits (or some other trick) that I'm not seeing?

Last edited by a moderator: May 4, 2017
2. Feb 9, 2010

### awkward

Try integration by parts with

$$u = x$$

and

$$dv = x \exp(- \frac{x^2}{2a^2}}) \, dx$$

3. Feb 9, 2010

### Gunthi

How to calculate integrals in the form $$I(n)=\int_{0}^{\infty}x^ne^{-ax^2}dx$$

This first part is to demonstrate to reach the method, but you won't have to reproduce it, just the result.

Starting with $$I=\int_{-\infty}^{\infty}e^{\alpha^2}d\alpha$$ you can see that
$$I^2=\int_{-\infty}^{\infty}e^{x^2}dx\int_{-\infty}^{\infty}e^{y^2}dy$$, because x is a mute variable.

So you get $$\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-(x^2+y^2)}dxdy$$

Changing to polar coordinates one gets $$\int_{0}^{2\pi}\int_{0}^{\infty}e^-r^2}drd\theta = \sqrt{\pi}$$.

If that is true, then $$\int_{0}^{\infty}e^-u^2}du = \frac{\sqrt{\pi}}{2}$$ also holds.

Now, if we have something like $$\int_{0}^{\infty}e^{-ax^2}dx$$ we can change the variables to $$z^2=-ax^2, dz=\sqrt{a}dx, dx=\frac{dz}{\sqrt{a}}$$ and then calculate the integral in the form
$$\int_{0}^{\infty}e^{-z^2}\frac{dz}{\sqrt{a}}=\sqrt{\frac{\pi}{a}}\frac{1}{2}$$ wich in the form $I(n)$ is $I(0)$.

We need to calculate one more integral in order to have the complete set.

$$I(1)=\int_{0}^{\infty}xe^{-ax^2}, z^2=ax^2$$

$$\int_{0}^{\infty}\frac{z}{\sqrt{a}}e^{z^2}\frac{dz}{\sqrt{a}}=\frac{1}{a}\int_{0}^{\infty}ze^{-z^2} = \frac{1}{2a}$$

So, in order to calculate any integral $I(n)$ all you have to is calculate
$$-\frac{d}{da}I(n-2)$$ because $$\int_{0}^{\infty}-\frac{d}{da}x^{n-2}e^{-ax^2}=\int_{0}^{\infty}-(-x^2)x^{n-2}e^{-ax^2}dx$$.

It's obvious now that both integrals are the same because $$x^2x^{n-2}=x^n$$.

So to recap all that was done here, $$I(n)=-\frac{d}{da}I(n-2), I(0)=\sqrt{\frac{\pi}{a}}\frac{1}{2}, I(1)=\frac{1}{2a}$$ and this is all you need to solve any integral in $I(n)$ form.

If I wasn't clear in any of the steps just say so, I hope this helps anyone with this sort of problem.

4. Feb 9, 2010

### vela

Staff Emeritus
One way to do it is to note that when the gaussian has a mean of zero, E(x2) is equal to the variance:

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

Comparing this integral to yours, you can identify $a^2$ with $2\sigma^2$ so that $\sigma=a/\sqrt{2}$; therefore,

$$\int_{-\infty}^{\infty} x^2 e^{-\frac{x^2}{a^2}}dx = \sqrt{2\pi}(a/\sqrt{2})^3 = \frac{\sqrt{\pi}a^3}{2}$$

Another way to do it is to use this trick:

$$\int_{-\infty}^{\infty} x^2 e^{-\alpha{x^2}} dx = \int_{-\infty}^{\infty} \left( -\frac{d}{d\alpha}\right) e^{-\alpha{x^2}} dx=-\frac{d}{d\alpha} \int_{-\infty}^{\infty} e^{-\alpha{x^2}} dx=-\frac{d}{d\alpha}\left(\sqrt{\frac{\pi}{\alpha}\right)= \frac{1}{2}\sqrt{\frac{\pi}{\alpha^3}$$

Setting $\alpha=1/a^2$ gives

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