Skip to main content

Unit 3 · Topic 3.1

3.1 The Chain Rule

The chain rule is how you differentiate a function inside another function, like sin(3x) or (x² + 1)⁵. Take the derivative of the outside, leave the inside alone, then multiply by the derivative of the inside. It is the single most used rule in the rest of the course.

Key terms

  • chain rule
  • composite function
  • inner function
  • outer function

The rule

If y = f(g(x)), then dy/dx = f′(g(x))·g′(x). In words: the derivative of the outer function, evaluated at the inner function, times the derivative of the inner function.

Why multiply? Rates stack. If u changes 3 times as fast as x, and y changes 2 times as fast as u, then y changes 2·3 = 6 times as fast as x. The chain rule multiplies the rate of each layer.

In Leibniz notation, if y depends on u and u depends on x, then dy/dx = (dy/du)·(du/dx). The units work out too: if pressure changes in psi per meter of depth and depth changes in meters per minute, then pressure changes in (psi per meter)·(meters per minute) = psi per minute.

Spotting the inside and the outside

Ask: “What would I compute last if I plugged in a number?” That last operation is the outer function. Everything it acts on is the inner function.

  • A function can have several layers. sin²(3x) has three: squaring, then sine, then 3x. Work from the outside in, multiplying by each layer's derivative.
  • Leave the inside unchanged when you differentiate the outside. The derivative of sin(3x) starts with cos(3x), not cos x.
FunctionOuterInnerDerivative
(3x² − 5)⁴u⁴3x² − 54(3x² − 5)³·6x
sin(3x)sin u3xcos(3x)·3
e^(x²)eᵘx²e^(x²)·2x
ln(x² + 1)ln ux² + 1(1/(x² + 1))·2x
sin²(3x) = (sin 3x)²u²sin 3x2 sin(3x)·cos(3x)·3
√(1 + cos²x)√u1 + cos²x(1/(2√(1 + cos²x)))·(−2 cos x sin x)

Useful chain rule patterns

These come up so often that it helps to know them as patterns:

  • d/dx [g(x)]ⁿ = n[g(x)]ⁿ⁻¹·g′(x)
  • d/dx e^(g(x)) = e^(g(x))·g′(x)
  • d/dx ln(g(x)) = g′(x)/g(x)
  • d/dx sin(g(x)) = cos(g(x))·g′(x), and d/dx cos(g(x)) = −sin(g(x))·g′(x)
  • d/dx aˣ = aˣ·ln a, because aˣ = e^(x ln a). For example, d/dx 2ˣ = 2ˣ ln 2.

The chain rule with tables and graphs

If h(x) = f(g(x)), then h′(a) = f′(g(a))·g′(a). Do it in order: first find g(a) from the table, then look up f′ at that value, then multiply by g′(a).

The most common error is looking up f′(a) instead of f′(g(a)). The outer derivative is evaluated at the inner function's output, not at the original input.

Worked examples

Try each one yourself first, then open the solution.

  1. Example 1

    Power of a polynomial

    Differentiate y = (3x² − 5)⁴.

    Show the solution
    1. Step 1: Outer: u⁴, with derivative 4u³. Inner: u = 3x² − 5, with derivative 6x.
    2. Step 2: dy/dx = 4(3x² − 5)³·6x.
    3. Step 3: Simplify: 24x(3x² − 5)³.

    Answer: dy/dx = 24x(3x² − 5)³

  2. Example 2

    Chain rule from a table

    Values: g(2) = 5, g′(2) = −3, f′(2) = 7 and f′(5) = 4. If h(x) = f(g(x)), find h′(2).

    Show the solution
    1. Step 1: Chain rule: h′(2) = f′(g(2))·g′(2).
    2. Step 2: Find the inner value first: g(2) = 5.
    3. Step 3: So h′(2) = f′(5)·g′(2) = 4·(−3).

    Answer: h′(2) = −12

  3. Example 3

    Trap: a function with three layers

    Differentiate y = sin²(3x).

    Show the solution
    1. Step 1: Rewrite to see the layers: y = (sin(3x))². Outer: squaring. Middle: sine. Inner: 3x.
    2. Step 2: Squaring: 2 sin(3x). Times the derivative of sin(3x), which is itself a chain: cos(3x)·3.
    3. Step 3: Put it together: 2 sin(3x)·cos(3x)·3 = 6 sin(3x) cos(3x).
    4. Step 4: Missing either inner layer gives a wrong answer like 2 sin(3x) cos(3x) or 2 sin(3x)·3.

    Answer: dy/dx = 6 sin(3x) cos(3x)

Common mistakes

  • Forgetting to multiply by the inner derivative, such as writing d/dx sin(3x) = cos(3x). It's 3 cos(3x).
  • Changing the inside when differentiating the outside, like d/dx (x² + 1)⁵ = 5(2x)⁴. The inside stays x² + 1: 5(x² + 1)⁴·2x.
  • Using f′(a) instead of f′(g(a)) in table problems.

On the exam

  • The chain rule is tested directly and is a step inside many other questions: related rates, implicit differentiation, motion and antiderivatives (by reversing it, in Unit 6).
  • Table and graph problems with composite functions are very common in both multiple choice and free response.

Connected topics

Videos

  • Calculus AB/BC – 3.1 The Chain Rule

    The AlgebrosWatch on YouTube (opens in a new tab)

  • Chain rule | Derivative rules | AP Calculus AB | Khan Academy

    Khan AcademyWatch on YouTube (opens in a new tab)

  • Visualizing the chain rule and product rule | Chapter 4, Essence of calculus

    3Blue1BrownWatch on YouTube (opens in a new tab)

  • Chain Rule For Finding Derivatives

    The Organic Chemistry TutorWatch on YouTube (opens in a new tab)

  • The Chain Rule... How? When? (NancyPi)

    NancyPiWatch on YouTube (opens in a new tab)

  • Derivatives of Composite Functions: The Chain Rule

    Professor Dave ExplainsWatch on YouTube (opens in a new tab)

Check yourself

4 questions on 3.1 The Chain Rule. Pick an answer to see if you got it, and why.

Question 1 of 4

If y = sin³(2x), what is dy/dx?

Question 2 of 4

Let f(x) = √(g(x)), where g is a differentiable function with g(2) = 9 and g′(2) = 12. What is the value of f′(2)?

Question 3 of 4

The graph of the continuous function f consists of two line segments: one from (0, 4) to (3, −2) and one from (3, −2) to (6, 1). Let h(x) = f(x²). What is the value of h′(2)?

Question 4 of 4Calculator allowed

Let f(x) = sin(x²). What is the greatest value of x in the interval 0 < x < 1.5 at which the line tangent to the graph of f is parallel to the line y = x?

0 of 4 answered