On this page
You have met the mean and variance of a random variable as two separate calculations. A moment generating function (MGF) packs both, and every higher moment, into one function of t. If you already work with the binomial and Poisson distributions from probability distributions in Class 12 Applied Maths, the MGF is the next tool, and it makes one hard question easy: what happens when you add independent random variables?
What is a moment generating function?
The moment generating function of a random variable X is M(t) = E[e^(tX)], as defined in MIT 18.440 lecture notes on moment generating functions. For a discrete X it is the sum of e^(tx) × P(X = x) over all values x, so M(t) is a weighted average of exponential functions. Every MGF has M(0) = 1, because e^0 = 1.
A small example from MIT 6.436 lecture notes: if X takes the values 1, 2 and 3 with probabilities 1/2, 1/3 and 1/6, then M(t) = (1/2)e^t + (1/3)e^(2t) + (1/6)e^(3t). The exponents are the values; the coefficients are the probabilities.
The m.g.f., its properties and uniqueness are listed under Univariate Distributions in the JAM 2026 Mathematical Statistics syllabus.
How do you get the mean and variance from an MGF?
Differentiate, then set t = 0. Since the derivative of e^(tX) with respect to t is X e^(tX), M′(t) = E[X e^(tX)] and so M′(0) = E[X]. Differentiating again gives M″(0) = E[X²], and in general the nth derivative at zero is E[X^n], as the MIT 18.440 notes show.
Mean: E[X] = M′(0)
Second moment: E[X²] = M″(0)
Variance: Var(X) = M″(0) − (M′(0))²
Equivalently, expand e^(tX) as a power series and take expectations term by term, using linearity of expectation: the coefficient of t^k/k! is E[X^k].
Worked example: the binomial and Poisson MGFs
Binomial. For X ~ Binomial(n, p), M(t) = (1 − p + pe^t)^n, as derived in the MIT 18.440 notes. Differentiate:
M′(t) = n(1 − p + pe^t)^(n−1) × pe^t, so M′(0) = np.
M″(t) = n(n − 1)(1 − p + pe^t)^(n−2) × p²e^(2t) + n(1 − p + pe^t)^(n−1) × pe^t, so M″(0) = n(n − 1)p² + np.
Var(X) = n(n − 1)p² + np − n²p² = np(1 − p).
With n = 10 and p = 0.3: M′(0) = 3, M″(0) = 90 × 0.09 + 3 = 11.1, and the variance is 11.1 − 9 = 2.1, which matches np(1 − p).
Poisson. For X ~ Poisson(λ), summing e^(tk) × e^(−λ)λ^k/k! over k gives M(t) = exp(λ(e^t − 1)). Then M′(t) = λe^t M(t), so M′(0) = λ. Next, M″(t) = λe^t M(t) + (λe^t)² M(t), so M″(0) = λ + λ², and Var(X) = λ + λ² − λ² = λ. Mean and variance are both λ.
Why is the MGF of a sum the product of the MGFs?
If X and Y are independent, e^(t(X+Y)) = e^(tX) × e^(tY), and independence lets the expectation split, so M of X + Y equals M_X(t) × M_Y(t), as the MIT 18.440 notes show. For a sum of n independent copies of X, the MGF is M_X(t)^n.
A single Bernoulli(p) trial has M(t) = 1 − p + pe^t. Raise it to the power n and you get the binomial MGF: a binomial count is a sum of n independent trials.
If X ~ Poisson(2) and Y ~ Poisson(3) are independent, the product is exp(2(e^t − 1)) × exp(3(e^t − 1)) = exp(5(e^t − 1)), the Poisson(5) MGF.
That last step rests on the uniqueness theorem in the MIT 6.436 notes: if M(t) is finite on an interval around 0, it determines the distribution. So matching a known MGF is a complete proof. For dependent variables, see variance of a sum and covariance.
A four-step checklist for MGF problems
Write M(t) = E[e^(tX)] as a sum (discrete) or an integral (continuous), and confirm it is finite near t = 0.
For moments, differentiate first and set t = 0 last.
For sums, check independence before you multiply MGFs.
Match the result to a known MGF, name the distribution, and say that uniqueness justifies it.
A common slip in step 4:(1 − p + pe^t)^m × (1 − p + pe^t)^n is the Binomial(m + n, p) MGF, but with two different values of p the product matches no binomial MGF.
If a step feels shaky, the Fermi Concept Library has a lesson for every concept in mathematics, each with its place in the map. To practise, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.
Redo the Poisson derivation on paper, then the binomial one without looking.


