Moment Generating Function Calculator for a Normal Random Variable
Use this premium calculator to compute the moment generating function of a normal random variable with mean μ and standard deviation σ at any real input t. The tool also graphs the normal MGF across a user-defined t-range so you can visualize how parameter changes affect exponential growth.
How to Calculate the Moment Generating Function of a Normal Random Variable
The moment generating function, usually abbreviated as MGF, is one of the most useful analytical tools in probability theory. For a random variable X, the MGF is defined as MX(t) = E[etX] whenever that expectation exists in an open interval around t = 0. For a normal random variable, the MGF exists for every real t, which makes the normal distribution especially elegant and mathematically convenient. If X follows a normal distribution with mean μ and variance σ², written X ~ N(μ, σ²), then its MGF has a closed form:
MX(t) = exp(μt + 0.5σ²t²).
This compact formula is far more than a symbolic identity. It encodes every finite moment of the distribution. By differentiating the MGF and evaluating at t = 0, you recover the mean, second moment, variance, and higher-order moments. That is one reason normal MGFs appear in statistics, econometrics, actuarial science, engineering, and machine learning. The calculator above automates this computation, but understanding the underlying method will make the result more meaningful.
Why the Normal Distribution Has Such a Clean MGF
The normal distribution is stable under addition, affine transformation, and many analytical operations. These features make it a central object in probability. When you compute E[etX] for a normal variable, the exponential term combines neatly with the Gaussian density. After rearranging the exponent and completing the square, the integral collapses into the integral of another normal density, which equals 1 after proper normalization. What remains is the factor exp(μt + 0.5σ²t²). This derivation is one of the classic demonstrations of the power of Gaussian algebra.
If X is standard normal, so X ~ N(0,1), then the formula becomes even simpler:
MX(t) = exp(0.5t²).
If the mean is shifted away from zero, the linear term μt tilts the exponent. If the variance grows, the quadratic term 0.5σ²t² becomes larger, causing the MGF to rise more quickly for positive and negative values of t. That is why the chart in the calculator often becomes steep when σ is large.
Step-by-Step Procedure
- Identify the normal parameters. Determine the mean μ and standard deviation σ. Remember that variance is σ².
- Choose the point t where you want to evaluate the MGF.
- Substitute into the formula MX(t) = exp(μt + 0.5σ²t²).
- Compute the exponent μt + 0.5σ²t².
- Apply the exponential function to get the final MGF value.
For example, suppose X ~ N(3, 4), which means μ = 3 and σ = 2. If t = 0.5, then:
MX(0.5) = exp(3 × 0.5 + 0.5 × 4 × 0.5²) = exp(1.5 + 0.5) = exp(2) ≈ 7.389056.
The calculator performs exactly this substitution and shows the result instantly, along with related quantities such as M′(0) and Var(X).
What the MGF Tells You About Moments
The name “moment generating function” comes from the fact that derivatives of the MGF at zero generate moments of the distribution. Specifically:
- MX(0) = 1
- M′X(0) = E[X] = μ
- M″X(0) = E[X²] = μ² + σ²
- Var(X) = M″X(0) – (M′X(0))² = σ²
For the normal distribution, this is especially valuable because many higher moments can also be recovered from repeated differentiation. Even if you are primarily interested in mean and variance, the MGF gives you a single generating object from which those values naturally emerge.
| Distribution | Parameters | MGF | Existence Range | Notes |
|---|---|---|---|---|
| Normal | μ, σ² | exp(μt + 0.5σ²t²) | All real t | Extremely convenient in theory and applications |
| Exponential | Rate λ | λ / (λ – t) | t < λ | Defined only on a restricted interval |
| Poisson | Mean λ | exp(λ(et – 1)) | All real t | Useful for sums of counts |
| Gamma | Shape k, rate θ | (1 – t/θ)-k | t < θ | Another example with a restricted domain |
Deriving the Formula by Completing the Square
To understand why the normal MGF takes the form exp(μt + 0.5σ²t²), start with the density of X ~ N(μ, σ²):
f(x) = 1 / (σ√(2π)) × exp(-(x – μ)² / (2σ²)).
Then:
MX(t) = ∫ etx f(x) dx = ∫ etx [1 / (σ√(2π))] exp(-(x – μ)² / (2σ²)) dx.
Combine the exponent terms into one expression. After algebraic simplification, complete the square in x. The resulting integrand becomes a constant factor times a properly centered normal density. Because the integral of a normal density over the real line equals 1, the full integral reduces to:
exp(μt + 0.5σ²t²).
This derivation highlights a deeper idea: exponential tilting of a normal distribution produces another normal-shaped kernel. That is part of why the Gaussian family is analytically tractable.
Connection to the Standard Normal
Any normal variable can be written as X = μ + σZ, where Z ~ N(0,1). Using this representation, the MGF derivation becomes even shorter:
- MX(t) = E[et(μ + σZ)]
- = eμt E[eσtZ]
- = eμt MZ(σt)
- = eμt exp(0.5σ²t²)
- = exp(μt + 0.5σ²t²)
This representation is often the quickest route in an upper-level statistics class because it builds the general normal case from the standard normal case.
Worked Examples with Realistic Values
Suppose a measurement process in quality control produces approximately normal readings with mean 100 and standard deviation 15. If you want the MGF at t = 0.02, the exponent is 100(0.02) + 0.5(15²)(0.02²) = 2 + 0.045 = 2.045. Therefore:
MX(0.02) = e2.045 ≈ 7.729.
Now consider a finance-style example where continuously compounded log returns are modeled as normal with mean 0.001 and standard deviation 0.02 over a short interval. At t = 1, the MGF is exp(0.001 + 0.5 × 0.0004) = exp(0.0012) ≈ 1.001201. This small number above 1 reflects the scale of the parameters. The formula is the same in both examples; only the interpretation changes.
| μ | σ | t | Exponent μt + 0.5σ²t² | MGF Value |
|---|---|---|---|---|
| 0 | 1 | 0.5 | 0.125 | 1.133148 |
| 3 | 2 | 0.5 | 2.000 | 7.389056 |
| 100 | 15 | 0.02 | 2.045 | 7.729357 |
| 0.001 | 0.02 | 1 | 0.0012 | 1.001201 |
How the MGF Helps with Sums of Independent Normals
One of the strongest reasons to learn MGFs is that they convert sums into products. If X and Y are independent, then the MGF of X + Y satisfies:
MX+Y(t) = MX(t)MY(t).
For independent normal variables X ~ N(μ1, σ1²) and Y ~ N(μ2, σ2²), this gives:
exp(μ1t + 0.5σ1²t²) × exp(μ2t + 0.5σ2²t²) = exp((μ1 + μ2)t + 0.5(σ1² + σ2²)t²).
That is exactly the MGF of a normal distribution with mean μ1 + μ2 and variance σ1² + σ2². This proves that sums of independent normals are normal. In statistics, this fact underpins inference about sample means, linear combinations of Gaussian errors, and many large-sample approximations.
Common Mistakes to Avoid
- Using variance and standard deviation interchangeably. The formula uses σ², so if your input is standard deviation σ, square it first.
- Forgetting the factor 0.5 in the quadratic term. The correct expression is 0.5σ²t², not σ²t².
- Confusing the MGF with the characteristic function. The characteristic function uses i t instead of t.
- Plugging in a value that is meant to be the variance directly as σ. If your problem states X ~ N(μ, 9), then σ = 3, not 9.
- Misreading notation. Some textbooks write N(μ, σ²), while others use N(μ, σ). Check which convention is being used.
Interpretation of the Chart
The chart generated by the calculator plots MX(t) over your chosen t-range. Because the formula contains a quadratic term in t, the graph generally curves upward rapidly as |t| increases. If μ is positive, the curve tends to be larger on the positive t side than on the negative side. If μ is negative, the asymmetry reverses. Increasing σ makes the curve rise faster on both sides because the variance term is tied to t². In practical use, this visual helps students see why large variance leads to stronger growth in the MGF away from zero.
Authoritative References and Further Reading
For deeper study, consult these high-quality sources:
- StatLect: Normal distribution and related properties
- ProbabilityCourse.com: Normal distribution overview
- Penn State University STAT 414: Probability theory resources
- U.S. Census Bureau: Probability and statistical methodology materials
Final Takeaway
To calculate the moment generating function of a normal random variable, you only need three numbers: μ, σ, and t. Substitute them into MX(t) = exp(μt + 0.5σ²t²). That single expression summarizes the full moment structure of the distribution and makes many proofs in probability nearly effortless. Whether you are studying for an exam, checking a derivation, or building intuition for Gaussian models, mastering this formula is a smart investment. Use the calculator above whenever you want a fast, accurate evaluation and a visual graph of how the MGF behaves across different t-values.