How it works · Core ideas
Chain Rule Explained: How to Differentiate Composite Functions
The chain rule in plain words: inside and outside functions, rates that multiply, step-by-step examples, real-life uses and the mistakes to avoid.
Checked against 4 sources (3 textbook, course or government) · By Ambient Math editors
The short answer. The chain rule differentiates a function inside another function: differentiate the outside function, leave the inside function alone, then multiply by the derivative of the inside function1. It works because rates of change multiply along a chain3.
- Outside function
- The last operation you would perform in an evaluation1
- Leibniz form
- dz/dx = dz/dy · dy/dx, rates multiply3
- Most common slip
- Multiplying the whole expression by an inside derivative that belongs to one term1
On this page
Take sin(x²). The derivative of sin is cos, and the power rule handles x². Neither one alone handles the pair. None of the basic rules works on functions like this, even though such functions are closer to the ones you actually meet than the simple kind1. The power rule alone simply will not get the derivative1. The chain rule is the missing piece.
What is a composite function?
A composite function is a function inside a function: you feed x into one rule, then feed the result into another. Back in the algebra of functions this is written f(g(x)). The chain rule is the rule for finding the derivative of the composition of two or more functions2. Breaking a function into simpler parts that we can already differentiate can get cumbersome, so the chain rule replaces that detour2.
Two names do all the work. We identify the inside function and the outside function1. The outside function is the last operation that we would perform in an evaluation1. Here is how that sorts out a few functions:
| Function | Inside | Outside |
|---|---|---|
| sin(3x² + x) | 3x² + x | sine1 |
| (2x + 1)⁵ | 2x + 1 | raising to the fifth power1 |
| e^(−3x) | −3x | the exponential1 |
| ln(x² + 1) | x² + 1 | the natural logarithm1 |
Identifying the outside function is usually simple because it really is the outside function in some sense1. When it is not obvious, ask which operation you would do last when plugging in a number1.
The chain rule formula
In words: differentiate the outside function leaving the inside function alone, then multiply all of this by the derivative of the inside function1. In symbols, with outside function f and inside function g:
Lagrange form: d/dx f(g(x)) = f′(g(x)) · g′(x)3
Leibniz form: if y = f(u) and u = g(x), then dy/dx = dy/du · du/dx3
The 2 forms are the same rule, and the common notation of the chain rule is due to Leibniz3. Each form has its uses, but the first is the one most course work uses1. When using the Leibniz form, the final answer must be expressed entirely in terms of the original variable given in the problem2.
How to interpret the chain rule: rates multiply
Intuitively, knowing the instantaneous rate of change of z relative to y and that of y relative to x allows you to calculate the instantaneous rate of change of z relative to x as the product of the 2 rates of change3. That is the whole meaning. A change in x causes a change in y, which causes a change in z, and each link in the chain contributes one factor3.
Walk through the diagram above. A bicycle is 4 times as fast as a walker, and a car is 2 times as fast as the bicycle, so the car is 4 × 2 = 8 times as fast as the walker. The speeds in the picture are illustrative, and the logic is the one the encyclopedia article uses to explain the rule3. Replace “times as fast” with “rate of change” and you have the chain rule.
The MIT lecture reaches the same place from the algebra. It writes the ratio of changes as a product, the change in y over the change in x times the change in x over the change in t, and then lets the changes shrink4. That step works because Δx → 0 too as Δt → 0, because of continuity4.
Differentiating a chain means multiplying the links of the chain.
Step by step with worked examples
The method has 4 steps. First, identify the outside and inside functions1. Second, differentiate the outside function while leaving the inside function alone1. Third, multiply by the derivative of the inside function1. Fourth, simplify. When working from the outside in, differentiate one layer at a time2.
Worked example (our arithmetic) 1: sin(3x² + x), a function from the course notes1:
| Step | Arithmetic |
|---|---|
| Outside function and its derivative | sin u, derivative cos u1 |
| Inside function and its derivative | u = 3x² + x, derivative 6x + 11 |
| Multiply | d/dx sin(3x² + x) = cos(3x² + x) · (6x + 1)1 |
| Value at x = 1 | cos(4) · 7 = −0.6536 × 7 = −4.5751 |
Worked example (our arithmetic) 2: (2x + 1)⁵, with a numeric check by a tiny step2:
| Step | Arithmetic |
|---|---|
| Outside: u⁵, derivative 5u⁴ | 5(2x + 1)⁴2 |
| Inside: 2x + 1, derivative | 22 |
| Multiply | 5(2x + 1)⁴ · 2 = 10(2x + 1)⁴2 |
| Value at x = 1 | 10 × 3⁴ = 10 × 81 = 8102 |
| Check: f(1) = 3⁵ and f(1.001) = 3.002⁵ | 243 and about 243.81, so the slope is about 0.81 ÷ 0.001 = 8102 |
Worked example (our arithmetic) 3: e^(−3x), the exponential with the inside left alone1. Remember that the derivative of the exponential function with the inside left alone is just the original function1:
| Step | Arithmetic |
|---|---|
| Outside derivative, inside untouched | e^(−3x)1 |
| Derivative of the inside −3x | −31 |
| Result | d/dx e^(−3x) = −3 e^(−3x)1 |
| Value at x = 0 | −3 × 1 = −31 |
Worked example (our arithmetic) 4: ln(x² + 1), a natural logarithm outside an inside1:
| Step | Arithmetic |
|---|---|
| Outside: ln u, derivative 1/u | 1 / (x² + 1)1 |
| Inside: x² + 1, derivative | 2x1 |
| Result | 2x / (x² + 1)1 |
| Value at x = 1 | 2 / 2 = 11 |
Three layers deep
Sometimes there are more than 2 layers. The derivative of the composition of three functions has three parts, and in general each added function adds a part2. Differentiating the composition of three or more functions means applying the chain rule more than once, and we can always work from the outside in, one derivative at a time2. There is no formula to memorize: simply apply the chain rule multiple times2. In many functions the rule is used more than once, so do not be alarmed when it happens1. In integration, the counterpart to the chain rule is the substitution rule3.
Worked example (our arithmetic): sin(√(x² + 1)), 3 layers2:
| Layer | Derivative |
|---|---|
| Outermost: sin u | cos u2 |
| Middle: u = √v, with v = x² + 1 | 1 / (2√v)2 |
| Innermost: v = x² + 1 | 2x2 |
| Product | cos(√(x² + 1)) · 1/(2√(x² + 1)) · 2x = x cos(√(x² + 1)) / √(x² + 1)2 |
| Value at x = √3, where √(x² + 1) = 2 | √3 × cos(2) / 2 = 1.732 × (−0.4161) / 2 = −0.36042 |
Using the chain rule with other rules
Having the chain rule does not mean the product and quotient rules are no longer needed1. Some problems are product or quotient rule problems that involve the chain rule1. Other problems first require the chain rule, and in the process of doing that you need the product or quotient rule1. The order varies from problem to problem1. For a product of two functions, first apply the product rule, then apply the chain rule to each term of the product2. For a rational expression, the first step is the quotient rule1. The chain rule can also be used to derive some well-known differentiation rules: the quotient rule is a consequence of the chain rule and the product rule3.
Worked example (our arithmetic): x² sin(3x), first a product, then a chain on the sine12:
| Step | Arithmetic |
|---|---|
| Product rule | (x²)′ · sin(3x) + x² · (sin(3x))′2 |
| Chain on sin(3x): cos(3x) times the inside derivative 3 | 3 cos(3x)1 |
| Result | 2x sin(3x) + 3x² cos(3x)12 |
| Value at x = 1 | 2 × 0.1411 + 3 × (−0.98999) = 0.2822 − 2.9700 = −2.68772 |
For the full table of rules to combine with this one, keep the derivative rules cheat sheet open.
What is the chain rule used for in real life?
Any time one changing quantity depends on another that is itself changing, rates multiply. The Leibniz form is used heavily in physics applications2. The idea even underlies the backpropagation algorithm, which is used in gradient descent of neural networks in deep learning3.
Worked example (our arithmetic): a spherical balloon. Its volume is V = (4/3)πr³ and its radius grows with time. If the radius is 5 cm and growing at 0.2 cm per second, how fast is the volume growing? The chain rule links the 2 rates, dV/dt = dV/dr · dr/dt3:
| Step | Arithmetic |
|---|---|
| dV/dr | 4πr² = 4π × 25 = 100π3 |
| dr/dt | 0.2 cm per second3 |
| dV/dt | 100π × 0.2 = 20π ≈ 62.83 cubic centimeters per second3 |
A cost example is simpler. If making x units costs C = 50 + 2x dollars, and production is x = 10t units after t weeks, then dC/dt = dC/dx · dx/dt = 2 × 10 = 20 dollars per week3. In every case, the answer must be expressed in terms of the variable the problem asks about2.
The chain rule seems to have first been used by Gottfried Wilhelm Leibniz3. He first mentioned it in a 1676 memoir, with a sign error in the calculation, and the notation we still use is his3.
Common mistakes
- Multiplying the whole thing by an inside derivative. One of the more common mistakes is to multiply the whole expression by the “−9” instead of just the term it belongs to1.
- Differentiating the inside along with the outside. Leave the inside function alone when differentiating the outside function1.
- Evaluating a derivative at a derivative. We never do that2.
- Expecting a single chain rule per problem. There can be 2 terms that each need a separate application1.
- Choosing the wrong outside function. The outside function is the last operation in an evaluation1.
- Skipping steps while learning. It is usually best to be careful and write out a couple of extra steps rather than do it all in your head1. Once you get better, you can do these fairly quickly in your head1.
Where to go next
The chain rule is one tool in a set. Start with what a derivative is if the idea of a rate of change is still fresh, and read the Fundamental Theorem of Calculus to see the chain rule appear in the first part of that theorem. The core ideas section collects the rest. For the source texts, see Lamar University on the chain rule, OpenStax section 3.6 and the MIT chain rule lecture.
Common questions
Can you explain the chain rule in a simple way?
Peel the function like an onion. Differentiate the outer layer while leaving what is inside it untouched, then multiply by the derivative of what was inside1. Each extra layer adds one more factor to the product2.
What is the chain rule used for in real life?
Anywhere one changing quantity depends on another that is itself changing: a balloon's volume that depends on its radius, a cost that depends on units made3. In physics the Leibniz form is used heavily2, and the rule also underlies how neural networks are trained3.
Read next
Derivative rules cheat sheet
Derivative rules of a first calculus course on one page: all six trig functions, a^x, logs, inverse trig, with examples.
Core ideasWhat Is a Derivative in Calculus? Simple Explanation
A derivative is the instantaneous rate of change of a function: the slope of its tangent line. Plain meaning, worked examples, notation and when it fails.
Core ideasWhat Is a Limit in Calculus? Plain Meaning, Examples
A limit is the value a function approaches as its input nears a point. Plain meaning, worked examples, when limits fail to exist, and the formal definition.
Sources
- Calculus I: Chain Rule · Paul's Online Math Notes, Lamar University · tutorial.math.lamar.edu · checked October 21, 2026
- 3.6 The Chain Rule, Calculus Volume 1 · OpenStax (Rice University) · openstax.org · checked October 21, 2026
- Chain rule · Wikipedia · en.wikipedia.org · checked October 21, 2026
- 18.01 Single Variable Calculus, Lecture 4: Chain Rule, and Higher Derivatives · MIT OpenCourseWare · ocw.mit.edu · checked October 21, 2026
Published . Every source shows the day it was read. Diagrams: original, by the editors. How we check facts · Report an error.