<s>[INST] integration by parts with $\frac{2}{\sqrt{2\pi}} \int^\infty_0 z^2e^{\frac{-z^2}{2}}dz$ Can someone please show how to calculate this with integration by parts $(\int udv = uv - \int vdu)$? I found an example in the book is not clear and confusing.
$$\frac{2}{\sqrt{2\pi}} \int^\infty_0 z^2e^{\frac{-z^2}{2}}dz$$
They start with u = z, dv = $ze^{\frac{-z^2}{2}} dz$, v = $ -e^{\frac{-z^2}{2}}$, du = dz
then:
$$\int^\infty_0 udv = -ze^{\frac{-z^2}{2}} - \int^\infty_0 -e^{\frac{-z^2}{2}} dz = -ze^{\frac{-z^2}{2}} + \int^\infty_0 e^{\frac{-z^2}{2}} =  -ze^{\frac{-z^2}{2}} + \frac{\sqrt{2\pi}}{2}$$
I have no problem with the most right part of integration $\int^\infty_0 e^{\frac{-z^2}{2}}$ i know it is equal to$\frac{\sqrt{2\pi}}{2}$ but what about the $-ze^{\frac{-z^2}{2}}$ how to deal with it?
how can I continue from here?
 [/INST] With $\dfrac{z^2}{2}=u$ and 
$$\frac{2}{\sqrt{2\pi}} \int^\infty_0 z^2e^{\frac{-z^2}{2}}dz=\frac{2}{\sqrt{\pi}} \int^\infty_0 u^\frac12e^{-u}du=\frac{2}{\sqrt{\pi}} \Gamma(\frac32)=\frac{2}{\sqrt{\pi}} \frac{\sqrt{\pi}}{2}=1$$
</s>