\documentclass[a4paper,12pt]{article}
\begin{document}

QUESTION
 A random variable X has pdf $f(X)=\frac{k}{2}e^{-x}(1+x)^2,\ -1 \leq x \leq \infty$. Find k.
  Show that the mgf of X is $ \frac{e^{-t}}{(1-t)^3},\ t<1$. Hence
  find Var(X). By extending the results in an obvious way find also
  $E(X-\mu)^3$.


ANSWER
 $f(x)=\frac{k}{2}e^{-x}(1+x)^2\ \ -1 \leq x \leq \infty$

  \begin{eqnarray*}
  M(t)&=&\frac{k}{2}\int_-1^\infty e^{xt}e^{-x}(1+x)^2\,dx\ \
  \textrm{ let }y=1+x\\
  &=&\frac{k}{2}\int_0^\infty e^{(y-1)t}e^{-(y-1}y^2\,dy\\
  &=&e^(1-t)\frac{k}{2}\int_0^\infty e^{-y(1-t)}y^2\,dy\\
  (\textrm{from } \varrho(\lambda)\textrm{ we know }&\int_0^\infty
  \lambda e^{-\lambda x}x^2\,dx&=E(X^2)=\frac{2}{\lambda^2}.\textrm{ Let
  }\lambda=1-t\\
  \textrm{ or integrate by parts.})\\
  M(t)&=&\frac{k}{2}e^{(1-t)}\frac{2}{(1-t)^3}\ \ t<1\\
  &=&\frac{ke^(1-t)}{(1-t)^3}\\
  M(0)&=&1 \textrm{ therefore }1=ke \textrm{ therefore }
  k=\frac{1}{e}\\
  M(t)&=&\frac{e^{-t}}{(1-t)^3}\\
  &=&(1-t+\ldots )(!+3t+\ldots)\\
  &=&1+2t+\ldots
  \end{eqnarray*}
   $\mu$=coefficient of t=2\\
   \begin{eqnarray*}
   M*(t)&=&\frac{e^{-3t}}{(1-t)^3}\\
   &=&(1-3t+\frac{0t^2}{2}-\frac{27t^3}{3!}+\ldots)(1+3t+6t^2+10t^3+\ldots)\\
   &=&1+t^2(\frac{9}{2}-9+6)+t^3(-\frac{27}{6}+\frac{27}{2}-18+10)+\ldots\\
   &=&1+\frac{3t^2}{2}+t^3+\ldots
   \end{eqnarray*}
   $\sigma^2=2!\times$ the coefficient of $t^2=3\ \
   E(X-\mu)^3=3!\times$ the coefficient of $t^3=6$\\
   Alternately differentiate, $\mu=M^{(1)}(0),\ \
   \sigma^2=M^{*(2)}(0)\ \ E(X-\mu)^3=M^{*(2)}(0)$\\
   or extend $\sigma^2=E(X^2)-\mu^2\\
   E(X-\mu)^3=E(X^3)-3\mu E(X^2)+2\mu^3$ and use M(t) throughout.


\end{document}
