Chain Rule Examples: Nested Functions Explained Step by Step

Differentiate . If you apply the ordinary power rule as though the parentheses contained only , you get . The shape looks right, but a factor of two is missing. The expression inside the parentheses changes twice as fast as , and the derivative has to carry that change.
That missing factor is the point of the chain rule. This lesson works through original chain rule examples, from one inner function to three nested layers. For the broader meaning of a derivative, start with our derivative guide. Here we will focus on recognizing the layers, differentiating them, and checking the result.
Spot the inner and outer functions
A composition feeds the output of one function into another. In , first calculate , then raise the result to the fifth power. Write for the inner function and for the outer function. Then .
The order of evaluation and the order of differentiation run in opposite directions. To evaluate, move from the inside out. To differentiate, start with the outside operation, keep its input unchanged, and then multiply by the derivative of that input. OpenStax states the rule this way for differentiable compositions in its chain rule chapter:
The derivative of the outer function is evaluated at , not at . The inner derivative is a separate factor. If either layer is not differentiable at the relevant point, this formula cannot simply be applied there.
Try naming the layers before touching a rule. In , the outer operation is sine and the inner expression is . In , the outer operation is square root and the inner expression is . In , the top-level operation is addition; differentiate the terms separately. Not every set of parentheses announces a chain rule.
If the idea of feeding one function into another is new, composite functions covers evaluation and domain before differentiation. Functions themselves are the starting point if input and output notation is still unfamiliar.
Use the same four steps every time
The method does not change with the size of the expression:
- Name the immediate inner expression. For , use .
- Differentiate the outside while leaving in place. Since the outside is , its derivative is .
- Differentiate the inside. Here .
- Multiply and restore the expression. The result is .
Do not expand the fourth power unless a later calculation requires it. The factored answer shows where each piece came from: belongs to the outer power, while belongs to the inner quadratic. Expanding early makes a missing factor harder to see.
For three layers, repeat the same action. Differentiate the outermost layer, multiply by the derivative of the next layer, then multiply by the derivative of the deepest one. OpenStax develops that repeated use of the chain rule in the same chapter. There is no new rule to memorize.
Three complete worked examples
A power of a linear expression. Return to . The outer derivative is and the inner derivative is . Therefore:
Check at without trusting the symbolic answer. The original function has . Expanding only the first-order term in gives , so the slope at zero is . Our derivative gives . The version without the inner factor gives and fails this check.
A trigonometric composition. Let , with angles in radians. The outer derivative of sine is cosine evaluated at the same input, and the inner derivative of is :
At the inner derivative is zero, so . That makes sense as a local symmetry check: depends on , so it takes the same value at and . At , the slope is , not . The cosine receives the unchanged inner expression, not its derivative.
Three nested layers. Take . The layers, from outside inward, are a cube, sine, and . Differentiate each in that order:
There are three factors because three changes are linked. The cube contributes , sine contributes cosine, and the quadratic contributes . Again, , consistent with the even function . This does not prove the whole derivative, but it quickly catches some algebra errors.
Decide when another rule is needed
Find the top-level operation first. In , two variable expressions are multiplied. Begin with the product rule, then use the chain rule on the powered factor:
By contrast, has no top-level product, so the chain rule alone gives . The two expressions differ by a factor of outside the power, and that factor changes the governing rule.
A quotient can hide the same choice. For , rewrite it as . Its top-level operation is a power, so:
The quotient rule would also work, but rewriting makes the composition plain. If both numerator and denominator depend on , use the quotient rule at the top and inspect each part for a chain rule. OpenStax treats these combinations together in its chain rule section.
Repair three common wrong answers
Missing the inner factor. For , the answer leaves out the derivative . Write the two pieces before multiplying: .
Changing the outer function's input. For , the answer puts the derivative of the inside into sine. The correct derivative is . Differentiate the outside at the unchanged inside, then attach the inside's derivative.
Losing parentheses. For , is not the chain rule. The entire inner expression stays inside the squared power: . Write large parentheses around the inside until the final line.
One useful check is to evaluate both the original function and your derivative at a simple point. An easy numerical value will not prove a derivative for every , but a disagreement can disprove a tempting wrong answer quickly.
Three practice problems with full solutions
Try each before reading its solution. Mark the layers, then write one factor per layer.
1. Differentiate . The outer derivative is . The inner derivative is , so:
The negative sign is the quick check: near a point where is positive, increasing reduces that inner quantity and therefore reduces its fourth power.
2. Differentiate . The outer cosine becomes negative sine; the inner polynomial becomes :
At , this gives zero because . Do not infer that the inner derivative is zero there; it equals one. Keeping the two factors separate tells you why the product vanishes.
3. Differentiate . The outer power contributes ; the inside derivative is :
Here the inside contains sine, but the top-level operation is still the cube. Work from the outside inward. At , the derivative is .
Once these are comfortable, Math Zen's derivatives practice includes a chain-rule skill among its calculus exercises. Return to an example you missed and explain which factor was absent before trying the next one. The habit to keep is simple: name the outer operation, preserve its input, and multiply by the derivative of that input.
Frequently asked questions
Is the chain rule the same as the power rule?
No. The power rule differentiates . The chain rule lets you use it on a power of an inner expression: the derivative of is . If , its derivative is one and the familiar power rule appears.
Can I use the chain rule for a square root?
Yes. Rewrite as . The outer derivative is and the inner derivative is , giving .
Why do nested functions produce multiple factors?
Each layer responds to the change in the layer inside it. In , a change in changes the quadratic, which changes sine, which changes the cube. The three derivative factors describe those three linked changes.


