Moment-generating Function of a Continuous R.V. whose P.D.F is 1 from (0, 1)

1.7k Views Asked by At

I have been working on this problem for a few hours now and I feel I am missing something simple. The problem is to find the moment-generating function of a continuous random variable whose probability density function is defined as:

$$ f(x) = \left\{\begin{aligned} &1 && 0 < x < 1\\ &0 && \mbox{elsewhere} \end{aligned} \right. $$

I know that the moment-generating function for a continuous random variable is given by:

$$ M_X(t) = \int_{-\infty}^\infty e^{tx}\cdot f(x)dx $$

So for the problem, the moment-generating function should be:

$$ M_X(t) = 1\cdot \int_0^1 e^{tx}dx = {{e^{tx}}\over{t}} \left|\begin{aligned} 1\\ 0\end{aligned}\right. = {{e^t-1}\over{t}} $$

However, the answer is given as:

$$ M_X(t) = {{2e^t}\over{3-e^t}} $$

I'm not exactly sure how they arrived at this answer, whether there is a simple algebraic manipulation I've overlooked or I've just completely forgotten how to integrate. Any tips pointing me in the right direction will be greatly appreciated.