# How to derive mean of chi square variable function using the MGF?

I am working through past examination questions from the Royal Statistical Society and came across this one from 2009 in Module 5 (Question 2(i) and Solution):

The random variable $X$ has a $\chi^{2}_{k}$ distribution ($k=1,2,3, ...$) which has the moment generating function (mgf) $m(t) = (1 − 2t)^{−k/2}$ for $t < \frac{1}{2}$.

Using the mgf, find the mean and variance of $X$.

I know the mean will be $k$ and variance $2k$ but I can't derive it. Here is my best attempt which is incorrect:

$$E[X] = d/dx[M_X(0)] = -2 \times \frac{-k}{2}(1-2X)^{-k/2 -1} = k^{\frac{-k}{2} -1}$$

I'm pretty sure I should be doing an expansion at $0$ but I can't see how to do it.

• The Binomial Theorem (Newton, c. 1665) says that $m(t)$ = $(1-2t)^{-k/2}$ = $1 + \binom{-k/2}{1}(-2t) + \binom{-k/2}{2}(-2t)^2 + O((-2t)^3)$ = $1 + kt + \frac{k^2+2k}{2!}t^2 + O(t^3)$. Comparing coefficients with $\mathbb{E}(\exp(tX))$ shows the first two moments are $k$ and $k^2 + 2k$, whence the mean is $k$ and the variance is $(k^2 + 2k) - k^2$ = $2k$.
– whuber
Commented Jan 8, 2013 at 16:31
• To find the variance using the moments for this PDF with non-zero mean, please follow the description here: onlinecourses.science.psu.edu/stat414/node/73
– user101588
Commented Jan 22, 2016 at 17:33

Your differentiation is almost right, but you've put $X$ where you should have put $t$: $$\newcommand{\diff}{\mathrm{d}} \frac{\diff M_X(t)}{\diff t}=-2\left(\frac{-k}{2}\right)(1-2t)^{-\frac{k}{2}-1}$$ Now all you need to do is set $t = 0$ in that expression, recalling that $1$ to the power of anything is $1$.