1
$\begingroup$

I am calculating the variance of a standard normal, but I stuck with the following part (the answer is different from what I know). What is wrong with my calculation?

$$ \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} y^2 e^{- y^2 / 2} = \left[ y^2 \cdot \left( - \frac{1}{y} \right) \cdot e^{- y^2 / 2} \right]_{-\infty}^{\infty} - \int_{-\infty}^{\infty} 2y \cdot \left( - \frac{1}{y} \right) \cdot e^{- y^2 / 2} dy = 2?({\rm Should \ be\ 1}) $$

I used integration by parts: $$ \int_{a}^{b} f(x) g'(x) dx = \left[f(x)g(x) \right]_{a}^{b} - \int_{a}^{b} f'(x) g(x) dx $$ I thought $f(y) = y^2$, so $f'(y) = 2y$, and $g'(y) = e^{- y^2 / 2}$, so $g(y)= (- 1/y) \cdot e^{- y^2 / 2}$

I also used the result of Gaussian integral: $$ \int_{-\infty}^{\infty} e^{-a x^2} dx = \sqrt{\frac{\pi}{a}}$$

  • 0
    If $g'(y)=e^{y^2/2}$ are you sure we can integrate this?2017-01-25
  • 0
    @AhmedS.Attaalla Can we use Gaussian integral? $a=1/2$ above.2017-01-25
  • 0
    $g'(y)$ and $g(y)$ are incorrect. Use $g'(y)=ye^{-y^2/2}$.2017-01-25
  • 0
    @SergeiGolovan Actually, several websites use $g'(y) = -ye^{y^2/2}$, but why $g'(y) = e^{-y^2/2}$ is wrong? Can't we use arbitrary functions $f(x)$ and $g(x)$ in integration by parts?2017-01-25
  • 0
    @user51966: It's hard to get $g(y)$ given $g'(y)=e^{-y^2/2}$. Hint: was it easy to calculate the Gaussian integral?2017-01-25
  • 0
    @SergeiGolovan Isn't it $g(y) = (-1/y) e^{-y^2/2}$? I thought I can plug in $a = 1/2$ in Gaussian integral.2017-01-25
  • 1
    @user51966: No, it isn't. In fact, you can't express it via elementary functions.2017-01-25
  • 0
    @SergeiGolovan Now I think I understand why I was wrong. Thanks.2017-01-25

1 Answers 1

0

\begin{align} \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} y^2 e^{- y^2 / 2}dy &=\frac{2}{\sqrt{2 \pi}} \int_{0}^{\infty} y^2 e^{- y^2 / 2} dy\\ &\text{put $\frac{y^2}{2}=t$,we have $ydy=dt$}\\ &=\frac{2}{\sqrt{2 \pi}} \int_{0}^{\infty} e^{- t} \sqrt{2t}dt\\ &=\frac{2\sqrt 2}{\sqrt{2 \pi}} \int_{0}^{\infty} e^{- t} t^{\frac12}dt\\ &=\frac{2\sqrt 2}{\sqrt{2 \pi}} \int_{0}^{\infty} e^{- t} t^{\frac32-1}dt\\ &=\frac{2\sqrt 2}{\sqrt {2\pi}}\Gamma(\frac32)\\ &=\frac{2\sqrt 2}{\sqrt {2\pi}}\times\frac{\sqrt \pi}{2}\\ &=1 \end{align}