Chapter 3: Derivatives
3.6 The Chain Rule
Study guide for Calculus Volume 1 (Gilbert Strang, 2016 edition)
Independent study guide. Not affiliated with OpenStax or Rice University.
Big idea
Every rule so far took apart a function built by arithmetic: a sum, a product, a quotient. This section takes apart a function built by substitution. When one function is evaluated on the output of another, the pair is called a composition, and its derivative is the product of two derivatives, each measured at the right place.
The reason is a rate-of-rates argument. Suppose $u$ responds to $x$ at $3$ units per unit, and $y$ responds to $u$ at $5$ units per unit. Nudge $x$ by a small amount: $u$ moves three times as far, and $y$ moves five times as far as that, so $y$ moves fifteen times as far as $x$. Rates multiply along a chain. The subtlety is where each rate is read: the outer rate is read at the inner function’s value, not at $x$.
That “read at the inner value” step is what makes the rule feel awkward at first and mechanical once it clicks. Most derivatives you meet from here on are compositions, often several layers deep, so this rule stops being one technique among many and becomes the backbone of differentiation.
Decoder
The derivative of a composition is the derivative of the outer function evaluated at the inner function, times the derivative of the inner function.
Read the sentence as a recipe with three slots. Differentiate the outer function, leaving its input untouched. Substitute the whole inner function into that derivative. Multiply by the derivative of the inner function.
The last factor is the one people drop, and the omission has a name: forgetting to differentiate the inside. A quick audit catches it. If the inner function were simply $x$, its derivative would be $1$ and the extra factor would vanish, which is why the rule looks invisible in the easy cases and bites in the rest.
The Leibniz form says the same thing with the labels stripped away. Writing $y$ as a function of $u$ and $u$ as a function of $x$,
$$ \frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx} $$
The symbols invite you to cancel $du$, and the answer that suggests is right, though the fractions are not literally fractions being cancelled.
Definitions and results
Composition. Given functions $f$ and $g$, the composition $f \circ g$ is the function $(f \circ g)(x) = f(g(x))$. The inner function $g$ acts first; $f$ acts on its output. A point belongs to the domain of the composition when $x$ is in the domain of $g$ and $g(x)$ is in the domain of $f$.
The chain rule. If $g$ is differentiable at $x$ and $f$ is differentiable at $g(x)$, then $f \circ g$ is differentiable at $x$ and
$$ (f \circ g)'(x) = f'(g(x)) \cdot g'(x) $$
Note the two different inputs on the right: $f'$ is evaluated at $g(x)$, while $g'$ is evaluated at $x$. Evaluating both at $x$ is the most common error in the whole of differential calculus.
Leibniz form. With $y = f(u)$ and $u = g(x)$, the same statement reads $\frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx}$, where $\frac{dy}{du}$ is computed as a function of $u$ and then $u$ is replaced by $g(x)$.
The power chain rule. Taking the outer function to be a power gives the case you use most:
$$ \frac{d}{dx}\left[ g(x) \right]^{n} = n \left[ g(x) \right]^{n-1} g'(x) $$
This covers roots and reciprocals too, by writing them as the powers $1/2$ and $-1$.
Chains with the standard outer functions. The same pattern applies with any outer function whose derivative you know:
$$ \frac{d}{dx}\sin\big(g(x)\big) = \cos\big(g(x)\big)\, g'(x), \qquad \frac{d}{dx} e^{\,g(x)} = e^{\,g(x)} g'(x) $$
Longer chains. Three nested functions give three factors, each derivative read at what sits inside it:
$$ \frac{d}{dx} f\big(g(h(x))\big) = f'\big(g(h(x))\big) \cdot g'\big(h(x)\big) \cdot h'(x) $$
Work from the outside in and the factors appear in the order you meet them.
Combining with the other rules. The chain rule does not replace the product and quotient rules; it supplies the derivative of any factor that is itself a composition. A product of two chains needs the product rule on the outside and the chain rule twice inside.
Worked examples
A power of a polynomial
Differentiate $y = (3x^2 + 5)^4$.
The outer function raises its input to the fourth power; the inner function is $3x^2 + 5$. Differentiating the outer function gives four times the third power, evaluated at the inner function, and the inner derivative is $6x$:
$$ \frac{dy}{dx} = 4(3x^2+5)^3 \cdot 6x = 24x(3x^2+5)^3 $$
A sanity check at $x = 0$: the inner function has a minimum there, so its rate is zero and the whole composition should be flat. The formula gives $24(0)(5)^3 = 0$, as expected.
A trigonometric outer function
Differentiate $y = \sin(x^3)$.
Outer is sine, inner is $x^3$. The derivative of sine is cosine, evaluated at $x^3$, times the inner derivative $3x^2$:
$$ \frac{dy}{dx} = 3x^2\cos(x^3) $$
Reversing the roles gives a different function entirely: $y = \sin^3 x$ means $(\sin x)^3$, whose derivative is $3\sin^2 x \cos x$. The notation is close and the functions are not, so read the parentheses before differentiating.
Three layers
Differentiate $y = \sqrt{1 + \tan(2x)}$.
Peel from the outside. The square root is the outer function, $1 + \tan(2x)$ sits inside it, and $2x$ sits inside the tangent. The three factors are the derivative of the root at the inner value, the derivative of $1 + \tan(2x)$, and the derivative of $2x$:
$$ \frac{dy}{dx} = \frac{1}{2\sqrt{1+\tan(2x)}} \cdot \sec^2(2x) \cdot 2 = \frac{\sec^2(2x)}{\sqrt{1+\tan(2x)}} $$
A chain inside a product
Differentiate $y = x^2(2x+1)^5$.
This is a product whose second factor is a composition, so the product rule runs on the outside and the chain rule handles that factor:
$$ \frac{dy}{dx} = 2x(2x+1)^5 + x^2 \cdot 5(2x+1)^4 \cdot 2 = 2x(2x+1)^5 + 10x^2(2x+1)^4 $$
Both terms share $2x(2x+1)^4$. Factoring it out collapses the answer:
$$ \frac{dy}{dx} = 2x(2x+1)^4\big[(2x+1) + 5x\big] = 2x(2x+1)^4(7x+1) $$
The factored form is worth the extra line: it displays the zeros of the derivative at $x = 0$, $x = -1/2$ and $x = -1/7$, which is exactly what the next chapter asks for when locating turning points.
Practice
Start with single compositions, where one rule does the whole job. Identify the outer and inner function, differentiate each, and multiply.
Practice
Generated problems for this section, graded instantly.
Then mix the rules. These problems place chains inside products and quotients, so you decide which rule governs the outermost structure before any differentiating begins.
Practice
Generated problems for this section, graded instantly.
Quiz
Five items on compositions, nested chains, and chains combined with the product and quotient rules.
Quiz
5 problems with a score at the end.