Tutorials › Calculus I › The Chain Rule Through Local Linearization

Product, Quotient, and Chain Rules · Tutorial 487 of 1495

The Chain Rule Through Local Linearization

Learn how local linear approximations lead to the chain rule, and use the rule to differentiate nested polynomial and rational functions.

Intermediate 10 min read

What You'll Learn

  • Express differentiability as a local linear approximation with a small error term.
  • Derive the chain rule from the local behavior of the inner and outer functions.
  • Identify the conditions required to differentiate a composition.
  • Apply the chain rule to a nested polynomial and verify the result.
  • Differentiate a composite rational function and check it using the quotient rule.
  • Recognize why omitting the inner derivative gives an incorrect rate of change.

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.

Central idea: Near \(x\), the change in \(g(x)\) is approximately \(g'(x)\) times the change in \(x\). Near \(g(x)\), the resulting change in \(f(g(x))\) is approximately \(f'(g(x))\) times the change in \(g(x)\). Combining these approximations gives the chain rule.

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:

$$ g'(x)=\lim_{h\to 0}\frac{g(x+h)-g(x)}{h}. $$

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\):

$$ g(x+h)-g(x)=g'(x)h+r(h), \qquad \lim_{h\to 0}\frac{r(h)}{h}=0. $$

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,

$$ f(a+k)-f(a)=f'(a)k+s(k), \qquad \lim_{k\to 0}\frac{s(k)}{k}=0. $$

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

Theorem: Chain Rule. Suppose \(g\) is differentiable at \(x\), and \(f\) is differentiable at \(g(x)\). Then the composition \(f\circ g\), defined by \((f\circ g)(x)=f(g(x))\), is differentiable at \(x\), and $$ (f\circ g)'(x)=f'(g(x))g'(x). $$ Equivalently, \(\frac{d}{dx}f(g(x))=f'(g(x))g'(x)\).

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

$$ k=g(x+h)-g(x)=g'(x)h+r(h), \qquad \frac{r(h)}{h}\to 0. $$

In particular, \(k\to 0\) as \(h\to 0\). Since \(f\) is differentiable at \(a\), its local approximation gives

$$ f(a+k)-f(a)=f'(a)k+s(k), \qquad \frac{s(k)}{k}\to 0 \quad\text{as } k\to 0. $$

Substitute \(k=g(x+h)-g(x)\). The change in the composite is therefore

$$ \begin{aligned} f(g(x+h))-f(g(x)) &=f'(a)\bigl(g(x+h)-g(x)\bigr)+s(k)\\ &=f'(a)\bigl(g'(x)h+r(h)\bigr)+s(k)\\ &=f'(a)g'(x)h+f'(a)r(h)+s(k). \end{aligned} $$

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

$$ \frac{s(k)}{h}=\frac{s(k)}{k}\frac{k}{h}\longrightarrow 0. $$

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

$$ \lim_{h\to0} \frac{f(g(x+h))-f(g(x))}{h} =f'(a)g'(x) =f'(g(x))g'(x). $$

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

$$ \begin{aligned} y'&=f'(g(x))g'(x)\\ &=3(2x^2-1)^2(4x)\\ &=12x(2x^2-1)^2. \end{aligned} $$

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

$$ y'(1)=3(1)^2(4)=12. $$

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\),

$$ f'(u)=\frac{(u-1)(1)-(u+1)(1)}{(u-1)^2} =\frac{u-1-u-1}{(u-1)^2} =\frac{-2}{(u-1)^2}. $$

The composition is defined near \(x=1\), since \(g(1)=3\ne1\). Applying the chain rule gives

$$ \begin{aligned} y' &=f'(g(x))g'(x)\\ &=\frac{-2}{(x^2+2-1)^2}(2x)\\ &=\frac{-4x}{(x^2+1)^2}. \end{aligned} $$

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

$$ \begin{aligned} y' &=\frac{(x^2+1)(2x)-(x^2+3)(2x)}{(x^2+1)^2}\\ &=\frac{2x\bigl((x^2+1)-(x^2+3)\bigr)}{(x^2+1)^2}\\ &=\frac{-4x}{(x^2+1)^2}. \end{aligned} $$

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

$$ \begin{aligned} y(2)&=(2^2+1)^2=25,\\ y(2.01)&=((2.01)^2+1)^2=(5.0401)^2=25.40260801,\\ y(2.01)-y(2)&=25.40260801-25=0.40260801. \end{aligned} $$

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

$$ \frac{d}{dx}(2x^2-1)^3 \mathrel{\color{red}{\not=}}3(2x^2-1)^2 $$

omits the fact that the inner quantity \(2x^2-1\) changes at rate \(4x\). The correction is to multiply by that inner rate:

$$ \frac{d}{dx}(2x^2-1)^3 =3(2x^2-1)^2(4x). $$

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.

  1. Differentiate \(y=(3x^2+2)^4\). What factor accounts for the rate of change of the inner function?
  2. If \(g'(2)=5\) and \(f'(g(2))=-3\), what is \((f\circ g)'(2)\)?
  3. State the differentiability conditions needed for the chain rule at \(x\).
  4. 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)\).
  5. In the local-linearization proof, why does \(g(x+h)-g(x)\) tend to zero as \(h\) tends to zero?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon