AP Calculus AB and BC

When the Chain Rule Does Not Apply

The chain rule needs the inner function differentiable at the point and the outer function differentiable at the inner function's value there. Miss either and the product formula has a missing factor. It is a sufficient condition, not a necessary one, so a composite can be differentiable anyway.

Chain Rule

(fg)(x)=f ⁣(g(x))g(x)(f \circ g)'(x) = f'\!\left(g(x)\right) \cdot g'(x)

If g is differentiable at x and f is differentiable at the value g takes there, then the composite is differentiable at x, and its derivative is the outer derivative evaluated inside times the inner derivative.

The hypotheses, and what each one buys

A theorem is only as strong as its conditions. Below, each hypothesis is dropped on its own while every other one is kept, so you can see precisely what it was holding up.

  1. 1

    The outer function f is differentiable at g(x)

    f ⁣(g(x)) existsf'\!\left(g(x)\right) \text{ exists}

    The formula's first factor is the outer derivative evaluated at the inner value, so if that derivative does not exist the product is not a number. The trap is that the inner point looks fine while the trouble is one step up.

    Drop it and the theorem fails

    (fg)(x)=x(f \circ g)(x) = |x|

    f(u) = |u| composed with g(x) = x, giving |x|

    The inner function g(x)=xg(x) = x is as differentiable as a function gets, with g(x)=1g'(x) = 1 everywhere. The outer function f(u)=uf(u) = |u| fails only at u=0u = 0, which is exactly where gg sends x=0x = 0. The composite is x|x|, and the check confirms it has no point of zero derivative between 1-1 and 1 even though the endpoint values agree. The chain rule has nothing to return here.

  2. 2

    The inner function g is differentiable at x

    g(x) existsg'(x) \text{ exists}

    The second factor is the inner derivative, so the same argument applies one level down. What makes this pair of hypotheses interesting is that they are sufficient and not necessary: f(u)=u2f(u) = u^2 composed with g(x)=xg(x) = |x| gives x2x^2, which is differentiable everywhere despite the inner function's corner at 0. The chain rule declines to apply while the composite is perfectly smooth, so no counterexample to differentiability is claimed here.

    No counterexample built from an elementary formula breaks this one on its own, so none is claimed here.

The counterexample above is checked numerically on every build: each function is evaluated and the conclusion is confirmed to fail. A counterexample that stopped working would fail the build rather than sit here misleading you.

Why it is true

  1. Write the difference quotient for the composite and insert the change in the inner function: f(g(x+h))f(g(x))g(x+h)g(x)g(x+h)g(x)h\frac{f(g(x+h)) - f(g(x))}{g(x+h) - g(x)} \cdot \frac{g(x+h) - g(x)}{h}.
  2. As h0h \to 0, differentiability of gg makes the second factor tend to g(x)g'(x), and makes g(x+h)g(x)g(x+h) \to g(x).
  3. Differentiability of ff at g(x)g(x) then makes the first factor tend to f(g(x))f'(g(x)).
  4. The product of the limits is the chain rule. The written form has a flaw, since the inner change can be zero, and a careful proof patches it with an auxiliary function; the role of each hypothesis is unchanged.

What it does not say

Evaluate the outer derivative at x.

It goes at g(x)g(x), the inner function's value. Differentiating sin(x2)\sin(x^2) gives cos(x2)2x\cos(x^2)\cdot 2x, never cos(x)2x\cos(x)\cdot 2x. This is the most common chain rule error by a wide margin.

If the chain rule does not apply, the composite is not differentiable.

Not so. The hypotheses are sufficient, not necessary. (x)2=x2\left(|x|\right)^2 = x^2 is smooth everywhere even though the inner function has a corner.

One application is always enough.

Nested compositions need one factor per layer. Differentiating sin ⁣(ex2)\sin\!\left(e^{x^2}\right) produces three factors, and dropping the innermost is the usual way a long chain goes wrong.

Frequently asked questions

How do I know which function is the outer one?

Ask what you would do last if you were evaluating at a number. For sin(x2)\sin(x^2) you would square first and take the sine last, so sine is outer.

Does the chain rule work for implicit differentiation?

It is what makes implicit differentiation work. Differentiating y2y^2 with respect to xx gives 2ydydx2y \cdot \frac{dy}{dx}, where the extra factor is exactly the chain rule applied to the unknown inner function.