HomeArticlesStatistics

Error Propagation & Uncertainty

Every measurement has an uncertainty, and every calculation built on it inherits one — a single formula from calculus tells you exactly how much.

mysimulator teamUpdated June 2026≈ 7 min read▶ Open the simulation

No measurement is exact

Every physical measurement — a length with a ruler, a voltage with a meter, a mass with a scale — comes with an uncertainty, usually reported as a standard deviation sigma around the measured value. When a result z is computed from several such measurements through a formula z = f(x, y, …), the natural question is: how uncertain is z? Simply plugging the central values of x and y into f and ignoring their spread is not an answer — it throws away exactly the information you need.

The first-order propagation formula

Expand f in a Taylor series around the measured (x, y) and keep only the linear term — a good approximation whenever the uncertainties are small compared to how quickly f curves near that point. The variance of z then follows directly from how variance transforms under a linear map:

z = f(x, y)                     (x, y independent)

sigma_z^2 = (df/dx)^2 * sigma_x^2  +  (df/dy)^2 * sigma_y^2

if x, y correlated, add:  + 2 * (df/dx) * (df/dy) * cov(x, y)

The two textbook special cases fall straight out of this rule. For a sum or difference, z = x ± y, both partial derivatives are 1, so absolute uncertainties add in quadrature: sigma_z = sqrt(sigma_x² + sigma_y²). For a product or ratio, z = xy or z = x/y, the relative uncertainties add in quadrature instead: (sigma_z/z)² = (sigma_x/x)² + (sigma_y/y)². Either way, uncertainties from independent sources never simply add — they add in quadrature, which is why one dominant source of error usually swamps several smaller ones rather than a long list of comparable contributors piling up linearly.

live demo · random samples of x and y building the distribution of z● LIVE

Checking it with Monte Carlo

The analytical formula assumes linearity, but you can sidestep that assumption entirely: draw thousands of samples of x from a normal distribution with mean x̄ and standard deviation sigma_x, do the same for y, compute z = f(x, y) for every sampled pair, and look at the empirical standard deviation of the resulting z values. For a mildly nonlinear f and small-to-moderate sigma_x, sigma_y, the Monte Carlo standard deviation converges to the same number the analytical formula predicts — a satisfying and genuinely useful sanity check, because it validates the linear approximation without requiring you to symbolically differentiate anything.

Where the formula quietly breaks

The Taylor expansion is only a local, linear approximation, so it fails whenever f is significantly curved over the range spanned by the input uncertainties. A ratio near a denominator that can be close to zero, an angle near a point of maximal trigonometric curvature, or simply a large sigma relative to how fast f changes — all of these make the true distribution of z skewed, sometimes strongly, and can even make it bimodal. In those cases the reported sigma_z from the linear formula is still a number, but it is quietly wrong, and only Monte Carlo sampling of the true nonlinear f reveals the real shape of the uncertainty.

Correlated inputs

If x and y are measured with a shared systematic effect — the same miscalibrated instrument, the same background subtraction — they are correlated, and dropping the covariance term silently under- or over-states sigma_z depending on the sign of the correlation and the signs of the partial derivatives. Positive correlation combined with partial derivatives of the same sign makes errors reinforce rather than partially cancel, which is why careful uncertainty budgets in physics and metrology always report a full covariance matrix rather than a list of independent sigmas whenever the measurements share instrumentation or calibration.

Frequently asked questions

What is the error propagation formula for a function of several variables?

For z = f(x, y) with x and y independent and their uncertainties small relative to the curvature of f, the variance of z is approximately sigma_z^2 = (df/dx)^2 * sigma_x^2 + (df/dy)^2 * sigma_y^2, where the partial derivatives are evaluated at the measured values of x and y. It generalizes to any number of variables by summing one such term per variable, plus covariance terms if the variables are correlated.

When does the simple error propagation formula fail?

It is a first-order (linear) Taylor approximation, so it breaks down when the input uncertainties are large relative to the function's curvature, or when f is strongly nonlinear near the measured point — for example near a singularity, a ratio with a denominator close to zero, or a trigonometric function near a point of high curvature. In those cases the true distribution of z can be skewed or even bimodal, and only a full Monte Carlo simulation captures it correctly.

Why does correlation between x and y change the answer?

If x and y are not independent, an extra term 2 * (df/dx) * (df/dy) * cov(x,y) must be added to the variance formula. Positive correlation with partial derivatives of the same sign increases sigma_z beyond what the independent formula predicts, because errors in x and y tend to push z in the same direction rather than partially cancelling.

Try it live

Everything above runs in your browser — open Error Propagation & Uncertainty and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Error Propagation & Uncertainty simulation

What did you find?

Add reproduction steps (optional)