A question asks me to find the MGF for the continuous random variable $f(x) = 3x^2$ on $[0,1]$. Using the MGF, it asks me to find $E[X^3]$. I'm having trouble evaluating $E[X^3]$
I found the MGF using integration by parts twice, and got:
$$(e^t(3t^2-6t+6)-2)/t^3$$
Now to find $E[X^3]$, I would take the 3rd derivative of the MGF and evaluate it at $t = 0$. The problem is there is a $t$ in the denominator, which would give an invalid result. How do I calculate $E[X^3]$? Is there something I did wrong in deriving the MGF that results in this problem?
$$ M_X (t )=\Bbb E (e^{tX})=\int_0^1 3x^2 e^{t x} dx= \frac{3e^t (t^2-2t+2)-6}{t^3}=1+\frac{3t}{4}+\frac{3t^2}{10}+\frac{t^3}{12}+o (t^4) $$ where we used the Taylor expansion $$ e^t=1+t+\frac{t^2}{2!}+\frac{t^3}{3!}+\frac{t^4}{4!}+\frac{t^5}{5!}+\frac{t^6}{6!}+o (t^7) $$
Thus $$\Bbb E (X^3)= M^{(3)}(0)=3!\frac{1}{12}=\frac{1}{2}$$