Use a comparison between $\chi^2$ and Gamma to solve find $E(x^k)$ and $E(1/x)$? Let $X\sim\chi^2_n$ be a random variable with a $\chi^2$ distribution with $n$ degrees of freedom.

(I) Derive $E[X^k]$ for general $k > −n/2$. 
(II) Find $E[1/X]$.

This exercise has the following hint: instead of evaluating an integral 
$$
\int_0^\infty e^{-\lambda x} x^{r-1} \, dx
$$
of the form compare it to the density of the gamma distribution, which we know integrates to one. It’s ok to use the fact that a χ2-random variable is a special case of the gamma distribution.
I was trying to do the comparison the hint said but I have no clue how to derived  point I and II for this exercise. Thanks. 

I follow the guide bellow
I have that the $f(x) = \left( \frac 1 2\right)^{n/2} x^{(n/2)-1} {e^{-x/2}} {r(n/2)}$
I plug it in the expression of 
$$E(X^k)= \int_0^\infty x^k \left(\frac 1 2\right)^{n/2} x^{(n/2)-1} \frac{e^{-x/2}}{r(n/2)} \, dx. $$
Now I'm stuck again, I believe I need to compare with the $X^2$ but I'm not sure what I need to compare to obtain the $E\{x\}$. Thanks, and sorry if is a lame question, but I'm trying without susses to finish this exercise.Thanks, again.
 A: A gamma density with shape $r$ and rate $\lambda$ has the form $$f_Y(y) = \frac{\lambda^r e^{-\lambda y} y^{r-1} }{\Gamma(r)}, \quad y > 0.$$  The hint tells you that you may assume two facts:  $$\int_{y = 0}^\infty f_Y(y) \, dy = 1,$$ and $$X \sim \chi^2_n \sim \operatorname{Gamma}(r = n/2, \lambda = 1/2).$$  Now we write $$\operatorname{E}[X^k] = \int_{x=0}^\infty x^k f_X(x) \, dx,$$ and use the above facts to evaluate the integral.  Once you do this, you can also evaluate $\operatorname{E}[1/X]$ by setting $k = -1$, with the caveat that $n > 2$.

We write $$\begin{align*} \operatorname{E}[X^k] &= \int_{x=0}^\infty  \frac{x^{k+n/2-1} e^{-x/2}}{2^{n/2} \Gamma(n/2)} \, dx \\ &= \frac{2^k \Gamma(k+n/2)}{\Gamma(n/2)} \int_{x=0}^\infty \frac{x^{k+n/2-1} e^{-x/2}}{2^{k+n/2} \Gamma(k+n/2)} \, dx\end{align*}$$ and recognize that the integrand is now the density of a gamma distribution with rate $\lambda = 1/2$ and shape $r = k+n/2$, and thus integrates to $1$.  It follows that the expectation is $$\operatorname{E}[X^k] = \frac{2^k \Gamma(k+n/2)}{\Gamma(n/2)}, \quad k > -n/2,$$ with the restriction on $k$ due to the fact that the new shape parameter $r = k+n/2$ must be positive.
A: $$
\Gamma(r) = \int_0^\infty u^{r-1} e^{-u}\,du.
$$
Hence
$$
\Gamma(r) = \int_0^\infty \left(\lambda w \right)^{r-1} e^{-\lambda w} (\lambda \, dw).
$$
So the Gamma distribution is
$$
 \frac{\left(\lambda w \right)^{r-1} e^{-\lambda w} (\lambda \, dw)}{\Gamma(r)} \text{ on }(0,\infty).
$$
Then we have
\begin{align}
\operatorname{E}(X^k) = \int_0^\infty w^k\ \frac{(\lambda w)^{r-1} e^{-\lambda w} (\lambda \, dw)}{\Gamma(r)} & = \frac 1 {\lambda^k \Gamma(r)} \int_0^\infty (\lambda w)^k\ (\lambda w)^{r-1} e^{-\lambda w} (\lambda \, dw) \\[12pt]
& = \frac 1 {\lambda^k \Gamma(r)} \int_0^\infty u^{r+k-1} e^{-u}\,du \\[12pt]
& = \frac 1 {\lambda^k \Gamma(r)} \Gamma(r+k) \\[12pt]
& = \frac {r(r+1)(r+2)\cdots(r+k-1)} {\lambda^k}.
\end{align}
