Moment generating function, Variance and Expected Value

1k Views Asked by At

Let $M_X (t)$ be a moment generating function.

These are the things I know:

$Mean=E[X] =M'_X(t)$ at $t=0$ (likewise the second expected value is the second derivative evaluated at $t=0$)

$V[X] = E[X^2] - E[X] $ (where V = Variance)

I have a been given a pdf:

$f_x(x) = x$ if $ 0 \le x \le 1$
$f_x(x) = 2-x$ if $ 1 \le x \le 2$
$f_x(x) = 0$ otherwise

From which I calculated a moment generating function:

$M_x(t) = (\frac {e^t((e^t - 2) + 1)} {t^2})$ so clearly, no matter what derivative I take, if I evaluate this at $t=0$ I get a $0$ in the denominator which is undefined.

The question then asks for the expected value and variance of this distribution. How do I get this?