Lesson 7: The Chain RuleAP
🎧 Listen to this lesson
Most real functions are built in layers: a polynomial inside a power, a trig function of a polynomial, an exponential of a square. The chain rule (CED topic 3.1) is the tool that differentiates layers, and it is the most-used rule on the AP exam. If y = f(u) and u = g(x), then:
Chain rule. dy/dx = f'(g(x)) · g'(x) — in Leibniz notation, dy/dx = (dy/du)·(du/dx).
The intuition is rates: if u changes 3 times as fast as x, and y changes 2 times as fast as u, then y changes 6 times as fast as x. The rates *multiply*. Procedure: differentiate the outside function (leaving the inside untouched), then multiply by the derivative of the inside. Repeat for deeper layers.
Worked Example 1: power of a polynomial
Problem. Find dy/dx for y = (3x^2 + 1)^5.
Outside: power 5. Inside: u = 3x^2 + 1, u' = 6x.
y' = 5(3x^2 + 1)^4 · 6x = 30x(3x^2 + 1)^4
Answer: y' = 30x(3x^2 + 1)^4. Omitting the factor 6x is the most common chain-rule error on the exam; the structure "outside derivative, inside untouched, times inside derivative" is the protection.
Worked Example 2: three layers and a root
Problem. Differentiate (i) y = e^(x^2), (ii) y = sqrt(sin x), (iii) y = sin(e^(2x)).
(i) Outside e^u, inside x^2: y' = e^(x^2) · 2x
(ii) Outside sqrt(u) = u^(1/2), inside sin x:
y' = (1/(2 sqrt(sin x))) · cos x = cos x / (2 sqrt(sin x))
(iii) Three layers — sin of (e of (2x)):
y' = cos(e^(2x)) · e^(2x) · 2
Answers as shown. In (iii) each layer contributes exactly one factor, working strictly from the outside in: derivative of sin is cos (argument untouched), derivative of e^(2x) is e^(2x) (argument untouched), derivative of 2x is 2. If you ever find yourself differentiating the innermost function first, stop and restart from the outside.
Worked Example 3: the chain rule from a table (graphical/numerical)
Problem. Let h(x) = f(g(x)). The table gives g(1) = 2, g'(1) = 3, f(2) = 5, f'(2) = 4. Find h'(1) and the tangent line to h at x = 1.
h'(x) = f'(g(x)) · g'(x)
h'(1) = f'(g(1)) · g'(1) = f'(2) · 3 = 4 · 3 = 12
h(1) = f(g(1)) = f(2) = 5
Tangent: y − 5 = 12(x − 1)
Answer: h'(1) = 12; tangent y − 5 = 12(x − 1). The trap this item is engineered around: f' must be evaluated at the *inner value* g(1) = 2, not at 1. Students who compute f'(1)·g'(1) are using values the table deliberately withholds — a signal that the nesting order is wrong.
Real-world application: chained rates in a cooling process
A metal part's temperature T (in °C) depends on the surrounding pressure P through T = 40 + 200·e^(−0.5P)... more naturally: a diver's depth changes with time, the water pressure changes with depth, and the volume of an air bubble changes with pressure. If pressure grows at 0.8 atmospheres per metre of depth, depth increases at 0.5 metres per second, and bubble volume changes at −6 cm^3 per atmosphere, then dV/dt = (−6)(0.8)(0.5) = −2.4 cm^3 per second. Three rates chained by multiplication — this is the chain rule doing physics, and it is also the engine behind Lesson 9's related rates: every related-rates problem is the chain rule applied to an equation linking variables that all depend on time.
Common mistakes
- Dropping the inner derivative. d/dx (5x − 1)^3 = 15(5x − 1)^2, not 3(5x − 1)^2. The exam's wrong options are built from exactly this slip.
- Applying the power rule to e^(g(x)) as if it were (g(x))^n, or reporting d/dx e^(x^2) = e^(x^2) without the 2x.
- Table problems: wrong evaluation point. f'(g(1)) means: first compute g(1), then look up f' *there*.
- Chain rule where a product rule belongs: d/dx (x^2 · sin x) is a product of two functions of x, not a composition. Ask: is one function *inside* another, or are two functions *multiplied*?
AP Exam Experience
1. (No calculator.) d/dx (2x − 1)^4 =
- (A) 4(2x − 1)^3
- (B) 8(2x − 1)^3
- (C) 2(2x − 1)^3
- (D) 4(2x − 1)^4
Answer: (B). Outside power gives 4(2x − 1)^3; the inner derivative 2 multiplies in: 8(2x − 1)^3. (A) is the canonical dropped-inner-derivative error.
2. (No calculator.) d/dx e^(sin x) =
- (A) e^(sin x)
- (B) cos x · e^x
- (C) e^(sin x) · cos x
- (D) −sin x · e^(sin x)
Answer: (C). The derivative of e^u is e^u times u': here u = sin x, u' = cos x. (B) differentiates the wrong piece entirely; (D) imports the derivative of cos by mistake.
3. Let h(x) = f(g(x)) with g(3) = 2, g'(3) = −1, and f'(2) = 5. Then h'(3) =
- (A) 5
- (B) −5
- (C) −1
- (D) Cannot be determined without f'(3).
Answer: (B). h'(3) = f'(g(3))·g'(3) = f'(2)·(−1) = 5·(−1) = −5. f'(3) is a decoy — the chain rule never asks for it here.
Free-response question. Let h(x) = f(g(x)), where f and g are differentiable. Selected values are given in the table.
x 0 1 3
f(x) 2 0 4
f'(x) 3 6 −2
g(x) 5 3 1
g'(x) 7 2 9
(a) Find h'(1). (b) Write the equation of the tangent line to the graph of h at x = 1. (c) Let k(x) = g(f(x)). Find k'(1).
Scoring guideline.
- (a) 2 points. 1 point for the chain-rule setup h'(1) = f'(g(1))·g'(1) with correct nesting; 1 point for the value f'(3)·2 = (−2)(2) = −4. (Using f'(1) = 6 anywhere in the setup forfeits the setup point.)
- (b) 1 point. h(1) = f(g(1)) = f(3) = 4, so with slope −4 from (a): y − 4 = −4(x − 1). A tangent line built consistently on an incorrect (a) value still earns this point if the point (1, 4) is correct.
- (c) 2 points. 1 point for setup k'(1) = g'(f(1))·f'(1); 1 point for the value g'(0)·6 = 7·6 = 42. Note the reversed nesting versus part (a) — the parts are designed so that swapping them produces (a)'s numbers in (c), which readers catch.
Additional worked practice
Problem A. Differentiate y = sqrt(1 + cos^2 x). The outer function is a square root (power 1/2), the inner is 1 + cos^2 x, whose derivative is 2 cos x · (−sin x) = −2 sin x cos x. y' = (1/(2 sqrt(1 + cos^2 x))) · (−2 sin x cos x) = −sin x cos x / sqrt(1 + cos^2 x), equivalently −(sin 2x)/(2 sqrt(1 + cos^2 x)) using the double-angle identity. Three layers again: root, sum, square-of-cos — and the derivative of cos^2 x is itself a mini chain rule, which is where the sin x factor comes from. Missing it is the standard error here.
Problem B. Differentiate y = e^(tan x): y' = e^(tan x) · sec^2 x. The exponential reproduces itself; the *entire* contribution of the inner function is its derivative sec^2 x (Lesson 6's extension). Contrast the three forms until they are unmistakable: d/dx [g(x)]^n multiplies by n[g(x)]^(n−1) g'(x); d/dx a^(g(x)) multiplies by a^(g(x)) (ln a) g'(x); d/dx ln(g(x)) multiplies by g'(x)/g(x). The outer function's identity dictates the shape of the answer before any algebra begins.
Extension: chain-rule mastery — deeper layers and a decision guide
Worked example A (three layers, trig inside a log). Let y = ln(sin(x^2)). Working outside in: the outer function is ln, whose derivative is 1/(its argument); the middle is sin; the inner is x^2. y' = [1/sin(x^2)] · cos(x^2) · 2x = 2x cos(x^2)/sin(x^2) (= 2x cot(x^2)). Each layer contributed exactly one factor, in order. If a factor is missing in your answer, a layer was skipped; if an argument was altered mid-way, a layer was differentiated out of turn.
Worked example B (power of a trig function). y = (sin 3x)^4. The outermost structure is a *power*: y' = 4(sin 3x)^3 · cos 3x · 3 = 12 (sin 3x)^3 cos 3x. Note the two inner contributions — cos 3x from the sine, and 3 from the 3x — arrive as separate factors. Conflating (sin 3x)^4 with sin(3x)^4 or with sin^4(3x)... all three notations mean the same function here, but sin(3x^4)... does not; write the nesting explicitly before differentiating.
Worked example C (chain rule twice over, from a table). Let F(x) = f(g(h(x))) with h(1) = 2, h'(1) = 3, g(2) = 5, g'(2) = −1, f(5) = 7, f'(5) = 4. Then F'(1) = f'(g(h(1))) · g'(h(1)) · h'(1) = f'(5) · g'(2) · 3 = 4 · (−1) · 3 = −12, and F(1) = f(5) = 7. The evaluation order is the entire content: unwrap from the inside out for values, and multiply derivatives in the same nesting order.
A decision guide for every differentiation problem. Ask, in order: (1) Is the outermost structure a *sum*? Differentiate term by term. (2) A *product* of two x-expressions? Product rule — then check each factor for composition inside it. (3) A *quotient*? Quotient rule, same check. (4) A *single function of an inner expression*? Chain rule, outside first. Most exam derivatives are two of these stacked; naming the outer structure before touching anything prevents the classic error of applying the chain rule to a product or the product rule to a composition.
One more real-world chain. A factory's cost C depends on output q, and output depends on labour hours L: C = C(q), q = q(L). If producing one more unit costs 40 dollars at current output (dC/dq = 40) and one more labour hour produces 15 more units (dq/dL = 15), then dC/dL = 40 × 15 = 600 dollars per labour hour — the number a manager actually budgets with. The chain rule is the mathematics of "a depends on b depends on c", which is to say, of almost every real system.
📊 Interactive
Interactive — hover or explore the chart above.
🎬 Watch & Learn
Free YouTube video lessons on “The Chain Rule” — pick a result below: