Calculating variance for normal distribution

improper-integralsnormal distributionprobabilityprobability distributionsprobability theory

A random variable is said to be normally distributed with parameters $\mu$ and $\sigma^2$, if its density function is given by $$f(x)=\frac{1}{\sqrt{2\pi}\sigma}e^{\frac{-(x-\mu)^2}{2\sigma^2}}\;\;\;-\infty<x<\infty$$.

Now I need find the variance of the normal distribution i.e. the integral
$$\int_{-\infty}^{\infty}(x-\mu)^2f(x)dx$$.

Now to prove we use the fact that $$\int_{-\infty}^{\infty}e^{-x^2}=\sqrt\pi.$$ I have proved the above identity using multivariable calculus, double integration, and polar coordinates.

So now I consider $\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}\sigma}(x-\mu)^2e^{\frac{-(x-\mu)^2}{2\sigma^2}}dx$=$\lim_{R\longrightarrow \infty}\frac{1}{\sqrt{2\pi}\sigma}\int_{-R}^{R}(x-\mu)^2e^{\frac{-(x-\mu)^2}{2\sigma^2}}dx $. Now I use substitution and take $y=\frac{x-\mu}{\sigma}$. So I get $\lim_{R\longrightarrow \infty}\frac{\sigma^2}{\sqrt{2\pi}}\int_{\frac{-R-\mu}{\sigma}}^{\frac{R-\mu}{\sigma}}y^2e^{\frac{-y^2}{2}}dy $.
Now I use integration by parts and get
$$\lim_{R\longrightarrow \infty}\frac{\sigma^2}{\sqrt{2\pi}}\left\{-e^{-\frac{y^2}{2}}y\Biggr|_{\frac{-R-\mu}{\sigma}}^{\frac{R-\mu}{\sigma}} +\int_{\frac{-R-\mu}{\sigma}}^{\frac{R-\mu}{\sigma}}e^{\frac{-y^2}{2}}dy\right\} .$$

My question is how do I proceed now and use that $\int_{-\infty}^{\infty}e^{-x^2}=\sqrt\pi?$. My main issue is that I want to compute the variance using the definition of improper integral i.e. the infinite limit of definite integrals.

Best Answer

For any real $y$ we have $$|e^{-\frac{y^2}{2}}y|=\frac{|y|}{e^{\frac{y^2}{2}}}\le \frac{|y|}{1+\frac{y^2}{2}},$$ and the latter value tends to zero when $|y|$ tends to the infinity.

For any real $A<B$ we have $\int_{B}^{A} e^{\frac{-y^2}{2}}dy=\int_{B/\sqrt{2}}^{A/\sqrt{2}}\sqrt{2} e^{-x^2}dx$, and the later value tends to $\sqrt{2} \int_{-\infty}^{\infty} e^{-x^2}dx=\sqrt{2\pi}$, when $A$ tends to $-\infty$ and $B$ tends to $+\infty$.

Taking into account that $\frac{1}{\sqrt{2\pi}\sigma}e^{\frac{-(x-\mu)^2}{2\sigma^2}}$ is a density function, we assume that $\sigma>0$.

The above follows that $$\lim_{R\longrightarrow +\infty}\frac{\sigma^2}{\sqrt{2\pi}}\left(-e^{-\frac{y^2}{2}}y\Biggr|_{\frac{-R-\mu}{\sigma}}^{\frac{R-\mu}{\sigma}} +\int_{\frac{-R-\mu}{\sigma}}^{\frac{R-\mu}{\sigma}}e^{\frac{-y^2}{2}}dy\right)=\frac{\sigma^2}{\sqrt{2\pi}}\cdot \sqrt{2\pi}=\sigma^2.$$

Related Question