# Propagation of Error with Single and Multiple Independent Variables

## Summary

Often it is necessary to calculate the uncertainty of derived quantities. This procedure and convention is called propagation of error. Calculating the propagation of error formula requires knowing how to take derivatives/ We give the propagation of error formulas for a single variable and multiple independent variable functions. We list some common error propagation formulas that work in most cases. Step by step error propagation can often be used as a shortcut to calculate the uncertainty.

If we know the error propagation formula we can find the terms that are causing the most uncertainty and try to reduce these dominant errors. It is useful to write a short MATLAB script to calculate error propagation, especially when the formula is complex or a lot of significant digits are involved.

## How error propagates

As a math problem, I ask you to add 5.2 and 10.11. The result is straightforward 15.31. The numbers have different numbers of digits and precision. 5.2 is precise to the tenths while 10.11 is precise to the hundredths. This is not a problem in mathematics, but the situation is more subtle in error analysis. To see what is going on you need to look at the uncertainties.

Now, if I ask you to add and then what do you do? The first thing you want to ask yourself is if these numbers are properly reported measurements. After a quick check, we see there are two digits of uncertainty that match the precision of the measurement. In error analysis, you still add the numbers to find the sum, but to find the combined error we need a propagation of error formula. In this situation, the rule is

This chapter is all about finding the rules like this. We can now calculate the uncertainty and round to two significant digits. Then we match the precision of the calculated quantity to the uncertainty. Our final result is that

Notice that if you always start with uncertainties that have two significant digits, you get out a result that has two significant digits of uncertainty. You don’t have to worry that the first number 5.2 has only two significant digits, but the final result 15.3 has three significant digits. This comes about naturally by the golden rule of two significant digits of uncertainty.

There are error propagation rules for single variable functions and multiple variable functions. The single variable situation is not too complicated. You just need to understand differential calculus. For the situation with multiple variables functions, you have to worry if the variables are correlated or independent. In most cases, we don’t have to worry about correlations and the formulas are straightforward.

## Rules of differential calculus refresher

We now do a little review of differentiation because we need derivatives for error propagation. Ordinary derivatives are needed for a single variable function, and partial derivatives are needed for multiple variable functions. The derivative is defined in calculus as

The following list contains the basic formulas to master differential calculus.

The partial derivative is like the normal derivative except you hold the other variables constant when you take it. Here is the definition

For example, if we wanted to find all the partial derivatives of we would use the power rule .

There are three possible partial derivatives

## Error propagation with one variable

If we have measured then the uncertainty in is given by

I assume you are familiar with differentiation. One can use a program like Mathematica or your graphing CAS calculator to find derivatives.

Example. The volume of a cube from error propagation.

Suppose a machinist has constructed a precise cube on a milling machine, and you want to find its volume. You repeatedly measure one of the sides to be

What is the volume and its uncertainty assuming the length, width, and height are identical?

We calculate the volume as and wait to round until we know the uncertainty.

To find the uncertainty we use the error propagation formula

After rounding we get .

## Error propagation with multiple independent variables

Often we want to calculate some quantity that requires a series of individual measurements that must be combined. For example, if we wanted to calculate we would first measure then measure and then we could calculate . If we are doing error analysis, then to find the error in we will need to apply a formula of error propagation. There is a significant simplification if the two quantities are thought to be independent like the charge and mass of an electron. The error propagation formula for multiple independent variables labeled is given by

We will often use the notation that for simplification when we do calculations. Propagation of error for two independent variables is given by

Example. Show that .

Evaluating the partial derivatives

Applying the error propagation formula we have

Example. Find the perimeter of a rectangle of and .

The perimeter is equal to

We can find the perimeter by plugging in the values

We can find the uncertainty by applying the propagation of error formula

Our final answer is

Example. If , then show that

Evaluating the partial derivatives

Applying the error propagation formula we have

Divide both sides by .

Example. If , then show that

Evaluating the partial derivatives

Applying the error propagation formula we have

Divide both sides by .

## Common error formulas

then

then

then

then

then

then

Many formulas in physics are of the last form. For example, or .

## Error propagation step by step

Suppose we want to compute the error in the formula

It is convenient to do it step by step. Find the uncertainty in the numerator and denominator individually then combine the results.

We can let and then find the uncertainties in and first.

We can then calculate the uncertainty for which would be

You can check for yourself that you get the same result as if you did the calculation in one step.

If the formula was

then we couldn’t do it step by step the same way because the numerator and the denominator contain the same variables that repeat. The partial derivatives of the numerator and denominator cannot be separated.

## The dominant error

The error propagation formula tells you where you should focus your efforts if you want to reduce the uncertainty in a derived quantity.

Example. Suppose you are calculating from experiments with a pendulum with small oscillations.

If the fractional uncertainty in the length and period are both ten percent, then how should you proceed to improve the experimental determination of ?

The error propagation formula for this situation.

We can easily write down the error propagation formula

If the fractional uncertainty in the length is 10 percent and the fractional uncertainty in the period is 10 percent then the expression in the square root is

Clearly measuring the period more precisely will have the largest effect on reducing the dominant error in the uncertainty.

## MATLAB examples

Example. Finding the uncertainty in .

Let find and the uncertainty.

We know that . So we easily calculate the uncertainty using

Here is what the Matlab code looks like to calculate that.

format long;

N = 3.2524;

sigN = 0.0035;

f = exp(N)

sigf = exp(N)*sigN

>> f = 25.852311068629906

>> sigf = 0.090483088740205

We do the rounding and find

Example. Finding the uncertainty in .

What is the uncertainty in when ?

First, we convert the numbers to radians. The error propagation formula is then

It is easy to do all these calculations in Matlab.

format long;

t = 30;

sigt = 2.5;

trad = 30 * pi/180;

sigtrad = 2.5 * pi/180;

df = cos(trad)*sigtrad

f = sin(trad)

>> 0.03778748675488

>> 0.50000000000000

So the answer is .

Example. Finding the Stefan-Boltzmann constant and its uncertainty.

What is the value and uncertainty of the Stefan-Boltzmann constant

It’s funny that the notation for the Stefan-Boltzmann constant is already , don’t get confused.

The propagation of error formula is a common one.

Since is defined it has no uncertainty. Also constant factors like or have no uncertainty.

A quick google for “NIST hbar”, “NIST c”, and “NIST Boltzmann’s constant” gives the necessary data.

format long;

hb = 1.054571800e-34;

shb = 0.000000013e-34;

c = 299792458;

kb = 1.38064852e-23;

skb = 0.00000079e-23;

SB = pi^2/60 * kb^4/(c^2*hb^3)

sigSB = SB*(16*skb^2/kb^2+9*shb^2/hb^2)^(0.5)

>> 5.670366818327269e-08

>> 1.297991325923970e-13

The uncertainty is J msK. So the final result is

This calculation agrees with the NIST 2016 value.

Comments are Disabled