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}}$$