Why Differentiating an MGF Needs Justification
The moment-generating function of a random variable \(X\) is \(M_X(t)=E[e^{tX}]\) wherever this expectation is finite. It is tempting to differentiate the exponential inside the expectation and write \(M_X'(t)=E[Xe^{tX}]\). Pointwise, the derivative of \(e^{tX}\) is indeed \(Xe^{tX}\). But pointwise differentiation alone does not justify interchanging differentiation and expectation: the difference quotients must be controlled by an integrable random variable.
Finiteness on an open neighborhood provides exactly the extra control needed. The exponential factor can absorb powers of \(|X|\), and a slightly larger exponential moment bounds the difference quotients. The result is a derivative formula valid not just for the first derivative, but for every finite order.
The Exponential Bound Behind the Formula
The key inequality is that an exponential with a little extra rate dominates any fixed power. For \(c>0\) and a nonnegative integer \(r\), there is a finite constant \(C_{r,c}\) such that
For example, when \(x\ge 0\), the function \(x^r e^{-cx}\) is bounded: it is continuous and tends to zero as \(x\) tends to infinity. The same reasoning applies to \(|x|\) when \(x<0\). Thus an exponential moment with a margin beyond \(t\) controls both powers of \(X\) and the nearby difference quotients.
Here is the first-order bound. For \(h\ne 0\), the mean value theorem applied to the exponential gives
Multiplying by \(e^{tx}\), and choosing \(|h|\) smaller than the available neighborhood margin, produces an integrable bound. This is what permits the dominated convergence theorem to be used.
In particular, if the MGF is finite on an open interval around zero, then \(E[X^r]\) exists absolutely for every nonnegative integer \(r\), and \(M_X^{(r)}(0)=E[X^r]\).
Proof of the Derivative Formula
We prove the result locally around an arbitrary \(t_0\) in the interval of finiteness. Choose \(\delta>0\) small enough that \(M_X(t_0+2\delta)\) and \(M_X(t_0-2\delta)\) are finite. Define
for \(s\) sufficiently close to \(t_0\). First, these expectations exist absolutely. For \(|s-t_0|\le\delta\), the exponential bound on powers gives a constant \(C\), depending on \(r\) and \(\delta\), such that
To see the two sides of this bound, when \(x\ge0\) use the term with exponent \(t_0+2\delta\); when \(x<0\) use the term with exponent \(t_0-2\delta\). The right-hand side has finite expectation by the choice of \(\delta\).
Now fix \(s\) with \(|s-t_0|<\delta\). For sufficiently small \(|h|\), the difference quotient for \(g_r\) satisfies
where the second inequality follows by absorbing \(|X|^{r+1}\) into the remaining exponential margin. The final random variable is integrable. For each fixed value of \(X\), the difference quotient converges to \(X^{r+1}e^{sX}\) as \(h\to0\). The dominated convergence theorem therefore yields
Since \(g_0(s)=M_X(s)\), repeated application of this identity gives \(M_X^{(r)}(s)=g_r(s)\) for every finite \(r\). In particular, the conclusion holds at \(t_0\). When \(t_0=0\), \(e^{0X}=1\), so \(M_X^{(r)}(0)=E[X^r]\). The same exponential bounds also show \(E[|X|^r]<\infty\). \(\square\)
Worked Examples
Worked Example: A Two-Point Distribution
Let \(P(X=-1)=1/3\) and \(P(X=2)=2/3\). Since \(X\) takes only two finite values, its MGF is finite for every real \(t\):
Direct differentiation gives
The expectation in the derivative formula gives the same result:
At zero, \(M_X'(0)=-1/3+4/3=1\), which agrees with \(E[X]=(-1)(1/3)+2(2/3)=1\). Here finiteness on every neighborhood is immediate because the support is bounded.
Worked Example: Differentiating the MGF of a Uniform Variable at Zero
Suppose \(X\) is uniform on \([0,1]\). Its MGF is finite for every real \(t\), and for \(t\ne0\) it is
At zero the integral gives \(M_X(0)=1\). The theorem says that the derivative at zero is \(E[X]\). Directly evaluating the expectation,
This also agrees with the limit from the explicit MGF:
The neighborhood condition is satisfied because the variable is bounded; for every real \(t\), \(e^{tX}\) is bounded on \(0\le X\le1\). The theorem justifies the differentiation even without relying on the explicit closed form.
Worked Example: An Unbounded Variable With a Restricted MGF Domain
Let \(X\) have density \(f(x)=\tfrac12e^{-|x|}\), for \(x\in\mathbb R\). Splitting the integral at zero shows that its MGF is finite precisely when \(-1<t<1\):
Take \(t=1/2\), which lies in the open interval of finiteness. Differentiating the explicit MGF gives
The expectation formula verifies that value directly:
For \(a>0\), \(\int_0^\infty xe^{-ax}\,dx=1/a^2\), as follows by integration by parts. This example illustrates why the derivative formula is local: the MGF is finite at \(1/2\) and on a neighborhood of it, though it is not finite for all real arguments.
Why the Neighborhood Condition Matters
The condition is more than a technical detail. Although \(M_X(0)=E[1]=1\) for every random variable, that fact alone does not provide an integrable bound for difference quotients near zero. The proof uses finite MGF values at points on both sides of the point where differentiation is being performed. Those values provide the margin that controls the tails of \(X\).
- Common mistake: “The derivative of \(e^{tX}\) is \(Xe^{tX}\), so \(M_X'(t)=E[Xe^{tX}]\) automatically.” This applies pointwise, but does not establish that the limit can pass through the expectation.
- Correction: Check that the MGF is finite on an open neighborhood of \(t\), then use an integrable exponential bound on the difference quotients and the dominated convergence theorem.
- At zero: A finite MGF on a neighborhood of zero guarantees all ordinary moments exist and can be recovered by derivatives there. Finiteness only at zero does not establish that conclusion.
The formula is useful because it connects an analytic object, the MGF, to probabilistic quantities, the moments. The neighborhood condition explains why this connection is valid rather than merely plausible. It also signals the limit of the method: before differentiating, check the domain and verify that the point lies in its interior.
Check Your Understanding
Use the neighborhood condition and the derivative formula to answer these questions.
- State the condition on \(M_X\) that guarantees \(M_X'(t_0)=E[Xe^{t_0X}]\).
- Why does pointwise convergence of the difference quotient not, by itself, justify interchanging its limit and expectation?
- If \(M_X\) is finite on an open interval around zero, what is \(M_X^{(r)}(0)\) for a nonnegative integer \(r\)?
- For the two-point variable with probabilities \(1/3\) at \(-1\) and \(2/3\) at \(2\), verify that \(M_X'(0)=E[X]\).
- For the density \(\tfrac12e^{-|x|}\), is the derivative formula guaranteed at \(t=1\)? Explain using the MGF domain.