Help with an integral for: If U has a $\chi^2$ distribution with v df, find E(U) and V(U) If U has a $\chi^2$ distribution with v df, find E(U) and V(U).
By definition, $E(U)
=\int^{\infty}_{0} u\frac{1}{\gamma(\frac{v}{2})2^\frac{v}{2}}u^{\frac{v}{2}-1} e^\frac{-u}{2}\,du 
=\int^{\infty}_{0} \frac{1}{\gamma(\frac{v}{2})2^\frac{v}{2}}u^\frac{v}{2} e^\frac{-u}{2}\,du$.
How do I integrate this?
Note: This isn't a homework problem.
 A: They both can be done using cdf of the density function
$E(U) = \int^\infty_0 \frac{1}{\Gamma (\frac{v}{2})2^{\frac{v}{2}}}u^{\frac{v+2}{2}-1}e^{-\frac{u}{2}}\text{d}u = \frac{v}{2} \int^\infty_0 \frac{1}{\Gamma (\frac{v+2}{2})2^{\frac{v}{2}}}u^{\frac{v+2}{2}-1}e^{-\frac{u}{2}}\text{d}u=\frac{v}{2}\times 2 \int^\infty_0 \frac{1}{\Gamma (\frac{v+2}{2})2^{\frac{v+2}{2}}}u^{\frac{v+2}{2}-1}e^{-\frac{u}{2}}\text{d}u = v$
The first step follows because $\Gamma(\frac{v+2}{2}) =\frac{v}{2}\Gamma(\frac{v}{2})$.
The last step follows because $\int^\infty_0 \frac{1}{\Gamma (\frac{v+2}{2})2^{\frac{v+2}{2}}}u^{\frac{v+2}{2}-1}e^{-\frac{u}{2}}\text{d}u=1$ as the integrand is the density function of $\Gamma(v+1,\frac{1}{2})$ distribution.
(In case you do not know, $\chi^2_v$ is distributed as $\Gamma(v,\frac{1}{2})$)
$E(U^2)$ can be done using the same trick about gamma function twice, i.e. $\Gamma(\frac{v+2}{2}) =\frac{v}{2}\frac{v+2}{2}\Gamma(\frac{v+4}{2})$ and pulling out two factors of 2, then observe the integrand is the density of $\Gamma(v+2,\frac{1}{2})$. This gives us $EU^2 = v(v+2)$
so the variance is $v(v+2) - v^2 = 2v$ as required.
(However, we could have used the mean and variance formula for $\Gamma(v,\frac{1}{2})$, which gives the same result)
