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

  • #1
BucketOfFish
60
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,263
621
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,568
774
Nice hint.
 
  • #4
BucketOfFish
60
1
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,263
621
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
BucketOfFish
60
1
Yep, I realized my terrible error and fixed it. Does it look alright now?
 
  • #7
Dick
Science Advisor
Homework Helper
26,263
621
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.
 

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

Replies
29
Views
818
  • Last Post
Replies
6
Views
481
Replies
7
Views
481
  • Last Post
Replies
5
Views
352
  • Last Post
Replies
8
Views
497
  • Last Post
Replies
3
Views
419
Replies
2
Views
446
  • Last Post
Replies
9
Views
312
  • Last Post
Replies
6
Views
477
Replies
0
Views
132
Top