• Support PF! Buy your school textbooks, materials and every day products Here!

How do I evaluate <x^2> for a Gaussian function?

  • #1

Homework Statement



For some Gaussian distribution, let's say [itex]e^{-x^2}[/itex] times a constant, I want to find the expectation value of [itex]x^2[/itex]. In other words, I want to evaluate:

[tex]\int^{\infty}_{-\infty} e^{-x^2}x^2dx[/tex]

Homework Equations



Integration by parts:

[tex]\int udv = uv - \int vdu[/tex]

The Attempt at a Solution



I tried a few things actually, but none of them got anywhere. One of the routes I attempted was u-substitution followed by integration by parts. First, since the function is even, you set it equal to:

[tex]2\int^{\infty}_{0} e^{-x^2}x^2dx[/tex]

Letting [itex]a = x^2, da = 2xdx[/itex], we get:

[tex]\int^{\infty}_{0} e^{-a}\sqrt{a}da[/tex]

Then, letting [itex]u = \sqrt{a}, dv = e^{-a}da, du = \frac{1}{2\sqrt{a}}da, v = -e^{-a}[/itex]:

[tex]\int e^{-a}\sqrt{a}da = -\sqrt{a}e^{-a} + \int e^{-a}\frac{1}{2\sqrt{a}}da[/tex]

And here I get stuck. Anybody have hints?
 

Answers and Replies

  • #2
Dick
Science Advisor
Homework Helper
26,258
618
Think about [itex]\int^{\infty}_{-\infty} e^{- a x^2} dx[/itex]. You can work that out, right? Now what is d/da of that when a=1?
 
  • #3
LCKurtz
Science Advisor
Homework Helper
Insights Author
Gold Member
9,508
730
Nice hint.
 
  • #4
Ok, so I think I've got it. Basically, you take:

[tex]\int^{\infty}_{-\infty} -\frac{de^{-ax^2}}{da}dx[/tex]

Then since x and a are independent of each other, you can bring the d/da outside the integral:

[tex]\frac{d}{da}\int^{-\infty}_{\infty} e^{-ax^2}dx[/tex]

Then you do that integral to get [itex]-\sqrt{\pi/a}[/itex], and after taking the derivative with respect to a, you get [itex]\frac{\sqrt{\pi}a^{-3/2}}{2}[/itex]. Plugging in a=1, you end up with [itex]\frac{\sqrt{\pi}}{2}[/itex] for your final answer.

I didn't offend any mathematicians with egregiously bad calculus, did I?
 
Last edited:
  • #5
Dick
Science Advisor
Homework Helper
26,258
618
Maybe. But even physicists would be offended because the sign is obviously wrong. x^2*exp(-x^2) is a positive function. How can its integral be negative?
 
  • #6
Yep, I realized my terrible error and fixed it. Does it look alright now?
 
  • #7
Dick
Science Advisor
Homework Helper
26,258
618
The answer is right. I'm not sure you've put the sign correction in the right place everywhere. But I'm sure you can fix it.
 

Related Threads for: How do I evaluate <x^2> for a Gaussian function?

Replies
5
Views
1K
Replies
14
Views
3K
  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
10
Views
693
Replies
3
Views
2K
  • Last Post
Replies
4
Views
4K
  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
3
Views
4K
Top