Why a Composition Has Two Rates of Change
A composite function changes in two stages. First, a change in \(x\) changes the output of an inner function \(g\). Then that change in \(g(x)\) changes the output of an outer function \(f\). The chain rule says that, when both functions are differentiable at the relevant points, the two rates multiply.
This multiplication is not just a useful calculation rule. It follows from a basic feature of differentiability: close to a point, a differentiable function behaves like a linear map. The inner function determines how far the input to the outer function moves; the outer function determines how its output responds to that movement.
Differentiability as Local Linearization
A function \(g\) is differentiable at \(x\) if the difference quotient has a finite limit as the input increment \(h\) approaches zero:
Rearranging the difference quotient gives a useful equivalent description. Differentiability at \(x\) means that the change in the function can be written as its linear part plus an error that is small compared with \(h\):
The term \(g'(x)h\) is the local linear approximation to the change in \(g\). The remainder \(r(h)\) becomes negligible relative to \(h\) as \(h\) tends to zero. This is the precise meaning of saying that a differentiable function is locally linear to first order.
For the outer function \(f\), the same description applies around the point \(a=g(x)\). If \(f\) is differentiable at \(a\), then for an increment \(k\) near zero,
Here \(k\) is a change in the input to \(f\), not necessarily a change in the original variable \(x\). In the composition \(f(g(x))\), the relevant increment is the change in \(g(x)\).
The Chain Rule
The order of the factors has a clear interpretation. The outer derivative \(f'(g(x))\) measures the change in \(f\)'s output per unit change in its input, evaluated at the actual input \(g(x)\). The inner derivative \(g'(x)\) measures the change in that input per unit change in \(x\). Multiplying gives the change in the final output per unit change in \(x\).
Deriving the Rule from Local Linearizations
We now prove the chain rule using the local linear descriptions. Fix \(x\), and write \(a=g(x)\). Since \(g\) is differentiable at \(x\), its increment for an input change \(h\) has the form
In particular, \(k\to 0\) as \(h\to 0\). Since \(f\) is differentiable at \(a\), its local approximation gives
Substitute \(k=g(x+h)-g(x)\). The change in the composite is therefore
It remains to show that the last two terms, divided by \(h\), tend to zero. The first does, because \(r(h)/h\to 0\). For the second, if \(g'(x)\ne 0\), then \(k/h\to g'(x)\), so \(k/h\) stays bounded for sufficiently small nonzero \(h\). Thus
If \(g'(x)=0\), then \(k/h\to 0\). For nonzero \(k\), the same product tends to zero because \(s(k)/k\to 0\) and \(k/h\to 0\). When \(k=0\), \(s(k)=s(0)=0\), so the quotient \(s(k)/h\) is zero for that increment. Hence in all cases the remaining terms divided by \(h\) tend to zero. It follows directly from the definition of derivative that
This proves the rule. The proof also explains the multiplication: the inner change is \(g'(x)h\) to first order, and the outer function multiplies that change by \(f'(g(x))\) to first order.
Applying the Rule to a Nested Polynomial
Worked Example: Differentiate a Nested Polynomial
Differentiate \(y=(2x^2-1)^3\), then evaluate the derivative at \(x=1\).
Choose the inner function \(g(x)=2x^2-1\) and the outer function \(f(u)=u^3\). Their derivatives are \(g'(x)=4x\) and \(f'(u)=3u^2\). The chain rule gives
At \(x=1\), the inner value is \(g(1)=2(1)^2-1=1\), and the inner derivative is \(g'(1)=4(1)=4\). Therefore
Check by expanding the polynomial: \((2x^2-1)^3=8x^6-12x^4+6x^2-1\). Differentiating gives \(48x^5-48x^3+12x\), whose value at \(1\) is \(48-48+12=12\), as required.
Applying the Rule to a Composite Rational Function
Worked Example: Differentiate a Rational Function of a Polynomial
Differentiate \(y=\frac{x^2+3}{x^2+1}\) using a composition, and evaluate at \(x=1\).
Write \(g(x)=x^2+2\) and \(f(u)=\frac{u+1}{u-1}\). Then \(f(g(x))=\frac{x^2+3}{x^2+1}\). The inner derivative is \(g'(x)=2x\). By the quotient rule, for \(u\ne 1\),
The composition is defined near \(x=1\), since \(g(1)=3\ne1\). Applying the chain rule gives
At \(x=1\), \(g(1)=3\), \(f'(3)=-2/(3-1)^2=-1/2\), and \(g'(1)=2\). Thus \(y'(1)=(-1/2)(2)=-1\).
Check directly with the quotient rule. The numerator and denominator have derivatives \(2x\) and \(2x\), so
At \(x=1\), this is \(-4/(1+1)^2=-1\), agreeing with the chain-rule calculation.
Reading the Local Approximation Numerically
Worked Example: Estimate a Composite Change Near a Point
Let \(y=(x^2+1)^2\). Use local linearization at \(x=2\) to estimate the change in \(y\) when \(x\) increases by \(0.01\), and compare with the exact change.
Set \(g(x)=x^2+1\) and \(f(u)=u^2\). At \(x=2\), \(g(2)=5\), \(g'(2)=4\), and \(f'(5)=10\). The chain rule gives \(y'(2)=10\cdot4=40\). The local linear approximation predicts a change of approximately \(40(0.01)=0.4\).
For the exact change, the new input is \(2.01\), so
The estimate \(0.4\) is close to the exact change \(0.40260801\). Their difference is \(0.00260801\), which is smaller than the first-order change and is consistent with the local approximation becoming more accurate as the input increment shrinks.
Common Pitfall: Leaving Out the Inner Derivative
A frequent error is to differentiate the outer function but treat its input as though it were simply \(x\). For example, the incorrect calculation
omits the fact that the inner quantity \(2x^2-1\) changes at rate \(4x\). The correction is to multiply by that inner rate:
For a quick check, at \(x=1\) the incorrect expression gives \(3\), while the correct derivative is \(12\), as also confirmed by expanding and differentiating the polynomial. The missing factor is not optional: it records how quickly the input to the outer function changes as \(x\) changes.
When the Rule Applies
The chain rule requires differentiability at the relevant points: \(g\) must be differentiable at \(x\), and \(f\) must be differentiable at \(g(x)\). It is not enough that the expressions look nested. For rational outer functions, for example, the denominator must be nonzero at the inner value so that the function is defined there.
When a composition has several layers, the same principle applies one layer at a time. Each derivative is evaluated at the input received by that layer, and each layer contributes its own factor. The local-linearization viewpoint gives a reliable way to keep track of those inputs: follow the changes from the original variable outward through the composition.
Check Your Understanding
For each question, identify the inner and outer functions before applying the chain rule.
- Differentiate \(y=(3x^2+2)^4\). What factor accounts for the rate of change of the inner function?
- If \(g'(2)=5\) and \(f'(g(2))=-3\), what is \((f\circ g)'(2)\)?
- State the differentiability conditions needed for the chain rule at \(x\).
- For \(y=\frac{x^2+4}{x^2+2}\), express the function as \(f(g(x))\) with \(g(x)=x^2+2\), and find \(f'(u)\).
- In the local-linearization proof, why does \(g(x+h)-g(x)\) tend to zero as \(h\) tends to zero?