Solved – Derivation of variance of normal distribution with gamma function

gamma distributionnormal distributionself-studyvariance

So I'm reading about the derivation of the variance for normal distribution and I don't understand the following derivation with the use of gamma function.

enter image description here

So, if I continue this derivation the integral becomes

$$
2\int_{-\infty}^\infty ue^{-u}du\
$$

which is clearly not gamma function (in gamma function integral goes from 0 to infinity). How can I solve this integral?

Best Answer

Note that as $z^2=(-z)^2$ then $$\dfrac{\sigma^2}{\sqrt{2\pi}}\int_{-\infty}^\infty z^2e^{-z^2/2}dz=2\dfrac{\sigma^2}{\sqrt{2\pi}}\int_{0}^\infty z^2e^{-z^2/2}dz\,,$$ that is, as the mean is $z=0$, the function is symmetric around the $z=0$ axis, and the twice the $[0,\infty)$ area is the $(-\infty,\infty)$ area.

Now let $u=z^2/2$, then $du=zdz$ and $dz=\dfrac{du}{\sqrt{2u}}$ and

$$2\dfrac{\sigma^2}{\sqrt{2\pi}}\int_{0}^\infty z^2e^{-z^2/2}dz\rightarrow2\dfrac{\sigma^2}{\sqrt{\pi}}\int_{0}^\infty u^{1/2}e^{-u}du\,.$$

Finally, $\Gamma(z) = \int_0^\infty x^{z-1} e^{-x}\,dx$, thus our integral can be rewritten as $$2\dfrac{\sigma^2}{\sqrt{\pi}}\Gamma\left(\dfrac{3}{2}\right)=\sigma ^2\,\,.$$