Problem:
Find (a) the moment generating function of the random variable $X$ having
density function
$
x = \begin{cases}
\frac{x}{2} & 0 <= x <= 2\\
0 &\text{ otherwise } \\
\end{cases}
$
(b) Use the generating function of (a) to find the first four moments
about the origin.
Answer:
The moment generating function for $x$ is:
$ M_x(t) = E(e^{tx}) = \int_0^2 { e^{tx} \frac{x}{2} } dx $
$ 2 M_x(t) = \int_0^2 { x e^{tx} } dx $
Let $ I = \int x e^{tx} dx $
To evaluate the integral $I$ I use integration by parts with
$u = x$, $dv = e^{tx} dx$ and $v = \frac{e^{tx}}{t}$.
$ I = x \frac{e^{tx}}{t} – \int \frac{e^{tx}}{t} dx $
$ I = \frac{xe^{tx}}{t} – \frac{e^{tx}}{t^2} + C $
$ 2 M_x(t) = \frac{xe^{tx}}{t} – \frac{e^{tx}}{t^2} \Big|_0^2
= \frac{2e^{2t}}{t} – \frac{e^{2t}}{t^2} –
( \frac{0e^0}{t} – \frac{e^0}{t^2} ) $
$ 2 M_x(t) = \frac{2e^{2t}}{t} – \frac{e^{2t}}{t^2} + \frac{e^0}{t^2} $
$ M_x(t) = \frac{2te^{2t} + 1 – e^{2t}}{2t^2} $
Now to find the first moment I find $M_x'(0)$.
$ M_x'(t) = \frac{
(2t^2)(4te^{2t} + 2e^{2t} – 2e^{2t}) – (4t)(2te^{2t} + 1 – e^{2t})
}{4t^4}
$
$
M_x'(t) = \frac{
(t)(4te^{2t} + 2e^{2t} – 2e^{2t}) – (2)(2te^{2t} + 1 – e^{2t})
}{2t^3} $
However, now if I want to compute $M_x'(0)$ I have a problem. The function
is not defined at $t = 0$ because it is not legal to divide by $0$. What am
I missing?
Best Answer
I was able to solve this problem by computing the limit as t goes to $0$ of $M_x'(t)$. The answer also matched the back of the book.