where and .
Reading a Composite From the Outside In
A composite function is a machine with two stations: the input first passes through the inner function , then the outer function treats that result as its input. The chain rule says the overall sensitivity is the product of the sensitivities of each station โ how fast the second stage responds to the first, multiplied by how fast the first stage responds to the original input.
Put numbers on it. For at , the inner stage gives , and the outer stage gives . The inner stage's rate is ; the outer stage's rate is . Multiplying, . Now differentiate the closed form at : you get , the same . The two routes agree because they are the same computation written differently.
A practical reading order:
- Circle the outermost operation โ sine, exponential, square root, logarithm, a power.
- Name what sits immediately inside it, and call that .
- Differentiate the outer layer as if were the variable, then multiply by .
- Repeat until you reach ; three layers produce three factors.
With three layers, differentiates into . Dropping the middle factor is the classic three-layer mistake: the exponential does not see the argument directly, it only sees the value handed to it by sine.
The rule also marks the boundary between chain and product. If one expression is written as a product of two independent factors, such as , the chain rule alone cannot apply โ each factor has its own derivative. If instead one factor is itself built by composition, such as , the chain rule handles that factor while the product rule handles the product.
Example: Apply Chain Rule
Differentiate .
At this evaluates to , and a central difference with step on the original function returns the same value to six decimal places โ the numerical check used in the Python section below.
Example: Chain Rule with Nested Functions
Differentiate .
Notice that at the derivative equals , even though the outer exponential is large elsewhere. The chain rule keeps every layer's local rate in the product, so a flat middle layer ( is not flat โ it is 1) or a vanishing layer () controls the whole answer. When one factor is zero the composition is momentarily insensitive to , whatever the other layers do.
Important Chain Rule Formulas
The repeated factor is the whole story of that table: the inner function contributes its slope , and the outer function contributes the familiar derivative evaluated at . The same pattern covers non-linear inners.
| Composite | Outer layer | Inner derivative | Result |
|---|---|---|---|
Reading down the last column, the factor appears in every entry exactly once. If your answer contains or no at all, you have either applied the power rule twice or forgotten the inner derivative.
Example: Derivative of log Function
Differentiate .
If the base really is 10, the chain rule picks up an extra constant: , because . The extra divides the answer, which is a factor of more than two โ large enough to be marked wrong if missed.
Mixing the Chain Rule With the Product Rule
Real expressions rarely use a single rule. For the product rule governs the overall shape while the chain rule differentiates the exponential factor:
A quotient behaves the same way. For the quotient rule supplies the frame, and the numerator's derivative comes from the chain rule. Factorising at the end matters as much as differentiating: shows immediately that the derivative vanishes at and at , two stationary points that the unfactored sum hides.
A safe assembly order for exam work:
- Label the overall structure โ product, quotient, or plain composition.
- Differentiate each piece in isolation, marking composite pieces with a bracket.
- Substitute into the frame, then factorise.
- Test one numeric point against a rough sketch or a numerical difference.
Checking the Chain Rule Numerically
A central difference approximates the derivative from the function alone, so it is an independent witness: it never uses the differentiation rules it is testing.
import math
def f(x):
return math.sin(x * x)
def central_difference(x, h=1e-6):
return (f(x + h) - f(x - h)) / (2 * h)
for x in (1.0, 2.0, 3.0):
numeric = central_difference(x)
exact = 2 * x * math.cos(x * x)
print(x, round(numeric, 6), round(exact, 6))
For a three-layer composition the same idea works if you keep each layer's rate in its own variable โ exactly the bookkeeping the chain rule prescribes.
import math
def layered(x):
v = 3 * x
u = math.sin(v)
y = math.exp(u)
dydu = math.exp(u)
dudv = math.cos(v)
dvdx = 3.0
return y, dydu * dudv * dvdx
value, rate = layered(0.4)
print(round(value, 6), round(rate, 6))
Computer algebra systems reach the same expression by pattern matching rather than by hand; they are useful for checking the shape of an answer, but reading the factors off yourself is what tells you why a stationary point occurs where it does.
Common Mistakes
Differentiating the outer function and stopping
Fix: Multiply by the derivative of the inner function; for sin(x^2) the answer is 2x cos(x^2), not cos(x^2).
Applying the chain rule to a product of independent factors
Fix: Use the product rule for x^2 e^{3x} โ the chain rule only differentiates composite pieces such as e^{3x}.
Dropping a layer in a three-deep composition
Fix: Write all three factors e^{sin(3x)} ยท cos(3x) ยท 3 before cancelling; a missing middle factor changes the answer everywhere.
Key Takeaways
- The chain rule multiplies the rate of each layer: outer rate evaluated at the inner value, times the inner rate.
- Work outside in โ name the outermost operation first, substitute u, and repeat until you reach x.
- A linear inner function ax + b always contributes exactly one factor of a to the answer.
- When rules combine, differentiate each factor separately, assemble, then factorise and test one numeric point.