Skip to main content
United StatesCalculusSyllabus dot point

How do you differentiate a function built by composing one function inside another?

Topic 3.1 The Chain Rule: differentiate composite functions using the chain rule.

A focused answer to AP Calculus AB Topic 3.1, stating and applying the chain rule for composite functions, in both the Leibniz and outside-inside forms, with worked examples combining it with the power, trig, exponential and log rules.

Generated by Claude Opus 4.89 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this topic is asking
  2. The rule
  3. Identifying outer and inner
  4. A reliable procedure
  5. Why the chain rule multiplies the rates
  6. Nesting and combining with other rules

What this topic is asking

The College Board (Topic 3.1) introduces the chain rule, the tool for differentiating a composite function - a function inside another function, such as (3x2+1)4(3x^2 + 1)^4, sin(ex)\sin(e^x), or ln(5x+2)\ln(5x + 2). Almost every interesting derivative beyond the basic rules needs it, so this is the single most important rule in Unit 3.

The rule

The phrase to internalise is "derivative of the outer (with the inner left untouched), times the derivative of the inner". The inner function is copied unchanged into the outer derivative, and then a separate factor g(x)g'(x) is multiplied on.

Identifying outer and inner

A reliable procedure

Differentiating a composite cleanly is a matter of decomposition: name the inner function uu, differentiate the outer treating uu as a single variable, then multiply by uu'. Writing uu and uu' off to the side before assembling keeps the two factors straight.

Why the chain rule multiplies the rates

The Leibniz form dydx=dydududx\frac{dy}{dx} = \frac{dy}{du}\cdot\frac{du}{dx} makes the meaning vivid: if yy changes dydu\frac{dy}{du} times as fast as uu, and uu changes dudx\frac{du}{dx} times as fast as xx, then yy changes the product of those rates as fast as xx. A concrete picture helps. Suppose a car's distance depends on the engine's revolutions, and the revolutions depend on time. If the car moves 0.010.01 km per revolution and the engine turns 30003000 revolutions per minute, the car moves 0.01×3000=300.01 \times 3000 = 30 km per minute - the two rates multiply. The chain rule is exactly this composition of rates, and it is why a small change in xx propagates through the inner function and then through the outer function, picking up a factor at each stage. This also explains why the inner derivative can never be dropped: it is the rate at which the inside responds to xx, without which the outer rate has nothing to act on.

Nesting and combining with other rules

The chain rule extends to deeper nesting by applying it repeatedly, peeling one layer at a time from the outside in. For sin(e2x)\sin(e^{2x}) you differentiate sine to get cos(e2x)\cos(e^{2x}), multiply by the derivative of e2xe^{2x}, which itself needs the chain rule to give e2x2e^{2x}\cdot 2, ending at 2e2xcos(e2x)2e^{2x}\cos(e^{2x}). The chain rule also combines with the product and quotient rules: in x2sin(3x)x^2\sin(3x) you use the product rule, and the sin(3x)\sin(3x) factor is differentiated by the chain rule to 3cos(3x)3\cos(3x). On the exam, most no-calculator derivatives are really chain-rule problems with one or two extra layers, so fluency here pays off everywhere in Units 3 to 8. A good final check is to confirm that every inner function contributed its derivative as a factor; a missing factor is almost always a forgotten inner derivative.

Exam-style practice questions

Practice questions written in the style of College Board exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

AP 2021 (style)1 marksSection I (multiple choice, no calculator). If f(x)=(3x2+1)4f(x) = (3x^2 + 1)^4, then f(x)=f'(x) = (A) 4(3x2+1)34(3x^2 + 1)^3 (B) 4(3x2+1)3(6x)4(3x^2 + 1)^3(6x) (C) (6x)4(6x)^4 (D) 4(6x)34(6x)^3
Show worked answer →

The correct answer is (B), 4(3x2+1)3(6x)4(3x^2 + 1)^3(6x).

The outer function is "raise to the 4th power" and the inner is u=3x2+1u = 3x^2 + 1. The chain rule gives (derivative of outer, evaluated at the inner)(derivative of inner): 4(3x2+1)36x4(3x^2 + 1)^3 \cdot 6x. Choice (A) is the classic error of forgetting the inner derivative u=6xu' = 6x.

AP 2023 (style)4 marksSection II (free response, no calculator). Let g(x)=sin(e2x)g(x) = \sin(e^{2x}). (a) Identify the outer and inner functions. (b) Differentiate g(x)g(x). (c) Differentiate h(x)=ln(5x2+1)h(x) = \ln(5x^2 + 1), naming the inner function.
Show worked answer →

A 4-point chain-rule question.

(a) (1 point) Outer is sin()\sin(\,\cdot\,); inner is u=e2xu = e^{2x}. Note e2xe^{2x} itself needs the chain rule with inner 2x2x.
(b) (2 points) g(x)=cos(e2x)ddx[e2x]=cos(e2x)e2x2=2e2xcos(e2x)g'(x) = \cos(e^{2x}) \cdot \frac{d}{dx}[e^{2x}] = \cos(e^{2x}) \cdot e^{2x} \cdot 2 = 2e^{2x}\cos(e^{2x}).
(c) (1 point) Inner is u=5x2+1u = 5x^2 + 1, so h(x)=15x2+110x=10x5x2+1h'(x) = \frac{1}{5x^2 + 1} \cdot 10x = \frac{10x}{5x^2 + 1}.

Related dot points

Sources & how we know this