Lesson 5: The Chain Rule and Implicit Differentiation
🎧 Listen to this lesson
Most real functions are nested: a sine of a square, an exponential of a negative square, a root of a sum. The chain rule is the tool for differentiating nests, and it has a beautiful interpretation: rates multiply through a chain of dependencies, just as conversion factors multiply through a chain of units. This lesson also covers implicit differentiation, the technique that handles curves given by equations rather than by formulas y = f(x) — circles, foliums, and most curves that nature actually draws.
The chain rule from a numerical experiment
Let y = (x^2 + 1)^3. How fast does y change at x = 1? Compute the inside first: u = x^2 + 1, u(1) = 2, and u grows at rate u'(1) = 2. The outside, y = u^3, grows at rate 3u^2 = 12 per unit of u at u = 2. Each unit of x produces 2 units of u; each unit of u produces 12 units of y; so each unit of x produces 2 × 12 = 24 units of y. The chain rule: dy/dx = (dy/du)·(du/dx). Expanding confirms it: (x^2 + 1)^3 = x^6 + 3x^4 + 3x^2 + 1, whose derivative 6x^5 + 12x^3 + 6x at x = 1 is 6 + 12 + 6 = 24 ✓. In words: differentiate the outer function, leave the inside untouched, then multiply by the derivative of the inside.
Worked Example 1. d/dx sin(x^2) = cos(x^2)·2x = 2x cos(x^2). The argument x^2 stays exactly as it was inside the cosine; only the multiplier 2x is new.
Worked Example 2. Differentiate y = (3x^2 − 5x)^4.
Outer: 4(3x^2 − 5x)^3, inside untouched.
Inner derivative: 6x − 5.
y' = 4(3x^2 − 5x)^3 (6x − 5).
Worked Example 3. Differentiate y = sqrt(x^2 + 9). Write as (x^2 + 9)^(1/2): y' = (1/2)(x^2 + 9)^(−1/2)·2x = x/sqrt(x^2 + 9). Chains of three or more layers work the same way — peel one layer at a time, multiplying as you go.
Implicit differentiation: the variable that hides
The circle x^2 + y^2 = 25 does not define y as a single function, but its tangent lines exist and matter. Differentiate both sides with respect to x, remembering that y is a function of x in disguise: every time you differentiate a y-term, the chain rule attaches a factor of dy/dx.
x^2 + y^2 = 25
2x + 2y·(dy/dx) = 0 → dy/dx = −x/y
At (3, 4): slope −3/4, tangent line y − 4 = −(3/4)(x − 3). At (3, −4): slope +3/4 — the same formula serves both halves of the circle, which is the entire point of working implicitly.
Worked Example 4 (the folium). Find dy/dx for x^3 + y^3 = 6xy, and the tangent at (3, 3).
3x^2 + 3y^2·y' = 6y + 6x·y' (product rule on 6xy)
y'(3y^2 − 6x) = 6y − 3x^2
y' = (6y − 3x^2)/(3y^2 − 6x)
At (3, 3): y' = (18 − 27)/(27 − 18) = −1.
Tangent: y − 3 = −1(x − 3), i.e. y = −x + 6.
Worked Example 5. For y^3 + xy = 10, find dy/dx. Differentiating: 3y^2 y' + y + x y' = 0, so y' = −y/(3y^2 + x). At the point (1, 2) — check it lies on the curve: 8 + 2 = 10 ✓ — the slope is −2/(12 + 1) = −2/13. Note the horizontal-tangent question: y' = 0 requires y = 0, but y = 0 in the original equation gives 0 = 10, impossible — this curve has no horizontal tangents. Reasoning like this (numerator zero, then check consistency) is a standard exam move.
Application: a chain you can verify two ways
A drone flies so that its coordinates are x(t) = 3t and y(t) = 4t (metres, seconds). Its distance from the launch point is D(t) = sqrt(x^2 + y^2) = sqrt(9t^2 + 16t^2) = 5t, so dD/dt = 5 m/s directly. Now pretend you could not simplify: D = sqrt(x^2 + y^2) with x, y functions of t. The multivariable-flavoured chain computation gives dD/dt = (x·x' + y·y')/D = (3t·3 + 4t·4)/(5t) = 25t/(5t) = 5 ✓. Two routes, one answer. This pattern — rate of distance built from component rates — is exactly what powers related rates (Lesson 6) and vector motion (Lesson 18); the chain rule is the thread running through all of it.
Common mistakes
- Forgetting the inner derivative. Wrong: d/dx sin(x^2) = cos(x^2). Right: 2x cos(x^2) — the chain rule's second factor is not optional decoration; without it the units do not even match.
- Applying the chain rule where a product rule belongs. Wrong: d/dx (x^2 sin x) treated as a nest. Right: x^2 and sin x are multiplied, not composed: 2x sin x + x^2 cos x. Ask "is one function inside another, or are two functions multiplied?" before choosing.
- Dropping y' in implicit work. Wrong: from x^2 + y^2 = 25, writing 2x + 2y = 0. Right: 2x + 2y·y' = 0 — y depends on x, so its derivative is y', not 1.
- Solving for y first when implicit is faster. For y^3 + xy = 10 there is no usable explicit formula. Implicit differentiation exists precisely for curves like this; reach for it early.
Exam Experience
1. d/dx cos(3x) evaluated at x = π/6 equals
- (A) 3
- (B) −3
- (C) 0
- (D) −3/2
Answer: (B). The derivative is −3 sin(3x); at x = π/6, sin(π/2) = 1, giving −3. Forgetting the inner factor 3 produces the trap answer 1 in disguise.
2. For the curve x^2 + xy + y^2 = 7, dy/dx at (1, 2) is
- (A) −4/5
- (B) −5/4
- (C) 4/5
- (D) 0
Answer: (A). Differentiating: 2x + y + x y' + 2y y' = 0, so y' = −(2x + y)/(x + 2y) = −(2 + 2)/(1 + 4) = −4/5.
3. If y = (x^2 + 1)^10, then y'(1) equals
- (A) 10
- (B) 20·2^9
- (C) 10·2^10
- (D) 2^10
Answer: (B). y' = 10(x^2 + 1)^9·2x; at x = 1: 10·2^9·2 = 20·2^9 = 10240. Choice (C) is the value when the inner derivative 2x is mis-evaluated as 2 without the remaining factor — careful bookkeeping is the skill.
Free-response question. Consider the curve y^3 + xy = 10. (a) Show that dy/dx = −y/(3y^2 + x). (b) Write the equation of the tangent line at (1, 2). (c) Determine whether the curve has any horizontal tangent lines. Justify your answer.
Scoring guideline.
- (a) 2 points. 1 point for differentiating correctly with y' attached to y-terms: 3y^2 y' + y + x y' = 0 (the y term comes from the product rule on xy). 1 point for isolating y' = −y/(3y^2 + x). A response missing the +y term earns at most 1.
- (b) 1 point. Slope at (1, 2) is −2/13; line y − 2 = −(2/13)(x − 1).
- (c) 1 point. Horizontal tangent requires y' = 0, i.e. y = 0; but substituting y = 0 into the curve gives 0 = 10, a contradiction — so there are no horizontal tangents. Stating "no" without the substitution earns no point.
Going deeper: triple chains and the second derivative, implicitly
Chains can nest three deep. Differentiate y = sin(cos(x^2)): the layers are sin (outer), cos (middle), x^2 (inner). Peel in order:
y' = cos(cos(x^2)) · ( −sin(x^2) ) · 2x = −2x sin(x^2) cos(cos(x^2))
Three factors, one per layer — the pattern scales indefinitely, which is why computer algebra systems (and neural-network backpropagation, which is the chain rule industrialised) are built on it. Implicit differentiation also iterates. For the circle x^2 + y^2 = 25 we found y' = −x/y. Differentiate again, using the quotient rule and substituting y' back in:
y'' = −( y − x·y' )/y^2 = −( y − x(−x/y) )/y^2 = −( y^2 + x^2 )/y^3 = −25/y^3
At (3, 4): y'' = −25/64 ≈ −0.39 < 0 — the top of the circle is concave down, as the picture demands. At (3, −4): y'' = +25/64 > 0 — the bottom is concave up. One formula, both halves, signs telling the geometric truth. Results like −25/y^3 (a constant numerator over the cube of y) are typical of implicit second derivatives: messy to reach, surprisingly clean to state.
Going deeper: logarithmic differentiation and an ellipse tangent
Some functions take logs before they take derivatives. For y = x^x (x > 0), neither the power rule (exponent varies) nor the exponential rule (base varies) applies — but ln y = x ln x does: differentiating, y'/y = ln x + 1, so y' = x^x (ln x + 1). At x = 1 the slope is 1·(0 + 1) = 1. This technique — log, differentiate, multiply back — is Lesson 12's ln machinery moonlighting in differentiation, and it disposes of any product/quotient/power tower too tangled for the standard rules. Ellipse tangent. x^2/9 + y^2/4 = 1 at the point (3/sqrt(2), sqrt(2)) (check membership: (9/2)/9 + 2/4 = 1/2 + 1/2 = 1 ✓). Differentiate implicitly: (2x)/9 + (2y y')/4 = 0 gives y' = −(4x)/(9y) = −(4 · 3/sqrt(2))/(9 sqrt(2)) = −2/3. Conics were built for implicit differentiation — solving the ellipse for y first means two branches, two functions, and double the work for the same slope.
A closing note that Lesson 8 will cash in: the derivative of ln|x| is 1/x for every nonzero x. For x > 0 it is ln x, derivative 1/x. For x < 0 it is ln(−x), and the chain rule gives (−1)/(−x) = 1/x — the inner derivative and the sign of the argument conspire to the same formula. That is why ∫ dx/x = ln|x| + C needs the absolute value in general, and why implicit differentiation of ln|y| terms so often produces clean y'/y expressions. Small formula, long reach.
🎬 Watch & Learn
Free video lessons on “The Chain Rule and Implicit Differentiation” — pick a result below: