# Integral x^2*e^(-x^2) running into error function

1. Sep 7, 2014

### oddjobmj

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

I am trying to find the expectation value of <x2> of the following function:

ψ[(x,t)]=($\frac{2am}{πh}$)[1/4]e[-a($\frac{mx^2}{h}$+it)], where h is hbar and the integral is from -∞ to ∞

2. Relevant equations

<x2>=$\int$x^2|ψ[(x,t)]|2dx

3. The attempt at a solution

The resulting integral:

$\sqrt{\frac{c}{π}}\int$x2e[-cx^2]dx where c=$\frac{2am}{h}$

I am having a very hard time solving this! I have a solution to the problem but it uses the gamma function which I'm not familiar with: $\Gamma$(n)

Using mathematica (and other similar software) yields error functions (erf and erfi) which I don't know how to resolve.

Using a u-substitution I can simplify the integral to $\int$$\sqrt{u}$e-udu but that's also not solvable given methods I currently know.

Any suggestions? Thanks!

Last edited: Sep 7, 2014
2. Sep 7, 2014

### Ray Vickson

Step 1: simplify the notation during the work. So, you want to compute
$$F(c) = \int_{-\infty}^{\infty} x^2 e^{-c x^2} \, dx$$
for some constant $c$; the fact that $c = 2am/h$ in this case is not important at the start. Once you have your final answer in terms of $c$ you can restore the actual value at that time. Of course, you also have a constant $\sqrt{2am/\pi h}$ in front of the integral but it is a waste of time and energy to keep writing it during your work; just put it in at the end.

So, you can get $F(c)$ using integration by parts---no error function needed---or you can use a standard trick to get it from
$$I(c) \equiv \int_{-\infty}^{\infty} e^{-c x^2} \, dx$$
which, itself, is doable in terms of a standard Gaussian integral.
Hint: how would you compute the derivative $I'(c)$?

3. Sep 7, 2014

### vela

Staff Emeritus
One technique is to use
$$\int_0^\infty x^2e^{-\alpha x^2}\,dx = -\int_0^\infty \frac{\partial}{\partial \alpha} e^{-\alpha x^2}\,dx = -\frac{\partial}{\partial \alpha} \int_0^\infty e^{-\alpha x^2}\,dx.$$ The last integral you should know how to do. If you don't, you should learn how to do it now.

4. Sep 7, 2014

### SteamKing

Staff Emeritus
Maybe it's time to correct this gap in your knowledge of functions:

http://en.wikipedia.org/wiki/Gamma_function

5. Sep 7, 2014

### oddjobmj

If I got it to e^(-cx^2) I could handle that. I did recently learn how to do that integral. But I can't seem to get there from integration by parts. If I try to use by parts to get rid of the x^2 term:

u=x^2

du=2xdx

dv=e[-cx^2]dx

v=$\sqrt{\frac{π}{c}}$

I guess v would be the case if I take the integral and apply the limits but I don't know the general form of that integral. Is that what I need to find? If I can continue assuming v is correct as shown above then I get the vu-(-2)∫x*vdx, where v is just that constant. By symmetry this is 0 and we're left with vu which is wrong. I must be making a mistake somewhere.

Also, I'm sorry, I should have simplified the notation before typing it out so it was easier for you to read it. Thanks for the tip!

Vela, that's interesting, thank you. I am happy to learn that method but I don't know what to look for. Is there a name for that technique?

SteamKing, thanks for the suggestion. I did look it up and realized that I wouldn't have used that if I didn't see it in the solution. I am happy to learn (what I am here to do) but would you suggest that is the best way to solve this problem?

Thanks!

Edit: Vela's method worked. I believe that's what you were hinting at also, Ray. Thanks again!

I am still interested in knowing if the gamma function is a comparable way to solve the problem.

Last edited: Sep 7, 2014
6. Sep 7, 2014

### vela

Staff Emeritus
Try $u=x$ and $dv=x e^{-cx^2}\,dx$.

7. Sep 7, 2014

### porcupine137

The differentiating under the integral sign is a good trick to pick up. For some reason it seems to never be taught in calc classes.

And the Gaussian intergrals come up ALL the time in physics.

It's interesting to think a little bit and figure out how to solve Gauss's Probability Intergral. Books seem to just give the answer directly so one night I decided to figure out how you could get it and after thinking a little I did this:

You have $$I=\int_0^\infty e^{-a x^2}\,dx=\frac{1}{2}\sqrt{\frac{\pi}{a}}.$$

Now imagine you took $$I^2$$ so we have $$I^2=\int_0^\infty e^{-a x^2}\,dx\int_0^\infty e^{-a y^2}\,dy=\int_0^\infty\int_0^\infty e^{-a (x^2 + y^2)}\,dx dy.$$

Now this is integrating e^{-etc.} over the surface of the Cartesian coordinate plane (although we are keeping x and y to positive values only so each coord is only intergrated over half) but how about we switch to polar coordinates instead?

And you can figure that from a right triangle with x^2 and y^2 edges and r^2 hypotenuse so we have our x^2 + y^2 term going to r^2.

And then imagine circles going around centered on the origin and the space between two going radially out is dr and around the circle you have dθ. To go all the way around the circle is 2 pi rad but draw a slice and you see that as r increases your dθ will need to scale as the circumferences of each circles increases, unit radius is 2pi and circumference is 2pi r and dθ scales up linearly with r so use r dθ.

Anyway we run r from 0 to ∞ and θ from 0 to 2 pi so we cover the whole plane.

so now we have $$=\int_0^\infty\int_0^{2 \pi} e^{- a r^2} r d\theta dr.$$
Then we get $$=\int_0^\infty e^{- a r^2} 2 \pi r dr = -\frac{\pi}{a} e^{-a r^2}$$ evaluated at ∞ and 0 so $$=0 + \frac{\pi}{a} = I^2$$ but don't forget that we covered the entire plane here but in the original we had cut each variable to only half plane so don't forget to toss in the $$\frac{1}{2} * \frac{1}{2} = \frac{1}{4}$$ factor so we get $$I^2 = \frac{\pi}{4 a}$$ so $$I = \frac{1}{2}\sqrt{\frac{\pi}{a}}.$$

Last edited: Sep 7, 2014
8. Sep 7, 2014

### oddjobmj

I came across two videos that went over the solution to this integral as I was trying to solve the problem. Neither of them explained it in such an intuitive way. This makes sense, thank you!