AP Calculus AB • Differentiation: Composite, Implicit, and Inverse Functions

Chain Rule

The essential technique for differentiating composite functions by peeling back layers one at a time.

AP Calculus AB illustration with a smooth curve, infinity sign, and measuring ruler
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

Historical Context & Motivation

Calculus as we know it emerged from the parallel — and famously independent — work of Isaac Newton and Gottfried Wilhelm Leibniz in the late seventeenth century. Both mathematicians grappled with the problem of computing rates of change for increasingly complex expressions, yet the elementary rules of differentiation (power, sum, product, quotient) could only carry them so far. As soon as one function was nested inside another — what we now call a composite function — a new principle was needed. The Chain Rule answered that need, providing a systematic way to differentiate compositions of any number of functions by relating the derivative of the whole to the derivatives of each constituent layer.

1676 • Leibniz's Differential Notation

Leibniz introduced the notation dy/dx, which naturally suggested that differentials could be multiplied and divided — an intuition that would become the backbone of the Chain Rule's most memorable form: dy/dx = (dy/du)(du/dx).

1697 • Johann Bernoulli's Implicit Use

While solving brachistochrone problems, Johann Bernoulli applied chain-rule reasoning implicitly when differentiating expressions involving nested radical and trigonometric functions, though a formal statement had yet to appear.

1748 • Euler's Introductio in Analysin Infinitorum

Leonhard Euler systematized the idea of composite functions, setting the stage for an explicit chain-rule formulation by defining what it means to substitute one function into another.

~1800 • Formal Statement Appears in Textbooks

By the turn of the nineteenth century, calculus textbooks — particularly those of Lacroix and Cauchy — stated and proved the Chain Rule in essentially the form taught today, grounded in the rigorous limit definitions that Cauchy championed.

Modern • Backbone of Machine Learning

The Chain Rule underpins the backpropagation algorithm that trains neural networks. Every gradient computation in deep learning is, at its core, an iterated application of the Chain Rule through thousands of composed operations.

The central question the Chain Rule answers is deceptively simple: if a quantity y depends on u, and u in turn depends on x, how fast does y change with respect to x? The answer — multiply the rates — is both elegant and profoundly useful, as the sections that follow will demonstrate.

SECTION 2

Core Principles & Definitions

Before applying the Chain Rule, it is essential to develop a clear understanding of composite functions, the distinction between inner and outer functions, and the multiplicative nature of rates of change. The four foundational ideas below establish the conceptual scaffolding on which the Chain Rule rests.

1

Composite Function

A composite function is formed when the output of one function becomes the input of another. If f and g are functions, then (f ∘ g)(x) = f(g(x)). The inner function g(x) is evaluated first, and its result is fed into the outer function f.
2

Outer vs. Inner Function

In f(g(x)), the outer function is f and the inner function is g. Correctly identifying these two layers is the most critical step when applying the Chain Rule — mistakes here cascade through the entire derivative.
3

Multiplicative Rate Principle

If y changes 3 times as fast as u, and u changes 5 times as fast as x, then y changes 3 × 5 = 15 times as fast as x. The Chain Rule formalizes this intuition: dy/dx = (dy/du) · (du/dx).
4

Generalization to Multiple Layers

The Chain Rule extends naturally. For y = f(g(h(x))), you differentiate each layer and multiply: dy/dx = f′(g(h(x))) · g′(h(x)) · h′(x). Each derivative is evaluated at the argument of its respective function.
✦

KEY TAKEAWAY

Think of the Chain Rule like a set of gears in a machine. The first gear (inner function) turns, which drives the second gear (outer function). The overall speed of the machine's output is the product of the individual gear ratios. If one gear doubles speed and another triples it, the output is six times faster — and that's exactly how the Chain Rule multiplies derivatives through each layer of composition.

SECTION 3

Visual Explanation

The diagram below illustrates the functional pipeline of the Chain Rule. An input x passes through the inner function g, producing an intermediate value u = g(x), which is then fed into the outer function f to produce the final output y = f(u). The derivative of the entire composition is obtained by multiplying the derivative of each stage — the rate at which u changes with respect to x times the rate at which y changes with respect to u.

Chain Rule: Functional PipelineInputxInner Functionu = g(x)Outer Functiony = f(u)Derivative Pipeline (Chain Rule)du/dx = g′(x)inner derivative×dy/du = f′(u)outer derivative at udy/dx = f′(g(x)) · g′(x)
The top row shows the forward pass: x enters g to produce u, then u enters f to produce y. The bottom row shows the derivative pass: multiply the inner derivative g′(x) by the outer derivative f′ evaluated at u = g(x). The golden result box displays the final Chain Rule formula.

Notice how the diagram mirrors the Leibniz notation: in the expression (dy/du)(du/dx), the du terms appear to "cancel," leaving dy/dx. While this cancellation is not rigorous in the sense of fraction arithmetic — dy/dx is not literally a fraction — the notation provides an extremely useful mnemonic. Leibniz designed his notation precisely so that such formal manipulations would mirror the underlying mathematics, and the Chain Rule is the most celebrated example of that design philosophy.

SECTION 4

Mathematical Framework

The Chain Rule can be stated in three equivalent notations. Each emphasizes a different aspect of the rule, and fluency with all three is expected on the AP exam. We begin with the Leibniz form, proceed to the prime notation, and finish with a limit-based derivation that connects the rule to the definition of the derivative.

LEIBNIZ FORM

dy/dx=(dy/du)⋅(du/dx)dy/dx = (dy/du) · (du/dx)

Here y is a function of u, and u is a function of x. The intermediate variable u serves as the connecting link between the outer and inner layers.

PRIME (LAGRANGE) NOTATION

[f(g(x))]′=f′(g(x))⋅g′(x)[f(g(x))]′ = f′(g(x)) · g′(x)

Differentiate the outer function f at the inner function g(x), then multiply by the derivative of the inner function g′(x). This is the form most commonly used in AP Calculus AB free-response work.

EXTENDED CHAIN RULE (THREE LAYERS)

d/dx[f(g(h(x)))]=f′(g(h(x)))⋅g′(h(x))⋅h′(x)d/dx [f(g(h(x)))] = f′(g(h(x))) · g′(h(x)) · h′(x)

Each derivative is evaluated at the composition of all functions interior to it. The pattern generalizes to any finite number of composed functions.

Limit-Based Derivation

Let y = f(g(x)) where g is differentiable at x and f is differentiable at g(x). Define Δu = g(x + Δx) − g(x) and Δy = f(g(x + Δx)) − f(g(x)) = f(u + Δu) − f(u). When Δu ≠ 0, we can write Δy/Δx = (Δy/Δu) · (Δu/Δx). Taking the limit as Δx → 0 — and noting that Δu → 0 because g is continuous — yields dy/dx = (dy/du)(du/dx). A rigorous proof must handle the case Δu = 0 via an auxiliary function, but the conceptual heart of the argument is this telescoping of ratios.

💡

AP Exam Tip

On the AP Calculus AB exam, you are expected to apply the Chain Rule fluently — you will not be asked to prove it. However, understanding the limit argument helps you avoid sign errors and correctly handle nested compositions. Always identify the inner and outer functions before writing any derivatives.

SECTION 5

Common Chain Rule Patterns

While the Chain Rule is a single principle, it manifests in several recurring patterns throughout AP Calculus AB. Recognizing these patterns allows you to differentiate rapidly and accurately, especially under timed exam conditions. The table below catalogs the most frequently tested forms, and the diagram that follows visualizes the structural anatomy of a typical nested function.

PatternGeneral FormDerivative
Power of a function[g(x)]ⁿn · [g(x)]ⁿ⁻¹ · g′(x)
Trig of a functionsin(g(x))cos(g(x)) · g′(x)
Exponential compositioneg(x)e^{g(x)}eg(x)e^{g(x)} · g′(x)
Natural log compositionln(g(x))[1/g(x)] · g′(x)
Inverse trig compositionarctan(g(x))[1 / (1 + [g(x)]²)] · g′(x)
Square root of a function√(g(x))g′(x) / [2√(g(x))]

Common Chain Rule derivative patterns tested on AP Calculus AB

Anatomy of a Triple-Layered Composite: sin³(2x + 1)LAYER 1 — Outermost: Power function u³f(u) = u³ → f′(u) = 3u²Evaluated at u = sin(2x + 1): 3 · sin²(2x + 1)LAYER 2 — Middle: Trig function sin(v)g(v) = sin(v) → g′(v) = cos(v)Evaluated at v = 2x + 1: cos(2x + 1)LAYER 3 — Innermost: Linear function 2x + 1h(x) = 2x + 1 → h′(x) = 2This is the innermost layer — differentiate directly.RESULT: Multiply all layersd/dx[sin³(2x+1)] = 3sin²(2x+1) · cos(2x+1) · 2 = 6sin²(2x+1)cos(2x+1)
This diagram dissects sin³(2x + 1) into three nested layers. The outermost layer (pink) is the cubing function, the middle layer (violet) is the sine function, and the innermost layer (cyan) is the linear function 2x + 1. The final derivative is the product of the derivatives of all three layers, each evaluated at its respective argument.
⚠

Common Mistake

The most frequent Chain Rule error is forgetting to multiply by the inner derivative. For example, students often write d/dx[sin(3x)] = cos(3x) instead of the correct answer cos(3x) · 3 = 3cos(3x). Always ask: "Did I differentiate every layer?"

SECTION 6

Worked Example

Let us work through a complete example that combines the Chain Rule with other differentiation rules. We will find the derivative of y = esin(x²). This function has three nested layers: the exponential, the sine, and the squaring, which makes it a perfect illustration of the extended Chain Rule.

Differentiate y = esin(x2)e^{sin(x²)}

  1. 1

    Step 1 — Identify the Layers

    Decompose the function from outside to inside. The outermost function is f(u) = eᵘ where u = sin(x²). The middle function is g(v) = sin(v) where v = x². The innermost function is h(x) = x². By the extended Chain Rule, dy/dx = f′(u) · g′(v) · h′(x).
    Outer: eᵘ, Middle: sin(v), Inner: x²
  2. 2

    Step 2 — Differentiate Each Layer

    Compute the derivative of each layer with respect to its own variable. The derivative of eᵘ is eᵘ. The derivative of sin(v) is cos(v). The derivative of x² is 2x.
    f′(u) = eᵘ, g′(v) = cos(v), h′(x) = 2x
  3. 3

    Step 3 — Evaluate at Correct Arguments

    Each derivative must be evaluated at the composition of all interior functions. f′ is evaluated at u = sin(x²), giving esin(x2)e^{sin(x²)}. g′ is evaluated at v = x², giving cos(x²). h′(x) = 2x requires no substitution since x is the independent variable.
    f′(sin(x²)) = esin(x2)e^{sin(x²)}, g′(x²) = cos(x²), h′(x) = 2x
  4. 4

    Step 4 — Multiply All Layers

    Apply the extended Chain Rule by multiplying the three results together: dy/dx = esin(x2)e^{sin(x²)} · cos(x²) · 2x.
    dy/dx = 2x · cos(x²) · esin(x2)e^{sin(x²)}
💡

Verification Tip

You can verify Chain Rule results numerically. Evaluate y at x = 1 and at x = 1.001, compute (y(1.001) − y(1))/0.001, and compare with dy/dx at x = 1. For our example, dy/dx at x = 1 ≈ 2(1) · cos(1) · esin(1)e^{sin(1)} ≈ 2 × 0.5403 × 2.3198 ≈ 2.507. This numerical check catches algebraic errors.

SECTION 7

Common Pitfalls & Rule Comparisons

The Chain Rule does not operate in isolation — it is frequently combined with the Product Rule and Quotient Rule, and students must decide which rule(s) to apply and in what order. The table below compares the three main differentiation rules to help you recognize when each is needed, and a second table catalogs the most common Chain Rule errors with their corrections.

RuleWhen to UseFormula
Product RuleTwo functions are multiplied: f(x) · g(x)f′g + fg′
Quotient RuleOne function is divided by another: f(x)/g(x)(f′g − fg′)/g²
Chain RuleOne function is composed inside another: f(g(x))f′(g(x)) · g′(x)
Product + ChainProducts where one or both factors are composite: x² · sin(3x)Apply Product Rule first, then Chain Rule within each part

Differentiation rule comparison

Common MistakeIncorrect ResultCorrect Result
Forgetting the inner derivatived/dx[cos(5x)] = −sin(5x)−sin(5x) · 5 = −5sin(5x)
Evaluating outer derivative at x instead of g(x)d/dx[ln(x²)] = (1/x) · 2x = 2(1/x²) · 2x = 2/x
Confusing composition with multiplicationd/dx[sin(x²)] = cos(x) · 2xcos(x²) · 2x

Frequent Chain Rule errors and corrections

✦

KEY TAKEAWAY

In complex expressions, differentiation rules nest like Russian dolls. The outermost structure (product, quotient, or composition) determines which rule you apply first, and the Chain Rule is almost always lurking inside the other rules, waiting to be applied whenever a factor or term is itself a composite function. Develop the habit of scanning each part for hidden inner functions.

SECTION 8

Connections to Advanced Theory

The Chain Rule you master in AP Calculus AB is the single-variable version of a far-reaching principle that extends through multivariable calculus, differential equations, and modern applied mathematics. Understanding where the rule leads can deepen your appreciation of its importance and motivate careful mastery now.

AP Calculus AB (Single Variable)Advanced Extensions
dy/dx = (dy/du)(du/dx) for y = f(g(x))Multivariable Chain Rule: ∂z/∂t = (∂z/∂x)(dx/dt) + (∂z/∂y)(dy/dt)
Applied to explicit compositions like sin(x²)Implicit differentiation is a direct corollary of the Chain Rule applied to y as a function of x
Used to find dy/dx at a pointBackpropagation in neural networks: iterates the Chain Rule through thousands of composed layers to compute gradients
Derivatives of inverse trig functions via Chain RuleInverse Function Theorem in Rⁿ: generalizes the relationship between a function's derivative and its inverse's derivative

Chain Rule: from AB to advanced mathematics

Within the AP Calculus AB curriculum itself, the Chain Rule is the gateway to implicit differentiation, related rates, and the differentiation of inverse functions. In implicit differentiation, every time you differentiate a term containing y with respect to x, you are applying the Chain Rule with y as the inner function and multiplying by dy/dx. In related rates, the Chain Rule connects rates of change of different variables through an intermediary equation. Mastering the Chain Rule thoroughly is therefore not just about one type of problem — it is a prerequisite for nearly every differentiation technique that follows.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

If h(x) = f(g(x)), f′(3) = 7, g(2) = 3, and g′(2) = −4, what is h′(2)? (A) −28 (B) −12 (C) 12 (D) 21 (E) 28
  • A. −28
  • B. −12
  • C. 12
  • D. 21
  • E. 28
Show answer (A)
Correct answer: (A) −28. By the Chain Rule, h′(x) = f′(g(x)) · g′(x). At x = 2: h′(2) = f′(g(2)) · g′(2) = f′(3) · (−4) = 7 · (−4) = −28. (A) −28 is correct as shown above. (B) −12 incorrectly uses f′(2) · g′(2) or misreads values. (C) 12 confuses the sign. (D) 21 might come from f′(3) · g(2) = 7 × 3, which incorrectly multiplies by g(2) instead of g′(2). (E) 28 drops the negative sign from g′(2).

Question 2: BASIC CALCULATION

Find the derivative of y = (3x² − 5)⁴. (A) 4(3x² − 5)³ (B) 12(3x² − 5)³ (C) 24x(3x² − 5)³ (D) 4(6x)³ (E) 12x²(3x² − 5)³
  • A. 4(3x² − 5)³
  • B. 12(3x² − 5)³
  • C. 24x(3x² − 5)³
  • D. 4(6x)³
  • E. 12x²(3x² − 5)³
Show answer (C)
Correct answer: (C) 24x(3x² − 5)³. Identify the outer function f(u) = u⁴ and the inner function u = 3x² − 5. The outer derivative is f′(u) = 4u³ = 4(3x² − 5)³. The inner derivative is du/dx = 6x. Multiply: dy/dx = 4(3x² − 5)³ · 6x = 24x(3x² − 5)³. (A) forgets the inner derivative entirely. (B) uses 12 instead of 24x — it seems to attempt 4 × 3 but neglects the variable part 2x from differentiating 3x². (D) incorrectly replaces the base with 6x instead of keeping 3x² − 5. (E) uses 12x² instead of 24x, likely squaring x rather than correctly computing d/dx[3x²] = 6x.

Question 3: INTERMEDIATE

What is dy/dx if y = ln(cos(x²))? (A) −2x · tan(x²) (B) −sin(x²) / cos(x²) (C) 2x / cos(x²) (D) −2x · sin(x²) / x² (E) 1 / [cos(x²) · 2x]
  • A. −2x · tan(x²)
  • B. −sin(x²) / cos(x²)
  • C. 2x / cos(x²)
  • D. −2x · sin(x²) / x²
  • E. 1 / [cos(x²) · 2x]
Show answer (A)
Correct answer: (A) −2x · tan(x²). There are three layers: outer f(u) = ln(u), middle g(v) = cos(v), inner h(x) = x². Applying the extended Chain Rule: f′(u) = 1/u = 1/cos(x²). g′(v) = −sin(v) = −sin(x²). h′(x) = 2x. dy/dx = [1/cos(x²)] · [−sin(x²)] · 2x = −2x · sin(x²)/cos(x²) = −2x · tan(x²). (B) −sin(x²)/cos(x²) is −tan(x²) without the factor of 2x from the innermost layer. (C) forgets the negative from differentiating cosine and loses sin(x²). (D) introduces a spurious x² in the denominator. (E) incorrectly has 2x in the denominator instead of the numerator, suggesting the student divided by the inner derivative rather than multiplying.

Question 4: APPLIED

6 pts
A particle moves along the x-axis so that its position at time t ≥ 0 is given by x(t) = e−t2e^{−t²}. The velocity of the particle is v(t) = x′(t). (a) Find v(t). (b) Find the acceleration a(t) = v′(t). (c) For what value(s) of t is the velocity zero? Interpret this result in the context of the particle's motion. (d) Is the particle speeding up or slowing down at t = 1? Justify your answer.
Show answer
Solution: (a) [2 points] Apply the Chain Rule with outer function eᵘ and inner function u = −t². v(t) = e−t2e^{−t²} · (−2t) = −2t · e−t2e^{−t²}. • 1 point for correctly applying the Chain Rule to differentiate e−t2e^{−t²} • 1 point for the correct final expression −2t · e−t2e^{−t²} (b) [2 points] Apply the Product Rule to v(t) = −2t · e−t2e^{−t²}, using the Chain Rule again on the exponential factor. a(t) = (−2) · e−t2e^{−t²} + (−2t) · e−t2e^{−t²} · (−2t) = −2e−t22e^{−t²} + 4t²e−t2e^{−t²} = e−t2e^{−t²}(4t² − 2). • 1 point for correctly applying the Product Rule with the Chain Rule • 1 point for simplifying to e−t2e^{−t²}(4t² − 2) (c) [1 point] Set v(t) = −2t · e−t2e^{−t²} = 0. Since e−t2e^{−t²} > 0 for all t, we need −2t = 0, so t = 0. At t = 0 the particle is momentarily at rest at its initial position; for all t > 0, v(t) < 0 so the particle moves in the negative direction. • 1 point for finding t = 0 and interpreting the motion (d) [1 point] At t = 1: v(1) = −2e⁻¹ < 0 and a(1) = e⁻¹(4 − 2) = 2e⁻¹ > 0. Since velocity is negative and acceleration is positive, they have opposite signs, so the particle is slowing down at t = 1. • 1 point for correctly determining signs of v(1) and a(1) and concluding slowing down with justification

Question 5: CRITICAL THINKING

3 pts
Let F(x) = f(f(x)) where f is a differentiable function. Given that f(1) = 2, f(2) = 1, f′(1) = −3, and f′(2) = 4, find F′(1). Show your reasoning and identify exactly where the Chain Rule is applied.
Show answer
Solution: [1 point] By the Chain Rule, F′(x) = f′(f(x)) · f′(x). The Chain Rule is applied because F = f ∘ f is a composition: the outer function is f evaluated at the inner function f(x). [1 point] Substituting x = 1: F′(1) = f′(f(1)) · f′(1). Since f(1) = 2, this becomes F′(1) = f′(2) · f′(1). [1 point] Evaluating: F′(1) = 4 · (−3) = −12. The Chain Rule is the decisive step: it tells us to evaluate the outer derivative f′ at the value of the inner function f(1) = 2, not at x = 1. This is the subtlety that distinguishes composition from multiplication.

SUMMARY

Summary

Summary

The Chain Rule is the fundamental technique for differentiating composite functions of the form f(g(x)). Its core statement — [f(g(x))]′ = f′(g(x)) · g′(x) — tells us to differentiate the outer function at the inner function, then multiply by the derivative of the inner function. The Leibniz form dy/dx = (dy/du)(du/dx) provides a powerful mnemonic through the apparent cancellation of du.

In practice, always begin by identifying each layer of composition from outside to inside. Common patterns include powers of functions, trigonometric compositions, exponential compositions, and logarithmic compositions. The most common error is forgetting to multiply by the inner derivative. The Chain Rule extends naturally to multiple nested layers and serves as the gateway to implicit differentiation, related rates, and the differentiation of inverse functions — all essential AP Calculus AB topics.

Varsity Tutors • AP Calculus AB • Chain Rule