You already know that d/dx[x⁵] = 5x⁴. Now try this one:
Find
d/dx[(x² + 1)⁵].
Tempting move: "It's something to the 5th power, so the derivative is 5(x² + 1)⁴." Write that down — and then test it. If that were the whole answer, then squaring-then-raising would behave exactly like raising a bare variable. But (x² + 1)⁵ is a function inside another function: you take x, run it through g(x) = x² + 1, and then run that result through the 5th-power machine.
Multiply out a smaller version, (x² + 1)²= x⁴ + 2x² + 1, and differentiate honestly: 4x³ + 4x = (2)(x² + 1)(2x). Notice the extra factor of 2x — exactly the derivative of the inside. That stray factor is the entire point of this lesson. The 5th-power version will need it too: the answer is 5(x² + 1)⁴ · 2x. Today you'll learn the rule that produces that inside factor automatically, every time.
A composite function is a function plugged into another function, written f(g(x)) or (f ∘ g)(x). Here g is the inner (inside) function — it touches x first — and f is the outer (outside) function — it acts on whatever g produces. For (x² + 1)⁵, the inside is g(x) = x² + 1 and the outside is f(u) = u⁵.
Chain Rule. If
fandgare differentiable, thend/dx[f(g(x))] = f'(g(x)) · g'(x).
In words: the derivative of the outside (with the inside left alone) times the derivative of the inside. People also call this the outside-inside method. In Leibniz notation, if y = f(u) and u = g(x), then
dy/dx = dy/du · du/dx
and the du's "cancel" as a memory aid (they aren't really fractions, but the cancellation pattern is reliable). The single most important habit: after differentiating the outer function, you are not done — you must multiply by the derivative of the inner function. Forgetting that inside factor is the #1 derivative error on the AP exam.
Treat a composite like an onion and peel one layer at a time, working outside in:
Quick example. For sin(x²): the last thing you do to x is take the sine, so the outer function is sine. d/dx[sin(▢)] = cos(▢) · (▢)', giving cos(x²) · 2x = 2x cos(x²). The 2x is the derivative of the inside x² — don't lose it.
The most common chain-rule pattern combines it with the power rule. Memorize this special case:
General Power Rule.
d/dx[(g(x))ⁿ] = n·(g(x))ⁿ⁻¹ · g'(x).
Multiply down the exponent, drop the power by one, then multiply by the derivative of the base. So d/dx[(x² + 1)⁵] = 5(x² + 1)⁴ · 2x = 10x(x² + 1)⁴. The final · 2x is the inside derivative the Opening Question warned you about. This pattern also covers roots and reciprocals once you rewrite them as powers: √(x² + 1) = (x² + 1)^(1/2) and 1/(x² + 1)³ = (x² + 1)⁻³.
Each trig derivative gets a chain-rule companion. The pattern is always (derivative of the trig function, evaluated at the inside) times (derivative of the inside):
d/dx[sin(g)] = cos(g)·g' d/dx[cos(g)] = −sin(g)·g'
d/dx[tan(g)] = sec²(g)·g' d/dx[sec(g)] = sec(g)tan(g)·g'
Watch the notation trap: sin²x means (sin x)², an outer squaring of an inner sine, while sin(x²) is an outer sine of an inner squaring. They differentiate completely differently — see Common Mistake 4.
Differentiate y = sin(√(x² + 1)). Peel from the outside in — there are three layers: sine (outer), square root (middle), and x² + 1 (inner).
cos(√(x² + 1)), leaving the inside alone, times the derivative of √(x² + 1).(x² + 1)^(1/2) differentiates to ½(x² + 1)^(−1/2) · 2x = x/√(x² + 1).Multiplying the layers:
y' = cos(√(x² + 1)) · x/√(x² + 1)
Every nested layer contributes one factor. (sympy confirms y' = x·cos(√(x²+1))/√(x²+1).)
Differentiate y = cos³x. Rewrite to see the layers: y = (cos x)³, an outer cube of an inner cosine. General power rule: 3(cos x)² · (cos x)' = 3cos²x · (−sin x) = −3 sin x cos²x.
You will not always have a formula. The AP exam loves giving a table and asking for a composite's derivative at a point.
| x | f(x) | f'(x) | g(x) | g'(x) |
|---|---|---|---|---|
| 1 | 3 | 5 | 2 | 4 |
| 2 | 5 | −3 | 4 | 1 |
Let h(x) = f(g(x)). Find h'(1).
By the chain rule, h'(1) = f'(g(1)) · g'(1). Read the table: g(1) = 2, so f'(g(1)) = f'(2) = −3; and g'(1) = 4. Therefore
h'(1) = f'(g(1))·g'(1) = f'(2)·g'(1) = (−3)(4) = −12.
The discipline that earns the point: evaluate the inside first (g(1) = 2), use it as the input to f', then multiply by g'(1). Mixing up which value feeds which function is the classic table-problem error.
Problem. Differentiate y = (3x² − 5x + 1)⁴.
Strategy. Outer = 4th power, inner = 3x² − 5x + 1. Use the general power rule.
Solution.
y' = 4(3x² − 5x + 1)³ · (6x − 5)
Justification / check. The factor (6x − 5) is the derivative of the inside; without it the answer is wrong. (sympy: (24x − 20)(3x² − 5x + 1)³, which is 4(6x−5)(3x²−5x+1)³ factored the same way. ✓)
Problem. Differentiate y = sin(3x²).
Strategy. Outer = sine, inner = 3x². Use d/dx[sin g] = cos g · g'.
Solution.
y' = cos(3x²) · 6x = 6x cos(3x²)
Justification / check. Inside derivative d/dx[3x²] = 6x. (sympy: 6x cos(3x²). ✓)
Problem. Differentiate y = (2x + 1)³(x − 4)².
Strategy. This is a product of two functions, each of which needs the chain rule (general power rule). Product rule first: (uv)' = u'v + uv', where u = (2x+1)³ and v = (x−4)².
Solution. Each factor's derivative uses the general power rule:
u' = 3(2x+1)² · 2 = 6(2x+1)²v' = 2(x−4) · 1 = 2(x−4)y' = 6(2x+1)²(x−4)² + (2x+1)³ · 2(x−4)
Factor out the common 2(2x+1)²(x−4):
y' = 2(2x+1)²(x−4)[3(x−4) + (2x+1)]
= 2(2x+1)²(x−4)(5x − 11)
Justification / check. (sympy: 2(x−4)(2x+1)²(5x−11). ✓) Both inside derivatives — the ·2 on u' and the ·1 on v' — are required.
Problem. Using the table, let m(x) = g(f(x)). Find m'(2).
| x | f(x) | f'(x) | g(x) | g'(x) |
|---|---|---|---|---|
| 1 | 3 | 5 | 2 | −1 |
| 2 | 1 | −2 | 4 | 2 |
Strategy. Chain rule: m'(x) = g'(f(x)) · f'(x).
Solution.
m'(2) = g'(f(2)) · f'(2) = g'(1) · f'(2) = (−1)(−2) = 2
Justification / check. f(2) = 1 feeds g', giving g'(1) = −1; multiply by f'(2) = −2. Result 2. ✓
Forgetting the inside derivative (THE #1 error).
Students write d/dx[(x² + 1)⁵] = 5(x² + 1)⁴ and stop. Why it's wrong: you differentiated the outer power but never multiplied by g'(x) = 2x. Fix: end every chain-rule line by literally asking "times the derivative of the inside" — here · 2x, giving 10x(x² + 1)⁴.
Stopping after one layer in a multi-layer composite.
For sin(√(x² + 1)), a student peels the sine, then the root, but forgets the innermost 2x. Why it's wrong: every layer contributes a factor. Fix: keep peeling until the inside is just x. The chain has as many factors as it has nested functions.
Applying the chain rule to a non-composite.
On y = x³ + 5x, a student "multiplies by the derivative of the inside" and invents extra factors. Why it's wrong: x³ is not a composite — x is not "inside" anything. Fix: the chain rule applies only when a whole function sits inside another. A bare power of x uses the ordinary power rule with no extra factor.
Mixing up which function is inside (sin²x vs. sin(x²)).
sin²x = (sin x)² has derivative 2 sin x · cos x (outer square, inner sine). sin(x²) has derivative cos(x²) · 2x (outer sine, inner square). Fix: ask "what is the last operation I'd perform?" — that's the outer function.
Plugging the wrong value into a table problem.
For h'(1) = f'(g(1))·g'(1), students compute f'(1) instead of f'(g(1)). Fix: evaluate the inside (g(1)) first and use it as the input to f'.
---
## (e) Practice Problems
d/dx[(x³ + 1)⁵] =d/dx[cos(x³)] =d/dx[√(x² + 1)] =d/dx[sin²x] =d/dx[tan(5x)] =d/dx[(x² + 1)⁻³] =Differentiate y = sin(√x). (Short answer.)
Differentiate y = (4x − 1)³(x + 2)² and factor your answer. (Short answer.)
(Justify) A student claims d/dx[cos(2x)] = −sin(2x). State whether this is correct, and justify your answer with a correct computation.
(Justify) Explain, using the chain rule, why d/dx[(g(x))ⁿ] requires the factor g'(x) but d/dx[xⁿ] does not. Reference the idea of a composite function in your explanation.
Table for Problems 11–13.
| x | f(x) | f'(x) | g(x) | g'(x) |
|---|---|---|---|---|
| 1 | 4 | 2 | 3 | −1 |
| 2 | 1 | 5 | 2 | 3 |
| 3 | 2 | −4 | 2 | 6 |
h(x) = f(g(x)), then h'(2) =If k(x) = g(f(x)), find k'(3). (Short answer.)
Let p(x) = f(x²). Find p'(1). (Short answer — calculator optional; the work is by hand from the table.)
Find an equation of the tangent line to y = (x² − 3)³ at x = 2. (Short answer.)
Differentiate y = sin(cos x). (Short answer.)
---
## (f) AP Exam Focus — Free Response
> The functions f and g are differentiable for all real numbers. Selected values of f, f', g, and g' are given in the table below.
| x | f(x) | f'(x) | g(x) | g'(x) |
|---|---|---|---|---|
| 1 | 3 | 5 | 2 | −1 |
| 2 | 4 | −2 | 4 | 2 |
| 3 | 1 | 1 | 1 | −4 |
| 4 | 2 | 3 | 3 | 3 |
Let k be the function defined by k(x) = f(g(x)).
(a) (2 points) Find k'(3). Show the computation that leads to your answer.
(b) (3 points) Write an equation of the line tangent to the graph of k at x = 3.
(c) (2 points) Let m be the function defined by m(x) = g(f(x)). Find m'(2). Show the work that leads to your answer.
(d) (2 points) A student computes k'(3) by evaluating f'(3)·g'(3). Explain why this computation is incorrect, and identify the correct quantity that should be evaluated in place of f'(3).
Total: 9 points
---
### Model Solution
(a) By the chain rule, k'(x) = f'(g(x))·g'(x), so
k'(3) = f'(g(3))·g'(3) = f'(1)·g'(3) = (5)(−4) = −20.
Since g(3) = 1, the inside value 1 is used as the input to f', giving f'(1) = 5. k'(3) = −20.
(b) The line tangent to k at x = 3 passes through (3, k(3)) with slope k'(3).
k(3) = f(g(3)) = f(1) = 3, so the point is (3, 3).k'(3) = −20 from part (a).y − 3 = −20(x − 3), i.e. y = −20x + 63.
(c) By the chain rule, m'(x) = g'(f(x))·f'(x), so
m'(2) = g'(f(2))·f'(2) = g'(4)·f'(2) = (3)(−2) = −6.
Here f(2) = 4, so the inside value 4 feeds g', giving g'(4) = 3. m'(2) = −6.
(d) The chain rule gives k'(3) = f'(g(3))·g'(3). The outer derivative f' must be evaluated at the inner output g(3) = 1, not at 3. The student evaluated f'(3), which uses the wrong input to f'. The correct quantity is f'(g(3)) = f'(1) = 5. (The student's answer f'(3)·g'(3) = (1)(−4) = −4 is therefore wrong; the correct value is −20.)
| Part | Points | Earned for |
|---|---|---|
| (a) | 2 | 1 pt: correct chain-rule setup f'(g(3))·g'(3). 1 pt: correct value −20 with g(3)=1 used. |
| (b) | 3 | 1 pt: k(3) = 3 (point). 1 pt: slope −20 consistent with (a). 1 pt: correct tangent-line equation. |
| (c) | 2 | 1 pt: setup g'(f(2))·f'(2). 1 pt: value −6 with f(2)=4 used. |
| (d) | 2 | 1 pt: identifies that f' must be evaluated at g(3), not at 3. 1 pt: states correct quantity f'(g(3)) = f'(1) = 5. |
Where students lose points:
f'(3) instead of f'(g(3)) — the most common table error (part a).k(3) = 3·1 = 3? No — k(3) = f(g(3)), a composition, not a product. Students who multiply table entries lose the point.k'(3) consistently. But an unsupported slope earns nothing.1. (B) 15x²(x³ + 1)⁴. General power rule: 5(x³+1)⁴ · 3x² = 15x²(x³+1)⁴. (sympy ✓)
- (A) forgot the inside derivative 3x² — the #1 error. (C) used x² instead of 3x². (D) failed to drop the exponent.
2. (C) −3x²sin(x³). d/dx[cos g] = −sin g · g', with g = x³, g' = 3x². (sympy: −3x²sin(x³) ✓)
- (A) dropped the inside derivative. (B) lost the negative sign. (D) differentiated the inside inside the sine incorrectly.
3. (B) x/√(x² + 1). Write as (x²+1)^(1/2): ½(x²+1)^(−1/2)·2x = x/√(x²+1). (sympy ✓)
- (A) forgot the inside 2x. (C) misapplied the power rule (didn't subtract from the exponent). (D) squared the inside derivative.
4. (C) 2 sin x cos x. sin²x = (sin x)²; general power rule: 2 sin x · cos x. (sympy: 2 sin x cos x ✓)
- (A) forgot the inside derivative cos x. (B) differentiated as if it were sin(x²) and mangled it. (D) confused inner/outer.
5. (B) 5sec²(5x). d/dx[tan g] = sec²g · g', g' = 5. (sympy: 5tan²(5x)+5 = 5sec²(5x) ✓)
- (A) forgot the inside 5. (C) put x inside the secant instead of 5x. (D) used the derivative of sec, not tan.
6. (B) −6x(x² + 1)⁻⁴. −3(x²+1)⁻⁴ · 2x = −6x(x²+1)⁻⁴. (sympy: −6x/(x²+1)⁴ ✓)
- (A) forgot the inside 2x. (C) sign error. (D) added 1 to the exponent instead of subtracting.
7. y = sin(√x) = sin(x^(1/2)). Then y' = cos(√x) · ½x^(−1/2) = cos(√x)/(2√x).
8. u = (4x−1)³, v = (x+2)². u' = 3(4x−1)²·4 = 12(4x−1)²; v' = 2(x+2).
y' = 12(4x−1)²(x+2)² + (4x−1)³·2(x+2)
= 2(4x−1)²(x+2)[6(x+2) + (4x−1)]
= 2(4x−1)²(x+2)(10x + 11)
9. The student is incorrect. By the chain rule, d/dx[cos(2x)] = −sin(2x)·(2x)' = −sin(2x)·2 = −2sin(2x). The student omitted the derivative of the inside function 2x, which is 2. The correct derivative is −2 sin(2x).
10. (g(x))ⁿ is a composite function: the inner function g(x) is plugged into the outer function uⁿ. The chain rule requires multiplying by the derivative of the inner function, g'(x). By contrast, xⁿ is not a composite — the base is just x, whose derivative is 1, so the factor g'(x) = 1 contributes nothing and is invisible. The general power rule reduces to the ordinary power rule precisely when the inside is x.
11. (B) 15. h'(2) = f'(g(2))·g'(2). From the table, g(2) = 2, so f'(g(2)) = f'(2) = 5, and g'(2) = 3. Thus h'(2) = 5·3 = 15.
- (A) 5 used f'(2) alone, forgetting the factor g'(2). (C) 2 read f'(g(2)) as g(2). (D) −3 mixed up signs/rows.
12. k(x) = g(f(x)), k'(x) = g'(f(x))·f'(x). At x = 3: f(3) = 2, so g'(f(3)) = g'(2) = 3; f'(3) = −4. k'(3) = 3·(−4) = −12.
13. p(x) = f(x²), p'(x) = f'(x²)·2x. At x = 1: f'(1²) = f'(1) = 2, times 2(1) = 2. p'(1) = 2·2 = 4.
14. y = (x²−3)³. y' = 3(x²−3)²·2x = 6x(x²−3)². At x = 2: y(2) = (4−3)³ = 1; y'(2) = 6(2)(1)² = 12. Tangent line: y − 1 = 12(x − 2), i.e. y = 12x − 23. (sympy: f(2)=1, f'(2)=12 ✓)
15. y = sin(cos x). Outer sine, inner cosine: y' = cos(cos x)·(−sin x) = −sin x · cos(cos x).
---
CalcIQ · Lesson 12 of 35 · Unit 3: Differentiation: Composite, Implicit, Inverse
This lesson is independent study material and is not endorsed by or affiliated with the College Board. AP® is a registered trademark of the College Board.
Accuracy review: All derivatives in this lesson were recomputed by hand and independently verified with sympy. Reviewed for mathematical accuracy by Isaac (retired actuary).