Your library

Published · Updated · AI-assisted research

The Chain Rule: Differentiating Functions Within Functions

Understand why rates multiply, identify nested layers, and work through derivatives without losing an inner factor.

To differentiate a composite function y = f(g(x)), differentiate the outer function at the unchanged inner expression, then multiply by the inner derivative: y′ = f′(g(x))g′(x). The essential idea is that changes pass through successive functions, so the derivative must account for both stages. [2]

In this article
  1. Three ideas to keep in view
  2. 1. Recognize what makes a function composite
  3. 2. Why the derivative is a product
  4. 3. An original worked example, one layer at a time
  5. 4. Extend the method to deeper nesting
  6. 5. Avoid the errors that change the answer

Three ideas to keep in view

  1. Recognize the layers: in f(g(x)), g acts first and its output becomes the input to f. [1]
  2. Preserve the inner expression: the first factor is f′(g(x)), not f′(g′(x)). [2]
  3. Account for every nested layer: apply the chain rule repeatedly when the inside is itself a composition. [2], [3]

1. Recognize what makes a function composite

A composite function uses one function’s output as another function’s input. Consider R(z) = √(5z − 8). Computing its value requires two operations: first form 5z − 8, then take the square root. Naming these functions makes the structure explicit: g(z) = 5z − 8 and f(u) = √u. Then R(z) = f(g(z)). The inner function supplies the input; the outer function performs the final operation. [1]

This structure matters because differentiating only the final operation does not generally give the full derivative. Applying the square-root power rule while ignoring the changing input produces 1/(2√(5z − 8)). The correct derivative is 5/(2√(5z − 8)). The missing factor, 5, comes from differentiating 5z − 8. This is the specific problem the chain rule solves: a familiar derivative must be adjusted to account for how its input changes. [1]

2. Why the derivative is a product

Write the dependency as x → u = g(x) → y = f(u). A change in x changes u, and the resulting change in u changes y. The derivative du/dx describes the first stage; dy/du describes the second. The chain rule combines these rates: dy/dx = (dy/du)(du/dx). For example, in sin(x³), x first changes the cube, and that changing cube becomes the input to sine. Accounting for only the sine stage would leave out part of this dependency. [2]

In function notation, the same relationship is (f ∘ g)′(x) = f′(g(x)) · g′(x). Notice where each derivative is evaluated: the inner derivative is evaluated at x, while the outer derivative is evaluated at g(x). These locations are essential, not decorative notation. The theorem applies when g is differentiable at x and f is differentiable at g(x). Thus, it concerns the behavior of each function at the particular input involved—not merely whether its formula looks familiar. [2], [3]

3. An original worked example, one layer at a time

Consider the practice function y = (2x² + 3)⁴. The final operation is raising an expression to the fourth power, so choose f(u) = u⁴. Its input is u = g(x) = 2x² + 3. Differentiate the outer function with respect to its own input: f′(u) = 4u³. Now restore the original input to obtain f′(g(x)) = 4(2x² + 3)³. This completes the outer stage, but it does not yet account for how u changes with x. [2]

The inner derivative is g′(x) = 4x. Multiplying gives y′ = 4(2x² + 3)³ · 4x = 16x(2x² + 3)³. As a concrete evaluation, at x = 1 the inner input is 5, the outer derivative is 4 · 5³ = 500, and the inner derivative is 4. Therefore y′(1) = 2000. This calculation illustrates why evaluating the outer derivative at the correct input and multiplying by the inner derivative are separate, necessary steps. [2]

The table separates the two contributions in this example. Keeping them distinct is a useful way to check the calculation before simplifying: first preserve the inner expression in the outer derivative, then supply the factor describing its rate of change. [2]

StageCalculationRole
Outer derivative4(2x² + 3)³Differentiate the fourth power at the original inner input. [2]
Inner derivative4xDifferentiate the input 2x² + 3. [2]
Complete derivative16x(2x² + 3)³Multiply the two contributions. [2]

4. Extend the method to deeper nesting

For more than two layers, repeat exactly the same reasoning. Consider y = e^(sin(x²)). Its layers, from outside inward, are the exponential function, sine, and squaring. Introduce intermediate variables: y = eᵘ, u = sin(v), and v = x². Their derivatives are dy/du = eᵘ, du/dv = cos(v), and dv/dx = 2x. The chain rule connects all three stages rather than treating the entire exponent as though it were simply x. [3]

Substitution and multiplication give y′ = e^(sin(x²)) · cos(x²) · 2x. Each factor retains the input belonging to its layer: the exponential retains sin(x²), and cosine retains x². In general, differentiating f(g(h(x))) gives f′(g(h(x))) · g′(h(x)) · h′(x). Thinking outside inward helps organize the calculation, but the important check is that every factor is evaluated at its appropriate inner expression. Three nested functions contribute three derivative factors. [2], [3]

5. Avoid the errors that change the answer

Do not substitute an inner derivative into the outer derivative. The rule says f′(g(x))g′(x), not f′(g′(x))g′(x). In the worked power example, this means keeping 2x² + 3 inside the cubed expression; replacing it with 4x would change the calculation. Likewise, stopping at the outer derivative would omit the factor 4x. The chain rule combines with the ordinary power rule to give d[(g(x))ⁿ]/dx = n(g(x))ⁿ⁻¹g′(x), wherever the derivative is defined. [2]

Keep an inner derivative attached to the term it belongs to. For the expression 4z + e^(−9z), differentiation gives 4 − 9e^(−9z). The factor −9 belongs to the exponential term because −9z is that term’s inner function. It does not multiply the derivative of 4z. This distinction becomes particularly useful when a sum appears inside another function: differentiate that inner sum term by term, preserving the scope of each chain-rule factor. [1]

Frequently asked questions

How can I identify the outer function?

Ask which operation is performed last when evaluating the expression. In √(5z − 8), the last operation is taking a square root, so that is the outer function. The expression 5z − 8 is its input. Naming the input u can make the separation clearer: R = √u. [1]

Does the chain rule replace the power rule?

No. They work together when a power has a function as its base. The power rule gives n(g(x))ⁿ⁻¹, and the chain rule supplies g′(x). Together they produce n(g(x))ⁿ⁻¹g′(x). Keeping both contributions visible helps prevent a missing inner factor. [2]

Why does the inner expression stay unchanged initially?

The first step differentiates the outer function with respect to its own input. That derivative must then be evaluated at the input the outer function actually receives, namely g(x). The change of that input with respect to x is accounted for separately by multiplying by g′(x). [2]

What should I do if the inner function is another composition?

Apply the chain rule again to that inner function. For e^(sin(x²)), differentiating the exponential leaves the task of differentiating sin(x²), which itself requires the chain rule. Listing the layers first helps keep both the factors and their evaluation inputs organized. [3]

Does the formula apply at every input?

The theorem requires the inner function to be differentiable at the chosen x and the outer function to be differentiable at the resulting input g(x). Check those conditions before using the formula at a particular point. A symbolic derivative is not a reason to ignore where the original functions are defined or differentiable. [2]

Conclusion

The chain rule accounts for every stage through which an input affects an output. Identify the outer and inner functions, differentiate the outer function at the unchanged inner expression, and multiply by the inner derivative. For deeper nesting, repeat the process. The most useful final checks are simple: have you included every layer, preserved each layer’s correct input, and kept factors attached to the terms they actually belong to? These checks turn a memorized formula into a reliable method. [2], [1]

Explore next

Sources

Open a source or expand its cited passages.

Relevance scores are model estimates of how well each source addresses this question, not probabilities or fact-check ratings. Reasoned guidance is identified on hover.

  1. 1003.6 The Chain Rule - Calculus Volume 1 | OpenStaxopenstax.orgProvides the precise theorem, differentiability conditions, application procedure, and combined power rule.›
  2. 96Calculus I - Chain Ruletutorial.math.lamar.eduDirect instructional examples explain the missing inner factor and the scope of factors within sums.›
  3. 92Chain rule - Wikipediaen.wikipedia.orgSupports repeated composition, explicit evaluation points, and a complete three-layer example.›

AI-assisted research. Research methodology · Guides · Explore answers

Ask a follow-up