Standard Normal Variance Integral

81 Views Asked by At

I am having troubles with the below integral $$\int_{-\infty}^\infty x^2 \cfrac{1}{\sqrt{2\pi}}e^{{-x^2}/{2}} dx$$

In particular, I am getting $2$ instead of $1$ and I guess this is caused by $$\frac{d}{dx} x^2 = 2x$$.

This is what I'm doing: $$\int_{-\infty}^\infty x^2 \cfrac{1}{\sqrt{2\pi}}e^{{-x^2}/{2}} = $$ $$ = \cfrac{1}{\sqrt{2\pi}}\left[ x^2 \frac{e^{-x^2/2}}{-x}\right]^\infty_{-\infty} - \cfrac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty \color{red}2x \frac{e^{-x^2/2}}{-x} dx= $$ $$= \frac{\color{red}2}{\sqrt{2\pi}}\int_{-\infty}^\infty e^{-x^2/2} dx = $$ $$ = \frac{\color{red}2}{\sqrt{2\pi}}\sqrt{2\pi} = \color{red}2$$

I understand that that $2x$ inside the second integral should get simplified, but I can't figure out how. Can you help?

Many thanks!

2

There are 2 best solutions below

5
On

Taking out the $1/\sqrt{2\pi}$ for convenience, you should be integrating by parts $\int u \; dv = uv - \int v \; du$ with $u = x$, $dv = x e^{-x^2/2}\; dx$, so $du = dx$ and $v = -e^{-x^2/2}$. There is no $2$.

0
On

It looks like you are getting the indefinite integral of $e^{-\frac{x^2}{2}}$ to be $\frac{e^{-\frac{x^2}{2}}}{-x}$. That's wrong.

To integrate by parts: $\int_{-\infty}^{\infty} x^2e^{-\frac{x^2}{2}}dx=[-xe^{-\frac{x^2}{2}}]_{-\infty}^\infty+\int_{-\infty}^\infty e^{-\frac{x^2}{2}}dx=\sqrt{2\pi}$