- #1
Avinto
- 3
- 0
Homework Statement
I am trying to compute an integral, as part of the expected value formula (using a Gaussian PDF)
[tex]\int_{-∞}^{∞} (x)^2 p(x) dx [/tex]
Where p(x) is the Gaussian probability density function:
[tex]\frac{1}{\sigma \sqrt(2 \pi)} \exp(\frac{-x^2}{2 \sigma^2})[/tex]
My aim after this is to be able to compute for all even x^n in the above formula. For all odd x^n, the positive and negative componets cancel out, with an computation of zero for all odd functions.
Homework Equations
Wikipedia lists two equations that relate to this:
[1]https://en.wikipedia.org/wiki/List_of_integrals_of_Gaussian_functions
[1]
[tex]\int_{-∞}^{∞} (x)^2 \phi(x)^n dx = \frac{1}{\sqrt(n^3 (2 \pi)^{n-1})} [/tex]
and
[2]https://en.wikipedia.org/wiki/List_of_integrals_of_exponential_functions
[2]
The range here is zero to infinity, however as this function is even, the result for minus infinity to infinity should be twice what the below computes.
[tex]\int_{0}^{∞} (x)^n \exp(-\alpha x^2) dx= \frac{(2 k -1)!}{2^{k+1} \alpha^k} \sqrt(\frac{\pi}{\alpha})[/tex]
Where
[tex]n=2 k, k integer, \alpha > 0[/tex]
The Attempt at a Solution
Using [1], I can compute a answer equalling 1, which is apparently the right answer. However when using [2] (where k=1), I compute a different anwser:
Compute:
Let [tex]\alpha = \frac{1}{2 \sigma^2}[/tex]
and
[tex]k=1[/tex]
then:
[tex]\int_{0}^{∞} (x)^2 \exp(-\alpha x^2) dx = \frac{(2 k -1)!}{2^{k+1} \alpha^k} \sqrt(\frac{\pi}{\alpha})[/tex]
[tex]=\frac{1!}{4 \alpha}\sqrt(\frac{\pi}{\alpha})[/tex]
[tex]=\frac{\sigma^2}{2}\sqrt(2 \sigma^2 \pi)[/tex]
[tex]=\frac{\sigma^2}{2} \sigma \sqrt(2 \pi)[/tex]
[tex]=\frac{\sigma^3 \sqrt(2 \pi)}{2} [/tex]
Now, this is where I think I messed up. I previously removed
[tex]\frac{1}{\sigma \sqrt(2 \pi)}[/tex]
from inside the integral, and attempted to multiply it by the obtained result (and then doubled everything, as it is an even function)
[tex]2 \frac{1}{\sigma \sqrt(2 \pi)} \frac{\sigma^3 \sqrt(2 \pi)}{2} [/tex]
Then by cancelling:
[tex]=\sigma [/tex]
I'm thinking this is because I took part of the PDF out of the integral, and then changed the limits. However, I'm not sure how to go about working this out while leaving it in there.
I will keep browsing around for a solution to this problem (and the more general x^n), and would really appreciate any hints on this.
Thanks.