Moment Generating Function of Continuous Uniform Distribution

Theorem
Let $X \sim \ContinuousUniform a b$ for some $a, b \in \R$ denote the continuous uniform distribution on the interval $\closedint a b$.

Then the moment generating function of $X$ is given by:


 * $\map {M_X} t = \begin {cases} \dfrac {e^{t b} - e^{t a} } {t \paren {b - a} } & t \ne 0 \\ 1 & t = 0 \end{cases}$

Proof
From the definition of the continuous uniform distribution, $X$ has probability density function:


 * $\map {f_X} x = \begin{cases} \dfrac 1 {b - a} & a \le x \le b \\ 0 & \text{otherwise} \end{cases}$

From the definition of a moment generating function:


 * $\ds \map {M_X} t = \expect {e^{t X} } = \int_{-\infty}^\infty e^{t x} \map {f_X} x \rd x$

where $\expect \cdot$ denotes expectation.

First, consider the case $t \ne 0$.

Then:

In the case $t = 0$, we have $\expect {X^0} = \expect 1 = 1$.