Skip to content

Chain rule

Differentiate a composition by multiplying its local sensitivities. Trace a factor through a discount rate to a bond price, with the inner derivative and units intact.

The chain rule differentiates a composite function: one function applied to the output of another. It multiplies the outer function's local sensitivity by the inner function's local sensitivity. In finance, that converts exposure to a pricing input into exposure to the factor that moves that input.

If y=f(u)y=f(u) and u=g(x)u=g(x), then

dydx=f′(g(x))g′(x)=dydududx.\frac{dy}{dx}=f'(g(x))g'(x) =\frac{dy}{du}\frac{du}{dx}.
This holds when gg is differentiable at xx and ff is differentiable at g(x)g(x). Evaluate the outer derivative at the inner value, then multiply by the inner derivative. The notation resembles cancelling dudu, but the result is a theorem about differentiable functions, not permission to cancel arbitrary derivative symbols. OpenStax, §3.6, gives the rule and its conditions.

A factor moves a rate, and the rate moves a price

Consider a hypothetical zero-coupon bond paying a certain USD 100 in exactly two years. Its present value, using a continuously compounded annual discount rate rr expressed in decimals, is
P(r)=100e−2r.P(r)=100e^{-2r}.

Suppose a dimensionless model factor xx determines that rate through

r(x)=0.03+0.5x.r(x)=0.03+0.5x.

The cash flow and two-year maturity stay fixed. This is an assumed scenario mapping, not an estimated market relationship. At x=0.04x=0.04, the rate is r=0.05r=0.05, or 5% per year, and

P=100e−0.1≈USD 90.483742.P=100e^{-0.1}\approx \text{USD }90.483742.

There are two links to differentiate:

dPdr=−2P,drdx=0.5.\frac{dP}{dr}=-2P, \qquad \frac{dr}{dx}=0.5.

Therefore,

ddxP(r(x))=dPdrdrdx=(−2P)(0.5)=−P≈−90.483742.\frac{d}{dx}P(r(x)) =\frac{dP}{dr}\frac{dr}{dx} =(-2P)(0.5) =-P \approx -90.483742.
The answer is USD per unit of xx. The intermediate sensitivity dP/dr≈−180.967484dP/dr\approx-180.967484 is USD per unit of annual decimal rate. Multiplying by the rate loading 0.50.5 converts it to exposure to xx.
A dimensionless factor x of 0.04 maps to an annual decimal rate of 0.05 and present value USD 90.483742. The price-rate sensitivity is minus 180.967484; multiplying by the rate loading 0.5 gives minus 90.483742 USD per unit x. Omitting 0.5 doubles the exposure.
A dimensionless factor x of 0.04 maps to an annual decimal rate of 0.05 and present value USD 90.483742. The price-rate sensitivity is minus 180.967484; multiplying by the rate loading 0.5 gives minus 90.483742 USD per unit x. Omitting 0.5 doubles the exposure.
Original hypothetical sensitivity diagram. The certain USD 100 payment and two-year maturity are fixed; discounting is continuous. Bottom-panel price changes are first-order estimates.
For an input increase Δx=0.0001\Delta x=0.0001, the rate increases by 0.000050.00005, or half a basis point. The first-order estimate is
ΔP≈dPdxΔx=−90.4837418(0.0001)≈−USD 0.009048374.\Delta P\approx\frac{dP}{dx}\Delta x =-90.4837418(0.0001) \approx-\text{USD }0.009048374.
Repricing exactly at x=0.0401x=0.0401 gives USD 90.474694, a change of approximately −USD 0.009047922. The small difference arises because the derivative gives a local linear approximation to a curved price function.

Forgetting dr/dx=0.5dr/dx=0.5 would produce an estimated change of −USD 0.018096748, twice the correct first-order exposure. It would answer the rate-bump question while using the factor's bump size.

Find the layers before differentiating

For the bond example, substitution gives an independent way to see the same answer:

P(r(x))=100e−2(0.03+0.5x)=100e−0.06−x.P(r(x))=100e^{-2(0.03+0.5x)} =100e^{-0.06-x}.

Differentiating the last expression yields −100e−0.06−x=−P-100e^{-0.06-x}=-P. The two approaches agree because they describe the same function.

More generally, common patterns are

ddxeg(x)=eg(x)g′(x),ddx[g(x)]n=n[g(x)]n−1g′(x),\begin{aligned} \frac{d}{dx}e^{g(x)}&=e^{g(x)}g'(x),\\ \frac{d}{dx}[g(x)]^n&=n[g(x)]^{n-1}g'(x), \end{aligned}
where the expressions and required derivatives exist. With three layers, f(g(h(x)))f(g(h(x))), multiply three local derivatives: f′(g(h(x)))g′(h(x))h′(x)f'(g(h(x)))g'(h(x))h'(x). Identifying the layers first makes omitted factors easier to catch. See MIT's chain-rule explanation for further composition examples.

Units also reveal hidden layers. If a screen displays the rate as q=100rq=100r, so that q=5q=5 means 5%, then dr/dq=0.01dr/dq=0.01 and dP/dq=0.01 dP/drdP/dq=0.01\,dP/dr. A sensitivity per percentage point differs from one per unit of decimal rate. Always specify the coordinate being bumped.

When there is more than one route

For differentiable functions VV, aa and bb, if V(a,b)V(a,b) depends on two inputs that both respond to xx, the total derivative adds the contributions from both routes:

ddxV(a(x),b(x))=∂V∂aa′(x)+∂V∂bb′(x).\frac{d}{dx}V(a(x),b(x)) =\frac{\partial V}{\partial a}a'(x) +\frac{\partial V}{\partial b}b'(x).
Each partial derivative holds the other pricing input fixed. If only aa responds to xx, then b′(x)=0b'(x)=0 and the second route contributes nothing. A risk report must state which inputs move together; the chain rule propagates that specified mapping without establishing that it is causal.
Finally, differentiating a pricing formula with respect to a scenario input is different from transforming an entire stochastic price process. Brownian paths are not ordinary differentiable time paths. Itô's lemma includes a second-derivative correction driven by quadratic variation; the ordinary first-derivative chain alone is insufficient for that task. Tehranchi's notes, Chapter 2, §§3–4, explain the distinction.

Further reading

If the inner/outer split is unfamiliar, the free public Transformations, Compositions, and Building New Functions sample, especially its Composition section, shows how to identify the order of operations and check the domain before differentiating.

Sources

Last updated
  • calculus
  • composition
  • sensitivity
  • discounting
  • units
← Back to the glossaryBack to top ↑