Topic 3.1

Apply the chain rule completely

Builds on identifying the layers of a composition. 8 minutes.

Two graphs, linked

The left graph shows \(u = x^2 + 1\), the middle graph shows \(y = u^3\), and the right graph shows \(y = (x^2 + 1)^3\) against \(x\).

At \(x = 1\), the left graph gives \(u = 2\), and the middle graph then gives \(y = 8\). Each graph has an orange tangent line, and the green triangle on it shows a small step.

The tangent on the left graph has slope 2, so a step of 0.2 in \(x\) moves \(u\) about \(2 \times 0.2 = 0.4\).

The tangent on the middle graph has slope 12 at \(u = 2\), so that step of 0.4 in \(u\) moves \(y\) about \(12 \times 0.4 = 4.8\).

Then \(y\) moves about 4.8 when \(x\) moves 0.2, which is 24 times as much. The tangent on the right graph has slope \(2 \times 12 = 24\).

Any two functions

Remove the numbers. The left graph shows the inner function \(u = g(x)\), and the middle graph shows the outer function \(y = f(u)\).

Drag \(x\). The value \(u\) moves along the middle graph, and the outer tangent is drawn at \(u = g(x)\), not at \(x\).

A small move of \(x\) moves \(u\) by \(g'(x)\) times as much, and that move of \(u\) moves \(y\) by \(f'(u)\) times as much.

The slope of the right graph is the product of the two slopes.

Notation

  1. Call the outer function \(f\) and the inner function \(g\). Then \(u = g(x)\) and \(y = f(u)\).

    \[y = f(g(x))\]
  2. The slope of the outer graph is \(f'\), read at \(u = g(x)\). The slope of the inner graph is \(g'\), read at \(x\).

    \[\cy{f'(g(x))} \qquad \cy{g'(x)}\]
  3. The derivative of the composition is the outer derivative, evaluated at the inner function, times the inner derivative.

    \[\frac{d}{dx}\, f(g(x)) = \cy{f'(g(x))} \cdot \cy{g'(x)}\]
  4. In Leibniz notation, \(dy/du\) is the slope of the outer graph and \(du/dx\) is the slope of the inner graph.

    \[\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}\]
  5. The rule needs \(g\) to be differentiable at \(x\) and \(f\) to be differentiable at \(g(x)\).

When it fails

Let \(f(u) = |u|\) and \(g(x) = x - 2\), and move \(x\) to 2. The inner value is \(u = 0\), where the graph of \(|u|\) has a corner.

On the middle graph, the two red half-lines show an outer slope of \(-1\) left of the corner and 1 right of it. This means \(f'(0)\) does not exist. The product then has no value, and the right graph, \(y = |x - 2|\), also has a corner at \(x = 2\).

Example 1: a power

Find \(\dfrac{dy}{dx}\) for \(y = (x^3 - 2x)^4\). Then find its value at \(x = 1\).

  1. The inner function is \(u = x^3 - 2x\). The outer function is \(y = u^4\).

  2. The slope of the outer graph is \(4u^3\). Read it at the inner value, \(u = x^3 - 2x\).

    \[\cy{4(x^3 - 2x)^3}\]
  3. The slope of the inner graph is the derivative of \(x^3 - 2x\).

    \[\cy{3x^2 - 2}\]
  4. Multiply the two slopes.

    \[\frac{dy}{dx} = 4(x^3 - 2x)^3\,(3x^2 - 2)\]
  5. At \(x = 1\), the inner value is \(u = 1 - 2 = -1\). The outer slope is \(4(-1)^3 = -4\), and the inner slope is \(3 - 2 = 1\).

    \[\frac{dy}{dx}\bigg|_{x=1} = (-4)(1) = \cy{-4}\]

Example 2: three layers

Find \(\dfrac{dy}{dx}\) for \(y = \sqrt{\sin 3x + 2}\). Then find its value at \(x = 0\).

  1. Read the layers from the outside in. The outer function is \(y = \sqrt{w}\), the middle function is \(w = \sin u + 2\), and the inner function is \(u = 3x\). The left graph shows the two inner layers together, \(w = \sin 3x + 2\).

  2. The rule has one factor for each layer. The first factor is the slope of the square root, read at \(w\).

    \[\frac{1}{2\sqrt{\sin 3x + 2}}\]
  3. A tempting wrong move: The second factor is the slope of \(\sin u + 2\), which is \(\cos 3x\).

    \[y' = \frac{\cos 3x}{2\sqrt{\sin 3x + 2}}\]

    At \(x = 0\), this gives \(\frac{1}{2\sqrt 2} \approx 0.35\). The red line with that slope is much flatter than the tangent on the right graph, whose slope is about 1.06. The step left out the slope of the inner function \(u = 3x\), which is 3.

  4. The third factor is the slope of \(u = 3x\), which is 3. Multiply all three factors.

    \[\begin{aligned} y' &= \frac{\cos 3x}{2\sqrt{\sin 3x + 2}} \cdot 3 \\ &= \frac{3\cos 3x}{2\sqrt{\sin 3x + 2}} \end{aligned}\]
  5. At \(x = 0\), \(\cos 0 = 1\) and \(\sin 0 = 0\).

    \[y'(0) = \frac{3}{2\sqrt 2} \approx \cy{1.06}\]

Practice

Find \(\dfrac{dy}{dx}\) for \(y = e^{x^2 - 3x}\). Then find its value at \(x = 3\).

Move x to 3 and read u on the left graph. Then read the outer slope at that u on the middle graph.

Solution
  1. The inner function is \(u = x^2 - 3x\). The outer function is \(y = e^u\).

  2. The outer slope is \(e^u\) and the inner slope is \(2x - 3\). Multiply them.

    \[\frac{dy}{dx} = e^{x^2 - 3x}\,(2x - 3)\]
  3. At \(x = 3\), the inner value is \(u = 9 - 9 = 0\). The outer slope is \(e^0 = 1\), and the inner slope is \(2(3) - 3 = 3\).

    \[\frac{dy}{dx}\bigg|_{x=3} = 1 \cdot 3 = 3\]

Questions

The figure shows \(y = \sqrt{u}\) with \(u = 2x^2 + 1\), at \(x = 2\). Then \(u = 9\) and \(y = 3\).

  1. What slope does the middle graph show at \(u = 9\)?

    • \(\tfrac16\)
    • 8
    • \(\tfrac{\sqrt 2}{4}\)
    Answer

    \(\tfrac16\)

  2. What slope does the right graph show at \(x = 2\)?

    • \(\tfrac43\)
    • \(\tfrac16\)
    • 8
    • \(\tfrac{49}{6}\)
    Answer

    \(\tfrac43\)

  3. Find the derivative of \(y = (x^4 + 3)^5\) at \(x = 1\).

    • 5120
    • 1280
    • 20
    Answer

    5120

Summary

You differentiate a composition by multiplying the outer slope, read at the inner value, by the inner slope, with one factor for each layer.

This works because a small move of \(x\) moves \(u\), and that move of \(u\) moves \(y\), so the two ratios multiply.

Use the rule on any formula that applies one function to the result of another.

This is one of four skills in topic 3.1 of Which & Why: AP Calculus.