Why is this moment generating function defined for all $t \in \mathbb{R}$

moment-generating-functionsprobability

Suppose X is a continuous random variable with density function $f_X(x)=2x$, $x\in[0,1]$ and elsewhere.

then using $M_X(t)=E[e^{tx}]$, we find it's moment generating function:

$M_X(t)=\frac{2}{t}(xe^x-t^{-1}(e^t -1))$

The notes then say that this momemnt generating function is defined for all $t \in \mathbb{R}$. But surely this moment generating function is undefined for t=0??
Is there something I'm not seeing here?

Best Answer

That can't be right, $M_X(t)$ can only depend on $t$; $x$ gets integrated out. You have $M_X(t)=\int_0^1 2x e^{tx} dx = \frac{2e^t(t-1)+2}{t^2}$. You are right that this expression obtained from doing the integration by parts only really makes sense when $t$ is nonzero. However, you can directly evaluate $M_X(0)=\int_0^1 2x dx=1$, and you will find that this is also equal to $\lim_{t \to 0} \frac{2e^t(t-1)+2}{t^2}$.

Related Question