The Chain Rule

A composition is a chain of links, and each link stretches a small change by its own rate. Build a chain and pick x: the number lines carry an interval through it, the stretches multiply, and as the interval shrinks each approaches its link’s derivative, unless a link squashes the interval flat. Then write dy/dx yourself.

The chain rule
In function notation
Loading interactive simulation...

Lesson

The theory — The Chain Rule

If u = g(x) and y = f(u), the rate of the whole chain is the product of the links' rates, dy/dx = f′(g(x))·g′(x). Each rate is taken where its link is working, so the outer rate is evaluated at u = g(x), not at x. A longer chain multiplies one more rate per link.

What each symbol means

u
the value the inner link hands on, u = g(x)
w
in a three-link chain, the value the middle link hands on

Where the formula comes from

  1. Break the change into links. Move x on by Δx. The inner link moves u by Δu, the outer moves y by Δy, and as long as Δu is not 0 the ratio for the whole chain splits into the two links' ratios. On the page that is the stretches of the bands multiplying.
  2. Let Δx shrink. Because g is continuous at x, Δu shrinks with it. The inner ratio tends to g′(x) and the outer one to f′ at the point the outer link is working, u = g(x). The limit of a product is the product of the limits.
  3. The case the split hides. If Δu is 0 for some small Δx, the first line divides by zero. The careful proof gives the outer ratio the value f′(u) whenever Δu = 0. Then the product holds for every Δx, and its limit is the same.
Assumes
Each link has a derivative at the point it works at. Where one does not, as √u has none at 0, the rule says nothing, and the page prints the chain as undefined there.

Problems solved in full

  1. A power of a linear expression 3 steps

    Differentiate y = (3x + 1)⁴ and give the slope at x = 0.

    Open this problem in the tool

    1. Name the links and their rates. The inner link is the linear part, the outer one is the fourth power:

    2. Multiply, outer rate first, and write the result as an exam would, with the constant in front:

    3. At x = 0 the inner value is 1:

    Answer

    dy/dx = 12(3x + 1)³, and 12 at x = 0. The 3 is the step everyone drops: the outer rate alone would give 4(3x + 1)³, a quarter of the true slope. The page shows the two rates as 3 and 4 and their product as 12.

  2. A sine of a square 3 steps

    Differentiate y = sin(x²) and give the slope at x = 1.

    Open this problem in the tool

    Show solution
    1. The links and their rates:

    2. Multiply. The cosine is taken at u = x², where the outer link is working, not at x:

    3. At x = 1:

    Answer

    dy/dx = 2x cos(x²), and 2 cos 1 ≈ 1.0806 at x = 1. The page prints the outer rate there as 0.5403, which is cos 1, because u = x² is 1 at that point.

  3. Where e^(−x²) is flat 3 steps

    Differentiate y = e^(−x²), find where its slope is zero, and give the slope at x = 1.

    Open this problem in the tool

    Show solution
    1. The links and their rates. e to a power is its own derivative:

    2. Multiply:

    3. The exponential is never zero, so only the factor −2x can vanish:

    Answer

    dy/dx = −2x e^(−x²): flat only at x = 0, and −2/e ≈ −0.7358 at x = 1. Left of 0 the slope is positive and right of it negative, so x = 0 is the top of the curve.

  4. A logarithm of a sum 3 steps

    Differentiate y = ln(x² + 1) and give the slope at x = 1.

    Open this problem in the tool

    Show solution
    1. The links and their rates:

    2. Multiply:

    3. At x = 1 the inner value is 2:

    Answer

    dy/dx = 2x/(x² + 1), and exactly 1 at x = 1. The page prints the outer rate as 0.5, which is 1/u at u = 2.

  5. A negative power 3 steps

    Differentiate y = 1/(2x − 1)³ and give the slope at x = 1.

    Open this problem in the tool

    Show solution
    1. Write it as a power first; then the links and their rates follow as before:

    2. Multiply and turn the negative power back into a fraction:

    3. At x = 1 the inner value is 1:

    Answer

    dy/dx = −6/(2x − 1)⁴, and −6 at x = 1. Written as a power, a quotient with a constant on top needs no quotient rule at all.

  6. The cube of a sine 3 steps

    Differentiate y = sin³x and give the slope at x = π/4.

    Open this problem in the tool

    Show solution
    1. sin³x is a cube of sin x, so the power is the outer link and the sine the inner one:

    2. Multiply:

    3. At π/4 the sine and the cosine are both √2/2:

    Answer

    dy/dx = 3 sin²x cos x, and 3√2/4 ≈ 1.0607 at x = π/4. Read sin³x as sin(x³) and you have built a different chain, with the links the other way round.

  7. Three links 3 steps

    Differentiate y = e^(sin(x²)) and give the slope at x = 1.

    Open this problem in the tool

    Show solution
    1. Three links, three rates, each taken where its link is working:

    2. Multiply all three, outer first:

    3. At x = 1:

    Answer

    dy/dx = 2x cos(x²) e^(sin(x²)), about 2.5068 at x = 1. One more link is one more factor, and the method does not change.

  8. How many presses of cos? 4 steps

    A calculator in radians shows 1, and you keep pressing cos. Near p = 0.739085…, where cos p = p, each press multiplies the error by cos′(p) = −sin p = −0.6736. Estimate how many presses bring the display within 10⁻⁶ of p, then check the estimate. Press From x = 1: three presses take 1 to 0.6543, and the slope of the three-link chain there is −0.3273.

    Open this problem in the tool

    Show solution
    1. The error before the first press:

    2. n presses are an n-link chain, and near p every link has the same rate, so the chain rule multiplies n equal factors:

    3. Ask for that to fall below 10⁻⁶ and take logarithms:

    4. The page's three presses test the estimate early, where it is still rough: it predicts −0.0797 and the display is out by −0.0848, because the first presses happen far from p.

    Answer

    32 presses. The estimate says 31.57, so 32, and running the iteration agrees: after 31 presses the error is 1.286×10⁻⁶ and after 32 it is 8.664×10⁻⁷. Each error divided by the one before is −0.7619 at the first press and −0.5960 at the second, and settles on −0.6736 as the presses close in. The page stops at three links.

A forgotten inner factor can pass a check at one point 🖖

Press Forgot the inside. The chain is sin(x²) at x = 2, and the typed answer cos(x²) has left out the inner rate, 2x. There it is wrong by a factor of 4. Now press A one-point check: the same answer at x = 0.5, where 2x is exactly 1, and it agrees with the true slope. A derivative tested at one point proves nothing if the inner rate happens to be 1 there. The page tests 24 points and refuses this one at every one of them.

Three presses of cos turn an error round three times 🖖

Press cos three times. The chain is cos(cos(cos x)) at 0.739085…, the one number cos leaves where it is. Every link works at the same point and has the same rate, about −0.67, so each band comes out turned round and a third shorter. That is what pressing cos over and over on a calculator does: near 0.7391 each press keeps about two-thirds of the error and flips its sign, so the display lands above, then below, closing in. The last solved problem counts the presses.

e to the ln x tells you the derivative of ln x 🖖

Press e to the ln x. The two links hand back what they were given, e^(ln x) = x, so the whole chain has slope 1. The chain rule says that 1 is the product of the two rates: the outer one, e^(ln x), which is x, times the rate of ln. So the rate of ln at x has to be 1/x, and the argument never needed to know it. Move x and the two rates stay reciprocals.

Learning path

Differentiation: how rates combine

References (2)