Actuarial Statistics · Generating functions
Moment Generating Function (MGF) Basics: Definition, Moments and Properties
Updated 11 October 2026 · Fact-checked
The moment generating function of X is M_X(t) = E[e^(tX)], defined for t where the expectation is finite. To find moments, differentiate r times and set t = 0: E[X^r] = M_X^(r)(0). Then Var(X) = M''(0) − (M'(0))². For independent variables, multiply MGFs to get the MGF of the sum.
Understand Moment Generating Function (MGF) Basics
The moment generating function (MGF) packs all the moments of a random variable into one function. You define it as M_X(t) = E[e^(tX)]. For a discrete variable this is Σ e^(tx) P(X = x). For a continuous variable it is ∫ e^(tx) f(x) dx.
Why does it give moments? Expand e^(tX) as a power series: 1 + tX + t²X²/2! + t³X³/3! + ... Take expectations term by term. You get M_X(t) = 1 + t E[X] + t² E[X²]/2! + ... So the coefficient of t^r/r! is E[X^r]. Differentiating r times and setting t = 0 picks out E[X^r].
Existence. The MGF must be finite for t in some open interval around 0 for the moment results to hold. M_X(0) = 1 always. Some distributions, such as the lognormal, have no MGF finite on any such interval, even though they have all moments. The Pareto also has no MGF of this kind. The exponential with rate λ has M(t) = λ/(λ − t) only for t < λ.
Uniqueness. If two random variables have MGFs that are equal and finite on an open interval around 0, they have the same distribution. So if you recognise an MGF as that of a known distribution, you have identified the distribution.
Sums. If X and Y are independent, M_{X+Y}(t) = M_X(t) M_Y(t). This is far easier than convolution. Also, for constants a and b, M_{aX+b}(t) = e^(bt) M_X(at).
Key rules to remember
- Definition
- M_X(t) = E[e^(tX)]
- Must be finite for t in an open interval containing 0. M_X(0) = 1.
- Moments from the MGF
- E[X^r] = M_X^(r)(0) = d^r M_X(t)/dt^r at t = 0
- Needs the MGF to exist around 0.
- Mean and variance
- E[X] = M'(0); Var(X) = M''(0) − (M'(0))²
- M''(0) is E[X²], not the variance.
- Linear transformation
- M_{aX+b}(t) = e^(bt) M_X(at)
- Use for scaled and shifted variables.
- Sum of independent variables
- M_{X+Y}(t) = M_X(t) × M_Y(t)
- Independence is required. For n independent copies, M_{ΣX}(t) = (M_X(t))^n.
- Uniqueness
- M_X(t) = M_Y(t) on an open interval around 0 ⇒ X and Y have the same distribution
- Used to identify distributions.
- Series form
- M_X(t) = Σ E[X^r] t^r ÷ r!
- Read moments from the coefficient of t^r, multiplied by r!.
How to solve Moment Generating Function (MGF) Basics questions
Use this method for most MGF questions, whether you must find the MGF, get moments, or identify a distribution.
- 1Write M_X(t) = E[e^(tX)] and state it as a sum (discrete) or integral (continuous).
- 2Evaluate the sum or integral. Use a known series or a gamma-type integral. Note the range of t for which it converges.
- 3Check that M_X(0) = 1. This catches algebra slips.
- 4For moments, differentiate with respect to t. Use the product or quotient rule carefully, then set t = 0.
- 5Compute the mean as M'(0) and the variance as M''(0) − (M'(0))².
- 6For sums of independent variables, multiply the MGFs. For aX + b, use e^(bt) M_X(at).
- 7To identify a distribution, match the final MGF to a standard form and quote uniqueness.
- 8State the answer with its conditions, such as the valid range of t.
Quickest way: Log the MGF or read the series
When to use it: Use when the MGF has a product or power form, or when a series expansion is easy.
- Take K(t) = ln M(t). Then K'(0) = mean and K''(0) = variance directly.
- This avoids the M''(0) − (M'(0))² subtraction and the messy product rule.
- If M(t) is a simple expansion, such as λ/(λ − t) = 1/(1 − t/λ) = Σ (t/λ)^r, read E[X^r] as r! ÷ λ^r.
- For independent sums, add the logs: K_{X+Y} = K_X + K_Y.
- Check by setting t = 0 in M, which must give 1.
Common mistakes in Moment Generating Function (MGF) Basics
Treating M''(0) as the variance.
Students forget that the second derivative gives the second raw moment E[X²].
Fix: Always subtract the square of the mean: Var = M''(0) − (M'(0))².
Multiplying MGFs for dependent variables.
The product rule is remembered but its condition is not.
Fix: Check independence first and state it. Without it, M_{X+Y} ≠ M_X M_Y in general.
Ignoring the range of t.
Students focus on the algebra and drop the convergence condition.
Fix: Write the valid range, such as t < λ for the exponential. The MGF must be finite near 0.
Evaluating derivatives at t = 1 or leaving t in the answer.
Rushing after a long differentiation.
Fix: Set t = 0 after differentiating. The result should be a number or an expression in the parameters only.
Writing M_{aX}(t) = a M_X(t) or M_X(at + b).
Linear rules for expectation are wrongly applied to MGFs.
Fix: Use M_{aX+b}(t) = e^(bt) M_X(at). The constant a goes inside the argument.
Claiming every distribution with finite moments has an MGF.
Confusion between existence of moments and of the MGF.
Fix: The MGF needs finiteness on an interval around 0. The lognormal has all moments but no such MGF.
Worked examples
Example 1
X is exponential with rate λ = 4, so f(x) = 4e^(−4x) for x > 0. Derive the MGF, and use it to find E[X] and Var(X).
Show the solution
- M(t) = ∫0^∞ e^(tx) × 4e^(−4x) dx = 4 ∫0^∞ e^(−(4−t)x) dx.
- This converges for t < 4 and equals 4 ÷ (4 − t).
- Check: M(0) = 4/4 = 1.
- M'(t) = 4 ÷ (4 − t)², so M'(0) = 4/16 = 1/4.
- M''(t) = 8 ÷ (4 − t)³, so M''(0) = 8/64 = 1/8.
- Var(X) = 1/8 − (1/4)² = 1/8 − 1/16 = 1/16.
Answer: M(t) = 4/(4 − t) for t < 4; E[X] = 1/4; Var(X) = 1/16.
Example 2
X and Y are independent. X has MGF (0.3 + 0.7e^t)² and Y has MGF (0.3 + 0.7e^t)³. Find the MGF of S = X + Y, identify its distribution, and find E[S] and Var(S).
Show the solution
- By independence, M_S(t) = (0.3 + 0.7e^t)² × (0.3 + 0.7e^t)³ = (0.3 + 0.7e^t)^5.
- A binomial(n, p) MGF is (1 − p + pe^t)^n. Here n = 5 and p = 0.7.
- By uniqueness, S is binomial(5, 0.7).
- E[S] = np = 5 × 0.7 = 3.5.
- Var(S) = np(1 − p) = 5 × 0.7 × 0.3 = 1.05.
- Check with logs: K(t) = 5 ln(0.3 + 0.7e^t). K'(t) = 5 × 0.7e^t ÷ (0.3 + 0.7e^t), and K'(0) = 3.5.
Answer: M_S(t) = (0.3 + 0.7e^t)^5, so S is binomial(5, 0.7), with E[S] = 3.5 and Var(S) = 1.05.
Exam tips
- Always state the range of t for which the MGF is finite. Written papers often give a mark for it.
- Quote independence explicitly before multiplying MGFs, and quote uniqueness when you name a distribution.
- Use K(t) = ln M(t) to save time on variance questions, but show it clearly as a method.
- Check M(0) = 1 as a quick error test before differentiating.
- In computer-based papers, you can verify analytic moments by simulation, but show the formula and working in the written paper.
Practice questions from Generating functions
- A claim-count variable N has PGF G(s) = exp(3(s - 1)). Using the PGF, what is Var(N)?
- The moment generating function of a random variable X is M(t) = (0.3 + 0.7e^t)^10. What is Var(X)?
- X and Y are independent, X ~ Poisson(2) and Y ~ Poisson(3). Let S = X + Y. Using MGFs, what is P(S = 0)?
- A random variable X has moment generating function M(t) = (0.7 + 0.3e^t)^10. What is the variance of X?
- The number of policies N sold by an agent has PGF G_N(s) = s^2. Each policy independently earns a bonus-count X with PGF G_X(s) = 0.5 + 0.5s…
Moment Generating Function (MGF) Basics: frequently asked questions
What is the moment generating function in simple terms?
It is the expected value of e^(tX), viewed as a function of t. Its derivatives at t = 0 give the moments of X. It also identifies the distribution uniquely when it exists near 0.
How do I find the mean and variance from an MGF?
Differentiate once and set t = 0 to get the mean. Differentiate twice and set t = 0 to get E[X²]. Then the variance is E[X²] minus the mean squared.
How do I find the MGF of a sum of independent random variables?
Multiply the individual MGFs. For n independent identical variables, raise the MGF to the power n. This only works if the variables are independent.
When does an MGF not exist?
It fails to exist when E[e^(tX)] is infinite for every t ≠ 0 near 0, which happens for heavy-tailed distributions such as the lognormal and Pareto. Such variables can still have finite moments.