Why Composition Requires Its Own Rule
The Product Rule and Quotient Rule describe how derivatives behave when functions are combined by multiplication or division. A composition combines functions differently: the output of one function becomes the input of another. For example, in \(f(g(x))\), a change in \(x\) first changes \(g(x)\), and that change then affects the value of \(f\). The Chain Rule accounts for both stages.
The derivative of the outer function must be evaluated at the value supplied by the inner function. This is the central point to keep track of: the derivative of \(f\) is evaluated at \(g(a)\), not generally at \(a\). The derivative of \(g\), in turn, is evaluated at \(a\).
The theorem is pointwise: \(f\) and \(g\) need not be differentiable everywhere on their intervals. The hypotheses concern \(g\) at \(a\) and \(f\) at the one value \(g(a)\). The next tutorial proves the Chain Rule from the definition of the derivative.
How to Apply the Rule
Before differentiating, identify the functions and the input at which each derivative is evaluated. If the expression is \(f(g(x))\), then the outer function is \(f\) and the inner function is \(g\). The formula is
This is not merely a prescription to multiply two derivatives with the same input. The values at which they are evaluated usually differ. A reliable calculation first finds \(g(a)\), then evaluates \(f'\) there, and finally multiplies by \(g'(a)\).
Write the expression as \(f(g(x))\), naming the inner function \(g\) and the outer function \(f\).
Find \(f'\), but keep its input as a variable until you evaluate it at \(g(x)\).
Multiply \(f'(g(x))\) by \(g'(x)\). Check that the outer derivative is evaluated at the inner function’s value.
Worked Example: A Polynomial Applied to a Quadratic
Let \(H(x)=(x^2+1)^4-3(x^2+1)\), and find \(H'(1)\). Set \(g(x)=x^2+1\) and \(f(u)=u^4-3u\), so \(H=f\circ g\). The Power Rule gives \(f'(u)=4u^3-3\), and \(g'(x)=2x\). At \(x=1\), the inner value is
Therefore \(f'(g(1))=f'(2)=4(2^3)-3=32-3=29\), while \(g'(1)=2(1)=2\). The Chain Rule yields
In particular, the outer derivative was evaluated at \(2\), the value of the inner function at \(1\); evaluating \(f'\) at \(1\) would not follow the rule.
Worked Example: A Reciprocal of an Affine Function
Consider \(R(x)=1/(3x-2)\) at \(a=1\). Take \(g(x)=3x-2\) and \(f(u)=1/u\), defined for \(u\ne0\). The Reciprocal Rule gives \(f'(u)=-1/u^2\). Since \(g(1)=3(1)-2=1\ne0\), the outer function is defined and differentiable at the inner value. Also, \(g'(x)=3\). Hence
More generally, the same calculation gives \(R'(x)=-3/(3x-2)^2\) wherever \(3x-2\ne0\). The domain restriction matters: the reciprocal outer function is not defined at zero, so the composition and the Chain Rule calculation apply only where the inner value is nonzero.
Consequences of the Chain Rule
Once the Chain Rule is available, familiar differentiation rules can be applied to a function of another function. The following results make two useful patterns explicit. In each proof, the Chain Rule supplies the composition derivative, while the relevant earlier rule supplies the derivative of the outer function.
Proof. If \(n=0\), then \(u(x)^0=1\) for every \(x\in I\), so the function is constant and has derivative \(0\). Now suppose \(n\geq1\). Define \(p_n:\mathbb{R}\to\mathbb{R}\) by \(p_n(y)=y^n\). The Power Rule says \(p_n'(y)=ny^{n-1}\) for every \(y\in\mathbb{R}\). Since \(u\) is differentiable at \(a\), and \(p_n\) is differentiable at \(u(a)\), the Chain Rule applies to \(p_n\circ u\). Thus
Because \((p_n\circ u)(x)=u(x)^n\), this is the stated derivative. \(\square\)
Worked Example: A Fifth Power with a Zero Inner Derivative
Let \(P(x)=(x^3-2x)^5\), and find \(P'(0)\). Take \(u(x)=x^3-2x\) and use the power-of-a-function formula with \(n=5\). Then \(u(0)=0^3-2(0)=0\), and the Power Rule gives \(u'(x)=3x^2-2\), so \(u'(0)=3(0)^2-2=-2\). Consequently,
The inner function has a nonzero derivative at \(0\), but the outer function \(y^5\) has derivative \(5y^4=0\) at the inner value \(y=0\). The product in the Chain Rule is therefore zero. This example also illustrates why a zero derivative of a composition need not mean that the inner function has zero derivative.
Proof. The affine function \(g(x)=mx+c\) is differentiable at \(a\), with \(g'(a)=m\). The assumptions ensure that \(g(a)=ma+c\) lies in \(J\) and that \(f\) is differentiable there. Apply the Chain Rule to \(f\circ g\):
Since \((f\circ g)(x)=f(mx+c)\), this proves the formula. It also covers \(m=0\): in that case \(f(mx+c)=f(c)\) is constant, and the displayed derivative is \(0\cdot f'(c)=0\). \(\square\)
What the Formula Tells Us—and What It Does Not
The factors in the Chain Rule correspond to two successive changes. Near \(a\), the inner function changes at rate \(g'(a)\). The outer function, near the input \(g(a)\), changes at rate \(f'(g(a))\). Multiplying these rates gives the rate of the composite function at \(a\). This interpretation helps explain both the order of the factors and the evaluation point for the outer derivative.
A common error is to write \(f'(a)g'(a)\). The correct formula is \(f'(g(a))g'(a)\). These expressions agree only in special circumstances, such as when \(g(a)=a\) or when \(f'\) happens to have the same value at both inputs. Another error is to omit the factor \(g'(a)\). For example, the derivative of \((x^2+1)^4\) is not just \(4(x^2+1)^3\): the inner function \(x^2+1\) has derivative \(2x\), so the full derivative is \(4(x^2+1)^3(2x)\).
The Chain Rule does not say that every composition is differentiable just because the outer function is. Differentiability of the inner function at \(a\) and differentiability of the outer function at \(g(a)\) are both part of the theorem’s hypotheses. Nor can the formula be applied when \(f\) is not defined at \(g(a)\). In the reciprocal example, this is why the input \(3x-2\) must be nonzero.
Finally, the product in the formula can be zero for either of two distinct reasons: \(f'(g(a))\) may be zero, or \(g'(a)\) may be zero. The fifth-power example had the first feature. If \(g'(a)=0\), the formula also gives \((f\circ g)'(a)=0\), provided the hypotheses of the Chain Rule hold. A zero derivative of the composite alone does not tell us which factor vanished.
Check Your Understanding
Use the Chain Rule and its consequences to answer the following.
- For \(f(g(x))\), at which input is \(f'\) evaluated when calculating the derivative at \(a\)?
- Let \(u(x)=2x^2+1\). Use the power-of-a-function formula to find the derivative of \(u(x)^3\) at \(x=1\).
- Suppose \(f'(g(a))=-4\) and \(g'(a)=0\). What does the Chain Rule give for \((f\circ g)'(a)\)?
- For \(Q(x)=1/(x^2+3)\), identify an outer and inner function and state the condition that ensures the reciprocal outer function is defined at the inner value.
- If \(g(x)=5x-1\), write the derivative of \(f(5x-1)\) at \(x=a\) in terms of \(f'\).