Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Attempting to calculate the moment generating function for the uniform distrobution I run into ah non-convergent integral.

Building of the definition of the Moment Generating Function

$ M(t) = E[ e^{tx}] = \left\{ \begin{array}{l l} \sum\limits_x e^{tx} p(x) &\text{if $X$ is discrete with mass function $p( x)$}\\ \int\limits_{-\infty}^\infty e^{tx} f( x) dx &\text{if $X$ is continuous with density $f( x)$} \end{array}\right. $

and the definition of the Uniform Distribution

$ f( x) = \left\{ \begin{array}{l l} \frac{ 1}{ b - a} & a < x < b\\ 0 & otherwise \end{array} \right. $

I end up with a non-converging integral

$\begin{array}{l l} M( t) &= \int\limits_{-\infty}^\infty e^{tx} f(x) dx\\ &= \int\limits_{-\infty}^\infty e^{tx} \frac{ 1}{ b - a} dx\\ &= \left. e^{tx} \frac{ 1}{ t(b - a)} \right|_{-\infty}^{\infty}\\ &= \infty \end{array}$

I should find $M(t) = \frac{ e^{tb} - e^{ta}}{ t(b - a)}$, what am I missing here?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The density is $\frac{1}{b-a}$ on $[a,b]$ and zero elsewhere. So integrate from $a$ to $b$. Or else integrate from $-\infty$ to $\infty$, but use the correct density function. From $-\infty$ to $a$, for example, you are integrating $(0)e^{tx}$. The same is true from $b$ to $\infty$. The only non-zero contribution comes from $$\int_a^b\frac{1}{b-a}e^{tx}\,dx.$$

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.