- The chain rule differentiates a function of a function: if \( y \) depends on \( u \) and \( u \) depends on \( x \), then \( \dfrac{dy}{dx} = \dfrac{dy}{du} \times \dfrac{du}{dx} \).
- In words: differentiate the outside function, leave the inside alone, then multiply by the derivative of the inside.
- In our bakery case, cost rises by $3.70 per extra loaf and output rises by 5 loaves per extra labour hour, so cost rises by \( 3.70 \times 5 = \$18.50 \) per extra hour.
- The outside derivative must be evaluated at the inside value (160 loaves), not at the original input (16 hours). That one slip costs more exam marks than any other.
- The chain rule is AP Calculus topic 3.1, part of Cambridge 9709 Paper 1 differentiation, and IB Analysis and Approaches SL 5.6.
The case: what does one more hour of work cost a bakery?
A small neighbourhood bakery bakes bread every morning. The owner has noticed two things. First, the number of loaves made depends on the number of labour hours worked in the kitchen, but with diminishing returns: the oven and the mixing bench are shared, so each extra hour adds a little less than the one before. Second, the daily running cost (flour, energy, packaging and a fixed amount for rent) depends on the number of loaves made, and it rises faster at high output because the bakery starts paying rush delivery charges for extra flour.
Suppose the owner has fitted two simple models to her records. The numbers are illustrative, not data from a real business:
| Relationship | Model | Units |
|---|---|---|
| Output from labour | \( q = 40\sqrt{h} \) | loaves per day, \( h \) in hours |
| Cost from output | \( C = 150 + 0.5q + 0.01q^2 \) | dollars per day |
The kitchen currently runs 16 labour hours a day, which gives \( q = 40\sqrt{16} = 160 \) loaves. The owner is thinking of adding hours for the busy season. Her question is simple: at the current level of 16 hours, how fast does the daily running cost rise per extra hour of labour? That is a question about \( \dfrac{dC}{dh} \), but cost is not written in terms of hours. It is written in terms of loaves, and loaves are written in terms of hours. Cost is a function of a function.
The concept: rates that pass through a middle quantity
When one quantity affects a second only by way of a third, the effect travels along a chain. Hours change loaves, and loaves change cost. If you know how sensitive each link is, you can work out how sensitive the whole chain is. You do not need to rebuild the relationship from scratch.
Think of it as a currency conversion. If one euro buys 1.1 dollars, and one dollar buys 3.75 riyals, then one euro buys \( 1.1 \times 3.75 = 4.125 \) riyals. Exchange rates multiply because each one is measured “per unit” of the thing before it. Derivatives are also “per unit” rates. The rate of cost per loaf times the rate of loaves per hour is the rate of cost per hour. The loaves cancel in the units just as dollars cancel in the currency sum.
In the language of functions, cost as a function of hours is the composite \( C(q(h)) \): the inside function \( q(h) \) is worked out first, then its result is fed into the outside function \( C(q) \).
The formula
Here \( x \) is the original input (labour hours), \( u = g(x) \) is the middle quantity (loaves), and \( y = f(u) \) is the final output (cost). The term \( \dfrac{dy}{du} \), or \( f'(u) \), is the rate of the outside function, and \( \dfrac{du}{dx} \), or \( g'(x) \), is the rate of the inside function. The second line is the same rule in function notation, and it makes one point very clear: \( f’ \) is evaluated at \( g(x) \), the inside value, not at \( x \) itself.[1]
Why this formula fits the case
The chain rule is the right tool whenever the quantity you want to differentiate depends on your variable only through another quantity. That is exactly the bakery’s position: cost has no direct link to hours. Hours matter only because they make loaves. The informal argument behind the rule is the cancelling you saw in the units. For small changes,
and as \( \Delta h \) shrinks to zero, \( \Delta q \) shrinks too, so each ratio of small changes becomes a derivative. A full proof takes care of the case where \( \Delta q \) is zero, but the idea is the same.[2]
The chain rule is not the tool when two functions of \( x \) are multiplied side by side, as in \( x^2 e^x \). There, both factors depend on \( x \) directly, and you need the product rule. A quick test: ask which operation is done last when you work the expression out for a number. If the last step is “apply a function to a bracket” (square it, take its square root, take \( e \) to that power), use the chain rule. If the last step is “multiply two pieces”, use the product rule. Many real questions need both.
Setting it up
Before any calculus, label the chain and the units:
- Input: \( h \), labour hours per day, with \( h > 0 \). We care about \( h = 16 \).
- Middle quantity: \( q = 40\sqrt{h} = 40h^{1/2} \), loaves per day. At \( h = 16 \), \( q = 160 \).
- Output: \( C = 150 + 0.5q + 0.01q^2 \), dollars per day.
- Target: \( \dfrac{dC}{dh} \) in dollars per labour hour, which equals \( \dfrac{dC}{dq} \) (dollars per loaf) times \( \dfrac{dq}{dh} \) (loaves per hour).
Writing the units next to each derivative is a cheap check. If the units of your two factors do not cancel to give the units you want, the chain has been set up the wrong way round.
Solving it
With \( q = 40\sqrt{h} \) and \( C = 150 + 0.5q + 0.01q^2 \), find \( \dfrac{dC}{dh} \) when \( h = 16 \).
At 16 hours a day, one more hour of labour raises the daily running cost by about $18.50, not counting the wage for that hour.
Here substitution happened to be easy, which made a good check. Often it is not, and the chain rule is the only sensible route. The next example is a classic from science: a balloon whose radius is given as a function of time.
A spherical balloon is inflated so that its radius after \( t \) seconds is \( r = \sqrt{4 + 3t} \) cm. Its volume is \( V = \tfrac{4}{3}\pi r^3 \). Find the rate at which the volume is increasing when \( t = 4 \).
Step 3 used the chain rule inside the chain rule. That is normal: a chain can have as many links as you like, and you multiply one derivative for each link.
As a check on the balloon, write \( V \) straight in terms of \( t \): \( V = \tfrac{4}{3}\pi(4 + 3t)^{3/2} \). Then \( \dfrac{dV}{dt} = \tfrac{4}{3}\pi \times \tfrac{3}{2}(4 + 3t)^{1/2} \times 3 \), which is \( 6\pi\sqrt{4 + 3t} \), and at \( t = 4 \) this is \( 6\pi \times 4 = 24\pi \) again. Exam questions usually want the second, “one line” style, so the next example practises it on a pure-maths curve.
Exam style. The curve has equation \( y = (x^2-3)^4 \). Find the gradient at \( x = 2 \) and the equation of the tangent there.
Expanding \( (x^2-3)^4 \) first would give a polynomial of degree 8 and plenty of chances to slip. The chain rule gets there in two lines.
What the answer tells us
The figure of $18.50 per hour is a marginal cost, but measured per unit of the input (labour) rather than per unit of the output (loaves). It is built from two pieces with a clear meaning. Each extra loaf costs about $3.70 at the current output, and each extra hour makes about 5 extra loaves. If the owner pays a baker $15 an hour, an extra hour costs her roughly \( 18.50 + 15 = \$33.50 \) a day in total, and she can compare that with the revenue from 5 more loaves.
The units check out: dollars per loaf times loaves per hour gives dollars per hour. The size is sensible too: 5 extra loaves at a few dollars each is the right order of magnitude.
The chain rule also shows how the answer changes with the number of hours, because the two links move in opposite directions. More hours means more loaves, so the cost per extra loaf rises. But more hours also means each hour adds fewer loaves.
| Hours \( h \) | Loaves \( q \) | \( dC/dq \) ($ per loaf) | \( dq/dh \) (loaves per hour) | \( dC/dh \) ($ per hour) |
|---|---|---|---|---|
| 9 | 120 | 2.90 | 6.67 | 19.33 |
| 16 | 160 | 3.70 | 5.00 | 18.50 |
| 25 | 200 | 4.50 | 4.00 | 18.00 |
The second effect wins slightly, so the cost of an extra hour falls a little as hours grow, from about $19.33 at 9 hours to $18.00 at 25 hours. That matches the direct formula \( \dfrac{dC}{dh} = 16 + \dfrac{10}{\sqrt{h}} \), which decreases towards $16 as \( h \) grows. Figure 1 plots this rate for every number of hours from 1 to 30.
If you want the full build-up, from the derivative as a limit through to the product, quotient and chain rules with plenty of worked examples, the Mathematics Made Simple textbook covers it in Chapter 10. For drilling, the Mathematics Made Simple practice book has graded questions with every step of every answer shown.
Practice questions
EasyQ1. Differentiate \( y = (5x + 2)^3 \). Show worked answer
\( \dfrac{dy}{dx} = 3(5x + 2)^2 \times 5 = 15(5x + 2)^2 \).
EasyQ2. Differentiate \( y = e^{4x^2} \). Show worked answer
\( \dfrac{dy}{dx} = e^{4x^2} \times 8x = 8x\,e^{4x^2} \).
MediumQ3. Find the gradient of \( y = \sqrt{1 + x^3} \) at \( x = 2 \). Show worked answer
\( \dfrac{dy}{dx} = \tfrac{1}{2}(1 + x^3)^{-1/2} \times 3x^2 = \dfrac{3x^2}{2\sqrt{1 + x^3}} \).
At \( x = 2 \): \( \dfrac{3 \times 4}{2\sqrt{9}} = \dfrac{12}{6} = 2 \).
MediumQ4. A firm’s daily revenue is \( R = 60q-0.5q^2 \) dollars, where \( q \) units are sold. Sales grow over time as \( q = 4t + 10 \), with \( t \) in weeks. Find \( \dfrac{dR}{dt} \) when \( t = 5 \) and interpret it. Show worked answer
\( \dfrac{dR}{dq} = 60-q = 60-30 = 30 \) dollars per unit; \( \dfrac{dq}{dt} = 4 \) units per week.
\( \dfrac{dR}{dt} = 30 \times 4 = 120 \). After 5 weeks, daily revenue is rising by about $120 per week.
ExamQ5. A curve has equation \( y = (x^2-4x + 5)^3 \). (a) Find \( \dfrac{dy}{dx} \). [2] (b) Find the coordinates of the only stationary point. [2] (c) Find the equation of the normal to the curve at \( x = 3 \), in the form \( ax + by = c \). [3] Show worked answer
(b) \( x^2-4x + 5 = (x-2)^2 + 1 \ge 1 \), so the bracket is never zero, and \( \dfrac{dy}{dx} = 0 \) only when \( 2x-4 = 0 \), giving \( x = 2 \) [1]. Then \( y = (4-8 + 5)^3 = 1 \), so the point is \( (2, 1) \) [1].
(c) At \( x = 3 \): \( y = (9-12 + 5)^3 = 2^3 = 8 \), and \( \dfrac{dy}{dx} = 3 \times 2^2 \times 2 = 24 \) [1]. The normal has gradient \( -\tfrac{1}{24} \) [1].
\( y-8 = -\tfrac{1}{24}(x-3) \), so \( 24y-192 = -x + 3 \), giving \( x + 24y = 195 \) [1].
Frequently asked questions
How do I know when to use the chain rule?
Use it whenever a function is applied to something other than plain \( x \): a bracket raised to a power, a square root of an expression, \( e \) to a power like \( 3x^2 \), or \( \sin \), \( \cos \) or \( \ln \) of an expression. If the inside is just \( x \), the chain rule still holds, but the inside derivative is 1, so you will not notice it.
What is the difference between the chain rule and the product rule?
The product rule is for two functions multiplied together, such as \( x^3\sin x \). The chain rule is for one function inside another, such as \( \sin(x^3) \). Work out which operation would be done last when you calculate the expression for a number, and use that rule first.
Can you use the chain rule more than once?
Yes. Each link gives one factor. For \( y = \sin^2(3x) = \big(\sin 3x\big)^2 \) there are three links: squaring, sine and multiplying by 3. So \( \dfrac{dy}{dx} = 2\sin 3x \times \cos 3x \times 3 = 6\sin 3x\cos 3x \), which also equals \( 3\sin 6x \).
Is the chain rule the same as related rates?
Related rates problems are one use of the chain rule, where every quantity depends on time. The balloon example above is one: \( \dfrac{dV}{dt} = \dfrac{dV}{dr} \times \dfrac{dr}{dt} \). The same idea, extended to functions of several variables, appears in economics as the multivariable chain rule.
References
- Strang, G. and Herman, E. (2016). Calculus Volume 1. Houston, TX: OpenStax. Section 3.6, The Chain Rule. https://openstax.org/details/books/calculus-volume-1
- Stewart, J. (2016). Calculus: Early Transcendentals, 8th edition. Boston, MA: Cengage Learning.
- College Board (2020). AP Calculus AB and AP Calculus BC Course and Exam Description. New York: College Board.
- Cambridge International. Cambridge International AS & A Level Mathematics 9709: Syllabus for examination in 2026 and 2027. Cambridge: Cambridge University Press & Assessment.
- International Baccalaureate Organization (2019). Mathematics: analysis and approaches guide (first assessment 2021). Cardiff: IBO.

