# Varaiance of Normal Distribution

1. Nov 1, 2006

### Bazman

When solving for the variance of the normal distribution one needs to evaluate the following integral:

INT(-infinfity to infinity)[x^2*e^(-x^2/2).dx]

I proceed using integration by parts:

[-x.e^(-x^2/2)|(infin to -infin) + INT(-infin to infin) 2*e(-x^2/2)dx]

However apparently correct answer is:

[-x.e^(-x^2/2)|(infin to -infin) + INT(-infin to infin) e(-x^2/2)dx]

but I don't see how the 2 cancels?

Last edited: Nov 1, 2006
2. Nov 1, 2006

### mathman

The integral of xe^(-x^2)/2) is xe^(-x^2)/2), while the derivative of x is 1. I don't see where you got the 2 from.

3. Nov 1, 2006

### Bazman

Hi, thanks:

First I'll take you through what I did before I follow your solution through fully:

When I tried to solve the following integral:

INT(-infinfity to infinity)[x^2*e^(-x^2/2).dx]

To solve using integration by parts: INT uv = uv - INT u'v
I take u=x^2
u=2*x

v=e^(-x^2/2)
v =-(e^(-x^2/2))/x

hence

INT(-infinfity to infinity)[x^2*e^(-x^2/2).dx]

= x^2*-(e^(-x^2/2))/x|(inf -inf) - INT(inf - inf) (2*x)*-(e^(-x^2/2))/x

= x*-(e^(-x^2/2))|(inf -inf) + INT|(inf -inf) (2)*(e^(-x^2/2))

clearly first term equates to 0

INT|(inf -inf) (2)*(e^(-x^2/2))
=2*INT|(inf -inf) (e^(-x^2/2))

I know that INT|(inf -inf) (e^(-x^2/2)) = SQRT(2pi).
so I get final answer of 2*SQRT(2pi) but the correct answer is SQRT(2pi)

It seems from the above you wish to take:

u=x
u=1

v=x.e^(-x^2/2)
v =-e^(-x^2/2)

correct?

In which case:

INT(-infinfity to infinity)[x^2*e^(-x^2/2).dx]

= x*-(e^(-x^2/2))|(inf -inf) - INT(inf - inf) (1)*-(e^(-x^2/2))

= x*-(e^(-x^2/2))|(inf -inf) + INT|(inf -inf) (1)*(e^(-x^2/2))

Which seems to give the correct answer of SQRT(2pi)

However I cannot find any error in my working above if you follow it through the answer still seems to be 2*SQRT(2pi)?

Last edited: Nov 2, 2006
4. Nov 2, 2006

5. Nov 2, 2006

### Bazman

Hi Quasar,

Thanks for that it confirms that using u=x and dv/dx= x*exp(-x^2/2)dx in the integration by parts it gives the correct answer. Which I agree with.

However my remaining question is that how come when I work through using u=x^2 and dv/dx= exp(-x^2/2)dx in the integration by parts the calculation out by a factor of 2?

I just would like to know in case I face similar problems in future. To me it seems more "natural" to choose u=x^2 and I guess it must yield the same answer if worked through correctly. My question is where am I going worng at present?

I take u=x^2
u=2*x

v`=e^(-x^2/2)
v =-(e^(-x^2/2))/x

hence

INT(-infinfity to infinity)[x^2*e^(-x^2/2).dx]

= x^2*-(e^(-x^2/2))/x|(inf -inf) - INT(inf - inf) (2*x)*-(e^(-x^2/2))/x

= x*-(e^(-x^2/2))|(inf -inf) + INT|(inf -inf) (2)*(e^(-x^2/2))

clearly first term equates to 0

INT|(inf -inf) (2)*(e^(-x^2/2))
=2*INT|(inf -inf) (e^(-x^2/2))

I know that INT|(inf -inf) (e^(-x^2/2)) = SQRT(2pi).
so I get final answer of 2*SQRT(2pi) but the correct answer is SQRT(2pi)

6. Nov 2, 2006

### HallsofIvy

Staff Emeritus
This is incorrect as you can see by differentiating your v. [tex]e^{-x^2/2}[/itex] does not have an elementary anti-derivative.

7. Nov 2, 2006

### mathman

wrong (take the derivative of your v and you won't get your v')!
you should use
v'=xe^(-x^2/2)
v=-e^(-x^2/2)

Last edited: Nov 2, 2006
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook