Why Separate an Expression into Layers?
A nested expression is built by applying one function to the output of another. For example, in \((3x^2+1)^4\), the expression \(3x^2+1\) is calculated first, and the fourth power is then applied to that result.
This order matters when differentiating. The derivative of the outer operation describes how its output changes as its input changes. To find how the full expression changes as \(x\) changes, we must also account for how the inner expression changes with \(x\). The chain rule combines those two contributions.
Inner and Outer Functions
A function \(f\) is a composition of functions \(F\) and \(g\) if \(f(x)=F(g(x))\). The function \(g\) is called the inner function, because it is applied first to \(x\). The function \(F\) is called the outer function, because it is applied to the result \(g(x)\).
When giving a derivative for the outer function, it is helpful to use a separate input variable such as \(u\). This makes clear that \(F'(u)\) is a derivative with respect to the input of \(F\), not directly with respect to \(x\).
For \((3x^2+1)^4\), one suitable choice is \(g(x)=3x^2+1\) and \(F(u)=u^4\). Then \(F(g(x))=(3x^2+1)^4\). The inner and outer functions are roles in a chosen decomposition; an expression can sometimes be decomposed in more than one valid way. The useful choice is the one that makes the order of operations clear.
The Chain Rule and the Two Contributions
If \(g\) is differentiable at \(x\), and \(F\) is differentiable at \(g(x)\), then the composition \(f(x)=F(g(x))\) is differentiable at \(x\), and its derivative is given by the chain rule:
The factor \(F'(g(x))\) is the outer derivative, evaluated at the value produced by the inner function. The factor \(g'(x)\) is the inner derivative. In general, the outer derivative alone is not the derivative with respect to \(x\); the chain rule requires multiplying it by the inner derivative.
The multiplication reflects how changes pass through the layers. If \(x\) changes by a small amount \(h\), then the inner output changes by approximately \(g'(x)h\). The outer output then changes by approximately \(F'(g(x))\) times that inner change. Combining these approximations gives the product in the chain rule.
This explanation also shows why the differentiability conditions matter: the inner function must have a derivative at \(x\), and the outer function must have a derivative at the inner value \(g(x)\). The formula is not a license to differentiate a layer where the required derivative does not exist.
Worked Example: A Polynomial Raised to a Power
Worked Example: A Polynomial Raised to a Power
Differentiate \(f(x)=(3x^2+1)^4\) by identifying its inner and outer functions.
Step 1: Identify the layers. The inner function is \(g(x)=3x^2+1\). The outer function is \(F(u)=u^4\), so \(f(x)=F(g(x))\).
Step 2: Differentiate each function with respect to its own input.
Step 3: Apply the chain rule. Evaluate the outer derivative at \(u=g(x)=3x^2+1\), then multiply by the inner derivative.
Check: Expanding the original expression gives \((3x^2+1)^4=81x^8+108x^6+54x^4+12x^2+1\). Differentiating this polynomial term by term gives \(648x^7+648x^5+216x^3+24x\). Expanding the chain-rule answer gives \(24x(27x^6+27x^4+9x^2+1)=648x^7+648x^5+216x^3+24x\), as required.
Keep the Input to Each Derivative Clear
A frequent source of confusion is writing the outer derivative as though its input were \(x\). If the outer function is \(F(u)=u^4\), then its derivative is \(F'(u)=4u^3\). In the composite expression, we must use \(u=g(x)\), so the outer contribution becomes \(4(g(x))^3\).
Keeping the variables distinct is not just a notational preference. It helps show which derivative is being taken at each stage. One derivative describes how \(F\) changes with its input \(u\); the other describes how \(g\) changes with \(x\).
| Quantity | What it measures |
|---|---|
| \(F'(u)\) | How the outer output changes as its input \(u\) changes |
| \(F'(g(x))\) | The outer rate evaluated at the value supplied by the inner function |
| \(g'(x)\) | How the inner output changes as \(x\) changes |
| \(F'(g(x))g'(x)\) | How the final output changes as \(x\) changes |
Worked Example: A Square Root of a Quadratic
Worked Example: A Square Root of a Quadratic
Differentiate \(f(x)=\sqrt{x^2-2x+3}\).
Step 1: Identify the functions. Let \(g(x)=x^2-2x+3\) and \(F(u)=\sqrt{u}\). The inner output is always positive, because \(x^2-2x+3=(x-1)^2+2\geq 2\). Thus the square-root function is differentiable at every value \(g(x)\) that occurs.
Step 2: Differentiate the layers.
Step 3: Evaluate the outer derivative at the inner function and multiply.
Check: Let \(y=\sqrt{x^2-2x+3}\). Then \(y^2=x^2-2x+3\), with \(y>0\). Differentiating this identity gives \(2yy'=2x-2\). Therefore \(y'=(2x-2)/(2y)=(x-1)/\sqrt{x^2-2x+3}\), agreeing with the chain-rule result.
Reading the Layers Before Differentiating
To identify the functions, read the expression in the order it is evaluated. First determine what expression is formed from \(x\); then identify the operation applied to that entire expression. Parentheses are often a useful guide, but the key is the structure, not merely the location of a pair of parentheses.
Look for the quantity that is fed into another function as a single input.
Write that quantity as \(g(x)\), including all its dependence on \(x\).
Replace the inner quantity by a temporary input \(u\), and express the final operation as \(F(u)\).
Find \(F'(u)\) and \(g'(x)\), substitute \(u=g(x)\) into \(F'(u)\), and multiply.
In more complicated formulas, there may be several layers. The same principle applies successively: each outer operation acts on the output of the layer immediately inside it. This tutorial focuses on identifying the functions and their contributions; careful layer-by-layer bookkeeping is useful before attempting any longer composition.
Worked Example: A Negative Inner Derivative
Worked Example: A Negative Inner Derivative
Differentiate \(f(x)=(4-x^2)^3\), paying attention to the sign contributed by the inner function.
Step 1: Identify the functions. The inner function is \(g(x)=4-x^2\), and the outer function is \(F(u)=u^3\).
Step 2: Find the layer derivatives.
Step 3: Apply the chain rule.
Check: Expanding gives \((4-x^2)^3=64-48x^2+12x^4-x^6\). Its derivative is \(-96x+48x^3-6x^5\). Expanding the chain-rule answer gives \(-6x(16-8x^2+x^4)=-96x+48x^3-6x^5\), so the results agree.
A Common Mistake: Omitting the Inner Derivative
Suppose we differentiate \((3x^2+1)^4\) and write \(4(3x^2+1)^3\). This calculation differentiates the outer power and substitutes the inner expression, but it omits the rate at which the inner expression changes with \(x\). It is therefore generally not the derivative of the full expression with respect to \(x\).
The inner derivative is \(6x\), so the chain rule requires that factor as well. The corrected calculation is
Sometimes the numerical value of the outer derivative happens to equal the derivative of the full composition at a particular point. That coincidence does not change the rule: in general, the outer derivative alone is not the derivative with respect to \(x\). The inner derivative must be included in the chain-rule product.
Using the Chain Rule Reliably
Before calculating, state the decomposition. This makes it easier to check that the outer derivative is evaluated at the correct input and that the inner derivative has not been lost. Afterward, simplify the product without changing its value.
- Write the composition as \(F(g(x))\).
- Differentiate \(F\) with respect to its input and \(g\) with respect to \(x\).
- Evaluate \(F'\) at \(g(x)\), not at an unrelated variable.
- Multiply by \(g'(x)\), including its sign and coefficient.
- Check the domain and differentiability conditions for both layers.
Identifying the layers is valuable even when the derivative seems easy to guess. It turns a nested formula into an organized calculation and provides a direct way to spot missing factors or incorrect signs.
Check Your Understanding
For each question, identify the inner and outer functions before answering.
- For \(f(x)=(2x^2+5)^3\), what are suitable choices of \(g(x)\) and \(F(u)\)?
- State the chain-rule derivative of \(F(g(x))\), and specify where the outer derivative is evaluated.
- For \(f(x)=(7-x^2)^2\), what are the inner and outer derivative contributions?
- Why is \(F'(g(x))\) alone not generally the derivative of \(F(g(x))\) with respect to \(x\)?
- What differentiability conditions are required to use the chain rule at \(x\)?