How to use the chain rule
Last updated: 2026-11-26
The chain rule differentiates a function inside another function: take the derivative of the outer function, keep the inner function inside it, then multiply by the derivative of the inner function. In symbols, if C(x) = f(g(x)), then C'(x) = f'(g(x)) g'(x). This holds when the inner function g has a derivative at x and the outer function f has one at g(x).
Start learning No account needed
1. Find the inner function first
Ask what you would compute first if you were given a number for x. That first calculation is the inner function. What you then do to its result is the outer function. In sin(x2), you square x and then take the sine, so the inner function is x2 and the outer one is sine.
| Function | Inner u | Outer | Derivative |
|---|---|---|---|
| (3x2 + 1)4 | 3x2 + 1 | u4 | 4(3x2 + 1)3 × 6x |
| sin(x2) | x2 | sin u | cos(x2) × 2x |
2. A worked example: (3x2 + 1)4
- Name the parts: u = 3x2 + 1, and the outer function is u4.
- Differentiate the outer function with respect to u: 4u3.
- Differentiate the inner function with respect to x: 6x.
- Multiply and put u back: 4(3x2 + 1)3 × 6x, which is 24x(3x2 + 1)3.
At x = 1 the inner value u is 4, the outer derivative is 256 and the inner derivative is 6, so the product is 1536.
3. The mistake: dropping the inner derivative
If you stop after step 2 you get 256 at x = 1, which is the correct value divided by 6. A numerical estimate shows which one is right. Evaluate the function a tiny step above and below x = 1, subtract, and divide by the distance between the two points. That gives about 1536, not 256.
A short script, scripts/how-to-use-the-chain-rule-worked-example.py, runs that comparison. The practice answers are at the bottom, so cover them for now.
inner u = 3x^2 + 1 at x = 1: u = 4, du/dx = 6x = 6, outer 4u^3 = 256
4u^3 times 6x = 24x(3x^2 + 1)^3
(3x^2 + 1)^4 at x = 1
numerical estimate (step 1e-05): 1536.0000
chain rule: 1536.0000
inner derivative left out: 256.0000
sin(x^2) at x = 1
numerical estimate (step 1e-05): 1.0806
chain rule: 1.0806
inner derivative left out: 0.5403
sin((3x + 1)^2) at x = 1
numerical estimate (step 1e-05): -22.9838
chain rule: -22.9838
inner derivative left out: -0.9577
practice answers:
(2x - 7)^3 at x = 1
numerical estimate (step 1e-05): 150.0000
chain rule: 150.0000
inner derivative left out: 75.0000
sqrt(5x + 4) at x = 1
numerical estimate (step 1e-05): 0.8333
chain rule: 0.8333
inner derivative left out: 0.1667
4. More than two layers
When there are more layers, work from the outside in and multiply one derivative for each layer. In sin((3x + 1)2), the layers are the sine, the square and 3x + 1, so the derivative is cos((3x + 1)2) × 2(3x + 1) × 3. Before you finish, point to each layer and find its factor in your answer.
5. Test yourself
Differentiate (2x − 7)3 and the square root of 5x + 4. For each, write the inner and outer function first, then find the value at x = 1. Compare with the script output.
See also how to remember derivatives of trig functions and how to study for calculus.
What the sources found, and their limits
Active Calculus, section 2.5, The chain rule. Matthew Boelkins. It names the inner and outer functions and states the rule with its differentiability conditions. Source: The chain rule, read in part on 2026-11-25.
Wikipedia, Chain rule. It gives the rule for a composition, in two notations, and the reading as a product of rates of change. Source: Chain rule, read in part on 2026-11-25. Limits: a numerical estimate at one point can catch a missing factor there, and it is not a proof. The examples are ours.
How Professor Turing helps
Professor Turing is a tutor for adults learning any subject, in college or on their own. It asks you questions instead of giving the final answer, does not grade a bare guess, and remembers what you got wrong. No account is needed to start. It's an AI tutor, free to try.
Bring a derivative with a function inside a function. Its first reply asks what you already know before it teaches anything. If you answer with a bare guess, it asks how you got there instead of saying right or wrong, and when you stay stuck it changes its approach and makes the next step smaller, so you work it out yourself. You must be 18 or older, and guest conversations are deleted 7 days after the last activity.
FAQ
How do I know when I need the chain rule? Look for a function applied to something other than plain x, such as a power of a bracket or the sine of x squared.
Do I use the product rule or the chain rule? Use the product rule for two functions multiplied together and the chain rule for one function inside another. A problem can need both.
Start with what you're working on
Tell the tutor which derivative you are working on and let it ask you the questions.
Start learning No account needed
See also: how to do related rates · how to use the product rule · all study guides