Varaiance of Normal Distribution

Bazman
Messages
20
Reaction score
0
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:
Mathematics news on Phys.org
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.
 
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:
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)
 
Bazman said:
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
This is incorrect as you can see by differentiating your v. e^{-x^2/2}[/itex] does <b>not have</b> an elementary anti-derivative.<br /> <br /> <blockquote data-attributes="" data-quote="" data-source="" class="bbCodeBlock bbCodeBlock--expandable bbCodeBlock--quote js-expandWatch"> <div class="bbCodeBlock-content"> <div class="bbCodeBlock-expandContent js-expandContent "> hence<br /> <br /> INT(-infinfity to infinity)[x^2*e^(-x^2/2).dx]<br /> <br /> = x^2*-(e^(-x^2/2))/x|(inf -inf) - INT(inf - inf) (2*x)*-(e^(-x^2/2))/x<br /> <br /> = x*-(e^(-x^2/2))|(inf -inf) + INT|(inf -inf) (2)*(e^(-x^2/2))<br /> <br /> clearly first term equates to 0<br /> <br /> INT|(inf -inf) (2)*(e^(-x^2/2))<br /> =2*INT|(inf -inf) (e^(-x^2/2))<br /> <br /> I know that INT|(inf -inf) (e^(-x^2/2)) = SQRT(2pi).<br /> so I get final answer of 2*SQRT(2pi) but the correct answer is SQRT(2pi) </div> </div> </blockquote>
 
v`=e^(-x^2/2)
v =-(e^(-x^2/2))/x
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:
Back
Top