Tutorials › VEE Mathematical Statistics › Why MGF Derivatives Give Moments

VEE Mathematical Statistics · Moment Generating Functions · Tutorial 224 of 880

Why MGF Derivatives Give Moments

Learn when MGF derivatives equal raw moments, why the differentiation is valid, and how to recognize cases where the condition fails.

Intermediate 10 min read

What You'll Learn

  • State the local existence condition needed for the MGF derivative identity.
  • Justify differentiation under the expectation using an integrable exponential bound.
  • Distinguish the nth derivative at zero from the coefficient of the nth power in a series.
  • Verify the identity for discrete and continuous random variables.
  • Recognize why a value of the MGF at zero alone does not justify differentiating.
  • Identify a distribution for which no MGF exists on an open interval around zero.

Why MGF Derivatives Contain Moment Information

A moment generating function packages information about a distribution into a function of one real variable. Its name reflects a precise relationship: when the function is finite on an open interval around zero, its derivatives at zero give the raw moments of the random variable. The condition about an interval matters. Knowing only that the function is defined at zero is not enough to justify differentiating it through an expectation.

The key step is to justify exchanging differentiation and expectation. This tutorial states the required condition, explains why it supplies a suitable bound, and works through examples where the identity applies and where it does not. The distinction between a derivative and a power-series coefficient is especially important in calculations.

Definition: For a real-valued random variable \(X\), its moment generating function is \(M_X(t)=E[e^{tX}]\) at each real \(t\) for which this expectation is finite. Say that the MGF exists in a neighborhood of zero if there is some \(\varepsilon>0\) such that \(M_X(t)<\infty\) for every \(t\) with \(|t|<\varepsilon\).
Theorem: If \(M_X(t)\) is finite on an open interval containing zero, then for every nonnegative integer \(n\), the \(n\)th raw moment is finite and \(M_X^{(n)}(0)=E[X^n]\). More generally, wherever \(t\) is an interior point of an interval on which the MGF is finite, \(M_X^{(n)}(t)=E[X^n e^{tX}]\).

Here \(X^0=1\), so the order-zero identity says \(M_X(0)=E[1]=1\). For \(n\geq 1\), \(E[X^n]\) is a raw moment: it is not centered by subtracting the mean. The theorem also implies that \(E[|X|^n]\) is finite under the stated MGF condition, so these expectations are well-defined.

Why Differentiation Under the Expectation Is Valid

For a fixed value of \(X\), ordinary calculus gives \(\frac{d^n}{dt^n}e^{tX}=X^n e^{tX}\). But \(M_X(t)\) is an expectation of \(e^{tX}\), and differentiating the integrand alone does not automatically prove that the derivative can pass through the expectation. The neighborhood condition provides the needed control over the integrand, including when \(X\) can be large in magnitude.

1
Choose exponential bounds on both tails.
Since the MGF is finite on an open interval around zero, choose \(a>0\) such that \(M_X(a)\) and \(M_X(-a)\) are finite.
2
Control the absolute tail.
For every real \(x\), \(e^{a|x|}\leq e^{ax}+e^{-ax}\). Consequently, \(E[e^{a|X|}]\leq M_X(a)+M_X(-a)<\infty\).
3
Bound the differentiated integrand locally.
Fix \(b\) with \(0<b<a\). For each fixed nonnegative integer \(n\), there is a finite constant \(C\) such that \(y^n e^{by}\leq C e^{ay}\) for all \(y\geq0\). Thus \(|X|^n e^{b|X|}\) has finite expectation.
4
Apply dominated differentiation.
On any sufficiently small interval of \(t\)-values with \(|t|\leq b\), the \(n\)th derivative of \(e^{tX}\) is bounded in absolute value by \(|X|^n e^{b|X|}\). The same type of bound applies to the difference quotients used for the next derivative. The dominated convergence theorem therefore permits differentiation under the expectation, repeatedly.

This establishes \(M_X^{(n)}(t)=E[X^n e^{tX}]\) at interior points where the local bounds apply. Setting \(t=0\) gives the stated raw-moment formula. It also explains why finiteness merely at \(t=0\) is not the condition: \(M_X(0)=1\) for every probability distribution, whether or not the MGF is finite at any nonzero \(t\).

Worked Examples

Worked Example: A Third Derivative and Its Series Coefficient

A random variable \(X\) takes the value \(-1\) with probability \(1/2\) and the value \(2\) with probability \(1/2\). Find \(M_X'''(0)\), and verify it directly from the third raw moment. Identify the coefficient of \(t^3\) in the MGF expansion.

Method and condition. The distribution has finite support, so \(e^{tX}\) is bounded over the two possible values of \(X\) for every fixed real \(t\). Its MGF is finite on an interval around zero, and the derivative identity applies.

Step 1: Write the MGF. Weight \(e^{tx}\) by the probability at each possible value:

$$ M_X(t)=\frac12 e^{-t}+\frac12 e^{2t}. $$

Step 2: Differentiate three times. Each differentiation of \(e^{ct}\) introduces a factor of \(c\). Therefore

$$ M_X'''(t)=\frac12(-1)^3e^{-t}+\frac12(2)^3e^{2t}. $$

At zero, \(e^0=1\), so

$$ M_X'''(0)=-\frac12+\frac12(8)=\frac72=3.5. $$

Step 3: Check by calculating the raw moment.

$$ E[X^3]=\frac12(-1)^3+\frac12(2)^3 =-\frac12+4=\frac72=3.5. $$

Step 4: Distinguish the coefficient from the derivative. The \(t^3\) term in \(e^{2t}\) has coefficient \(2^3/3!=8/6=4/3\). After multiplying by the probability \(1/2\), its contribution to the coefficient in \(M_X(t)\) is \(2/3\), not \(1/3\). The \(e^{-t}\) term contributes \(-1/12\), so the total coefficient of \(t^3\) is \(2/3-1/12=7/12\). The third derivative at zero is \(3!\) times that coefficient:

$$ 3!\left(\frac7{12}\right)=6\left(\frac7{12}\right)=\frac72. $$

The derivative and the direct moment agree. Common mistake avoided: treating the coefficient of \(t^3\) as the third derivative. For a power series, the coefficient must be multiplied by \(3!\).

Worked Example: Checking a Third Moment from a Density

A continuous random variable has density \(f_X(x)=2x\) for \(0<x<1\), and zero elsewhere. Find \(M_X'''(0)\) using the MGF expansion, then verify the answer by integration.

Method and condition. First check the density: \(\int_0^1 2x\,dx=1\). Since \(X\) is bounded between 0 and 1, \(e^{tX}\leq e^{|t|}\) for every possible value of \(X\). Thus its MGF is finite for every real \(t\), and differentiation under the expectation is justified.

Step 1: Express the MGF as an expectation.

$$ M_X(t)=\int_0^1 e^{tx}2x\,dx. $$

Expand the exponential in its power series. On the bounded interval \(0\leq x\leq1\), the series for \(e^{tx}\) converges uniformly for each fixed \(t\), so it can be integrated term by term:

$$ M_X(t) =\int_0^1 2x\sum_{k=0}^{\infty}\frac{(tx)^k}{k!}\,dx =\sum_{k=0}^{\infty}\frac{2t^k}{k!(k+2)}. $$

The last equality follows from \(\int_0^1 x^{k+1}\,dx=1/(k+2)\). The coefficient of \(t^3\) is therefore

$$ \frac{2}{3!(3+2)}=\frac{2}{30}=\frac1{15}. $$

Step 2: Convert that coefficient to a derivative. The third derivative at zero is \(3!\) times the coefficient:

$$ M_X'''(0)=3!\left(\frac1{15}\right)=\frac6{15}=\frac25=0.4. $$

Step 3: Verify by direct integration.

$$ E[X^3]=\int_0^1 x^3(2x)\,dx =2\int_0^1x^4\,dx =2\left(\frac15\right)=\frac25=0.4. $$

The two methods agree. Common mistake avoided: reporting \(1/15\), the series coefficient, as the third moment. The required factor \(3!\) gives the moment \(2/5\).

Worked Example: When the MGF Derivative Rule Does Not Apply

Let \(X\) have the Cauchy density \(f_X(x)=1/[\pi(1+x^2)]\) for real \(x\). Determine whether the derivative identity can be used to find its first moment.

Method and condition. Before differentiating an MGF, check that it is finite on an open interval around zero. At \(t=0\), \(M_X(0)=E[1]=1\), but this single value does not establish the required condition.

For \(t>0\), the positive-tail part of the expectation is

$$ \int_0^\infty e^{tx}\frac{1}{\pi(1+x^2)}\,dx. $$

For sufficiently large \(x\), \(1+x^2\leq 2x^2\), so the integrand is at least \(e^{tx}/(2\pi x^2)\). The latter function has a divergent integral on a positive tail: exponential growth eventually exceeds the polynomial factor \(x^2\). Hence \(M_X(t)=\infty\) for \(t>0\). For \(t<0\), the same argument applies on the negative tail by substituting \(y=-x\), and again the expectation diverges.

Thus \(M_X(t)\) is finite at zero but not at any nonzero \(t\); it does not exist on an open interval around zero. The derivative identity cannot be invoked. In fact, the absolute first moment diverges, since

$$ E[|X|]=\frac{2}{\pi}\int_0^\infty\frac{x}{1+x^2}\,dx=\infty. $$

The symmetric principal value of \(E[X]\) is not the ordinary expectation: the positive and negative parts are both infinite. Common mistake avoided: differentiating \(M_X(0)=1\) as if the MGF were defined near zero. A function’s value at one point does not guarantee that a derivative exists there.

What the Result Does and Does Not Say

The result is powerful because one function can encode all raw moments, provided the MGF exists in a neighborhood of zero. It is not a rule for differentiating any expression that happens to equal 1 at zero. Always check the MGF’s domain before applying the identity, especially for distributions with substantial tail probabilities.

A related distinction is that finite moments alone do not guarantee an MGF exists near zero. The derivative formula has a specific hypothesis: finiteness on an open interval containing zero. Once that condition holds, the theorem justifies the derivative calculation; without it, a separate argument is needed for any proposed moment calculation.

SituationWhat follows
MGF finite on an open interval around zeroAll raw moments exist, and \(M_X^{(n)}(0)=E[X^n]\).
MGF finite only at zeroThis gives \(M_X(0)=1\), but does not justify taking derivatives.
A coefficient of \(t^n\) is known in a valid MGF seriesMultiply that coefficient by \(n!\) to obtain the \(n\)th derivative at zero.

The most reliable exam procedure is to state the local existence condition, differentiate carefully, evaluate at zero, and distinguish the derivative from any series coefficient used along the way. This reasoning is aligned with the SOA VEE Mathematical Statistics syllabus.

Check Your Understanding

For each problem, first check whether the MGF condition needed for the identity is satisfied.

  1. \(X\) equals 0 with probability 0.4 and 3 with probability 0.6. Find \(M_X'''(0)\). (Answer: \(16.2\))
  2. \(X\) has density \(f_X(x)=3x^2\) for \(0<x<1\), and zero elsewhere. Find \(M_X''(0)\) by using the derivative identity and direct integration. (Answer: \(3/5=0.6\))
  3. \(X\) equals \(-1\) or \(1\), each with probability \(1/2\). Find the coefficient of \(t^4\) in \(M_X(t)\), then find \(M_X^{(4)}(0)\). (Answer: coefficient \(1/24\); derivative \(1\))
  4. A density is \(f_X(x)=2e^{-2x}\) for \(x>0\), and zero elsewhere. Its MGF is finite for \(t<2\). Use the identity to find \(M_X''(0)\). (Answer: \(1/2\))
  5. \(X\) has density \(1/[\pi(1+x^2)]\) on the real line. Is \(M_X(0)=1\) sufficient to apply the derivative identity for \(E[X]\)? (Answer: No; the MGF is infinite for every nonzero \(t\), so it is not finite on an open interval around zero.)
Clinical Biostats