Tutorials › Calculus I › Chain-Rule Error Propagation In Nested Models

Linearization and Differentials · Tutorial 625 of 1495

Chain-Rule Error Propagation In Nested Models

Use the chain rule to find how a small input uncertainty is amplified or reduced as it passes through a sequence of functions.

Intermediate 9 min read

What You'll Learn

  • Represent a nested model as a composition of simpler stages.
  • Evaluate each stage’s derivative at the correct input value.
  • Multiply stage sensitivities to obtain the total derivative.
  • Convert an input uncertainty into a first-order output uncertainty.
  • Distinguish a signed predicted change from a worst-case uncertainty estimate.
  • Recognize why omitting an inner derivative gives an incorrect result.

Why nested models need the chain rule

A measured quantity often passes through several calculations before it becomes the output of a model. A sensor reading might first be converted into an intermediate quantity, then used in another formula. Even if each stage is simple, an error in the original measurement can affect every later stage.

The chain rule provides a direct way to track this effect. It tells us how the output changes with the original input by multiplying the derivatives of the stages. The resulting derivative is a local sensitivity: it estimates the output change per unit change in the input near the measured value.

For a small measurement uncertainty, this sensitivity gives a first-order estimate of the corresponding output uncertainty. It is an estimate based on linearization, not an exact guarantee about finite changes.

Nested models and propagated uncertainty

Suppose an input \(x\) passes through an intermediate stage \(u=g(x)\), followed by an output stage \(y=h(u)\). The complete model is the composition \(y=h(g(x))\). Assume \(g\) is differentiable at the input value \(x_0\), and \(h\) is differentiable at the intermediate value \(u_0=g(x_0)\).

Definition: The first-order sensitivity of the nested output \(y=h(g(x))\) to the input \(x\) at \(x_0\) is \(h'(g(x_0))g'(x_0)\). If the input has a small absolute uncertainty \(\delta x\), the corresponding first-order output uncertainty is estimated by \(\delta y \approx |h'(g(x_0))g'(x_0)|\,\delta x\).

The absolute value is used when estimating the size of a worst-case output change from a bounded input uncertainty. For a signed predicted change \(dx\), keep the sign instead: \(dy=h'(g(x_0))g'(x_0)\,dx\). Thus the derivative gives both direction and scale, while the absolute value gives a nonnegative uncertainty magnitude.

For more than two stages, multiply one derivative for each stage. Each derivative must be evaluated at the input value actually received by that stage—not automatically at the original measurement.

$$ x \longrightarrow u_1=g_1(x) \longrightarrow u_2=g_2(u_1) \longrightarrow \cdots \longrightarrow y=g_n(u_{n-1}) $$
Rule: For a differentiable nested model \(y=g_n(\cdots g_2(g_1(x))\cdots)\), the derivative with respect to \(x\) is the product of the stage derivatives, evaluated successively at the corresponding intermediate values. The first-order worst-case output uncertainty is approximately the absolute value of that product times \(\delta x\).

Why the sensitivities multiply

The multiplication follows from how small changes pass from one stage to the next. For a small input change \(dx\), the first stage predicts an intermediate change \(du \approx g'(x_0)\,dx\). The second stage then predicts \(dy \approx h'(u_0)\,du\). Substituting the first estimate into the second gives \(dy \approx h'(u_0)g'(x_0)\,dx\).

This argument describes the first-order estimate. The derivative result itself can be justified by tracking the remainders in the differentiability statements. Write \(\Delta x\) for a small finite input change and \(\Delta u=g(x_0+\Delta x)-g(x_0)\). Differentiability of \(g\) gives

$$ \Delta u=g'(x_0)\Delta x+o(\Delta x). $$

Here \(o(\Delta x)\) denotes a remainder which, divided by \(\Delta x\), tends to zero as \(\Delta x\) tends to zero. In particular, \(\Delta u=O(\Delta x)\): the intermediate change is at most of first order in the input change near \(x_0\). Differentiability of \(h\) at \(u_0=g(x_0)\) gives

$$ h(u_0+\Delta u)-h(u_0) =h'(u_0)\Delta u+o(\Delta u). $$

Substitute the expression for \(\Delta u\). Since \(\Delta u=O(\Delta x)\), the remainder \(o(\Delta u)\) is also \(o(\Delta x)\). Therefore

$$ \begin{aligned} h(g(x_0+\Delta x))-h(g(x_0)) &=h'(u_0)\bigl(g'(x_0)\Delta x+o(\Delta x)\bigr)+o(\Delta x)\\ &=h'(u_0)g'(x_0)\Delta x+o(\Delta x). \end{aligned} $$

Dividing by \(\Delta x\) and taking the limit as \(\Delta x\) tends to zero proves that the derivative of the composition at \(x_0\) is \(h'(g(x_0))g'(x_0)\). The product is not a convenient shortcut unrelated to the model: it records the two successive changes, from \(x\) to \(u\) and then from \(u\) to \(y\).

Worked Example: A logarithm of a scaled square

Worked Example: A logarithm of a scaled square

Let \(x\) be a measured length with \(x_0=1.00\ \text{m}\) and absolute uncertainty \(\delta x=0.02\ \text{m}\). Consider the dimensionless output \(y=\ln(1+(x/L)^2)\), where the fixed reference length is \(L=1.00\ \text{m}\). Estimate the first-order uncertainty in \(y\).

Separate the model into an inner and an outer stage:

$$ u=g(x)=\left(\frac{x}{L}\right)^2, \qquad y=h(u)=\ln(1+u). $$

At the measured value, the intermediate value is \(u_0=(1.00\ \text{m}/1.00\ \text{m})^2=1\). The corresponding output is \(y_0=\ln(1+1)=\ln 2\).

Differentiate the inner stage with respect to \(x\), treating \(L\) as constant:

$$ g'(x)=\frac{2x}{L^2}, \qquad g'(x_0)=\frac{2(1.00\ \text{m})}{(1.00\ \text{m})^2} =2.00\ \text{m}^{-1}. $$

Differentiate the outer stage and evaluate it at \(u_0=1\):

$$ h'(u)=\frac{1}{1+u}, \qquad h'(u_0)=\frac{1}{1+1}=\frac12. $$

Multiply the sensitivities. The total sensitivity has units of inverse metres, as required for a dimensionless output changing in response to a length input.

$$ \left.\frac{dy}{dx}\right|_{x_0} =h'(u_0)g'(x_0) =\frac12(2.00\ \text{m}^{-1}) =1.00\ \text{m}^{-1}. $$

The estimated output uncertainty is therefore

$$ \delta y\approx (1.00\ \text{m}^{-1})(0.02\ \text{m}) =0.02. $$

Check: Differentiating the original expression gives \(dy/dx=2x/[L^2(1+(x/L)^2)]\). At \(x=L=1.00\ \text{m}\), this is \(2.00/[2(1.00\ \text{m})]=1.00\ \text{m}^{-1}\), agreeing with the product of the stage derivatives.

Worked Example: A trigonometric stage inside a square root

Worked Example: A trigonometric stage inside a square root

Suppose an angle is measured as \(\theta_0=0\ \text{rad}\) with uncertainty \(\delta\theta=0.01\ \text{rad}\). For the dimensionless model \(y=\sqrt{5+\sin\theta}\), estimate the first-order output uncertainty. Angles are measured in radians.

Set \(u=g(\theta)=5+\sin\theta\) and \(y=h(u)=\sqrt{u}\). At the measured angle, \(u_0=5+\sin 0=5\), so \(y_0=\sqrt{5}\). The inner derivative is \(g'(\theta)=\cos\theta\), giving \(g'(0)=\cos 0=1\).

The outer derivative is \(h'(u)=1/(2\sqrt{u})\), so \(h'(u_0)=1/(2\sqrt{5})\). The chain-rule sensitivity is

$$ \left.\frac{dy}{d\theta}\right|_{\theta=0} =\frac{1}{2\sqrt{5}}(1) =\frac{1}{2\sqrt{5}}\ \text{per radian}. $$

Multiplying by the angle uncertainty gives

$$ \delta y\approx\frac{0.01\ \text{rad}}{2\sqrt{5}\ \text{rad}} =\frac{0.01}{2\sqrt{5}} \approx 0.00224. $$

The final value is rounded to five decimal places; the radian unit cancels in the sensitivity-times-uncertainty product. Check: Differentiating the original model gives \(dy/d\theta=\cos\theta/[2\sqrt{5+\sin\theta}]\). At \(\theta=0\), this is \(1/(2\sqrt{5})\), matching the chain-rule result.

Worked Example: An exponential of a reciprocal

Worked Example: An exponential of a reciprocal

Let a measured length be \(x_0=2.00\ \text{m}\), with uncertainty \(\delta x=0.04\ \text{m}\). Consider \(y=e^{a/x}\), where the fixed length \(a=3.00\ \text{m}\). The exponent is dimensionless. Estimate the first-order output uncertainty.

Choose \(u=g(x)=a/x\) and \(y=h(u)=e^u\). At the measured value, \(u_0=(3.00\ \text{m})/(2.00\ \text{m})=1.50\), and \(y_0=e^{1.50}\). The inner derivative is

$$ g'(x)=-\frac{a}{x^2}, \qquad g'(x_0)=-\frac{3.00\ \text{m}}{(2.00\ \text{m})^2} =-0.75\ \text{m}^{-1}. $$

The outer derivative is \(h'(u)=e^u\), so \(h'(u_0)=e^{1.50}\). The total signed sensitivity is \(dy/dx=-0.75e^{1.50}\ \text{m}^{-1}\). Its negative sign means that increasing \(x\) locally decreases \(y\). For the worst-case uncertainty magnitude, use the absolute value:

$$ \delta y\approx (0.75e^{1.50}\ \text{m}^{-1})(0.04\ \text{m}) =0.03e^{1.50} \approx 0.13445. $$

The final estimate is rounded to five decimal places. Check: Direct differentiation gives \(dy/dx=e^{a/x}(-a/x^2)\). At \(x=2.00\ \text{m}\), this is \(e^{1.50}(-0.75\ \text{m}^{-1})\), exactly the sensitivity found by multiplying the stage derivatives.

A common mistake: skipping an intermediate derivative

For \(y=\sqrt{5+\sin\theta}\) at \(\theta=0\), one might incorrectly use only the derivative of the square-root stage and write \(dy/d\theta=1/(2\sqrt{5})\) without accounting for how \(\sin\theta\) changes with \(\theta\). That calculation happens to give the correct number at zero because \(d(5+\sin\theta)/d\theta=\cos 0=1\). It is not a valid general rule.

At \(\theta=\pi/3\), the intermediate value is \(u=5+\sqrt{3}/2\), and the inner derivative is \(\cos(\pi/3)=1/2\). The correct sensitivity is \((1/2)(1/[2\sqrt{5+\sqrt{3}/2}])\); omitting the inner derivative gives twice this value. The correction is to identify every stage, evaluate its derivative at the stage’s input, and multiply all of them.

Interpreting the result

Chain-rule error propagation is useful whenever a measurement is transformed through a sequence of formulas. The total derivative compresses the local effect of all those stages into one sensitivity at the measured input. A large absolute sensitivity means a small input uncertainty can produce a larger output change; a small one means the model locally dampens that change.

The estimate is most informative when the uncertainty is small enough that the model is well approximated by its tangent near the measured value. It does not by itself give an exact bound for a finite input interval. The sign of the derivative describes the direction of the predicted change, while the absolute value describes its estimated magnitude. No probability model is assumed: this is a first-order propagation of a bounded measurement uncertainty, not a statistical combination of random errors.

Check Your Understanding

For each question, identify the stage values before multiplying the derivatives.

  1. For \(y=(3x+1)^2\) at \(x=1\), what are the inner value, the two stage derivatives, and the total derivative?
  2. If the model has three differentiable stages, how do you obtain the derivative of the final output with respect to the original input?
  3. Why is an absolute value used when converting a bounded input uncertainty into a worst-case output uncertainty?
  4. For \(y=e^{2x}\), identify an inner and outer function, then write the chain-rule derivative.
  5. What does a negative total sensitivity tell you, and what does it not tell you about the size of the uncertainty?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon