A random variable $X$ has the gamma distribution
$$
f(x)=\frac{\lambda}{\Gamma(r)}(\lambda x)^{r-1} e^{-\lambda x}, \quad x>0
$$
(a) Show that the moment-generating function of $X$ is
$$
M_{X}(t)=\left(1-\frac{t}{\lambda}\right)^{-r}
$$
(b) Find the mean and variance of $X$.