Calculus I · A Toolkit for Slopes
Sums, differences, and constant multiples
In Chapter 3 you found — you differentiated term by term, and you predicted the rule in the Looking-ahead problems. Here it is, and it’s immediate from the definition (the difference quotient of a sum is the sum of the difference quotients):
Sum / Constant-Multiple Rules.
Together with the power rule, these differentiate any polynomial instantly. For example, — bring each exponent down, subtract one, drop the constant. What took a page in Chapter 3 now takes a glance.
The product rule (and why it is not what you’d guess)
Here intuition fails, so we derive carefully. You might guess that the derivative of a product is the product of the derivatives — that . It is not, and the derivation shows why. Start from the definition and use one clever move: add and subtract the same term, , to split the quotient into two recognizable pieces.
Now let . The two difference quotients become and ; and because is continuous (which, by Chapter 3, follows from being differentiable). So:
The Product Rule.
In words: derivative of the first times the second, plus the first times the derivative of the second. The extra term — the one the naive guess misses — is exactly the cross-term that the add-and-subtract trick exposed. Example: . (Check: expanding first gives , whose derivative is . They agree.)
The chain rule: differentiating a function inside a function
This is the one that matters most, because most real functions are compositions — a function applied to the output of another function, like (raise-to-the-fifth applied to ) or or . The chain rule tells you how to differentiate them, and Leibniz’s notation makes it almost think for you. Write where — an outer function and an inner function . Then:
The Chain Rule.
The idea behind it is beautifully simple: rates of change multiply through a chain. If changes times as fast as , and changes times as fast as , then changes times as fast as — the same way gear ratios multiply. (The honest derivation writes and takes limits; a careful proof handles the case separately, which is the Diamond problem.) In practice: differentiate the outer function, leaving the inside alone, then multiply by the derivative of the inside.
- (using the exponential’s derivative, below).
A glimpse of why machine learning runs on this rule
A neural network is a tower of functions — the input passes through layer after layer, each one a function of the layer below: , sometimes hundreds deep. To train it, you need the derivative of the final error with respect to every knob in every layer — and you get it by the chain rule, multiplying the rates of change layer by layer, working from the output back toward the input. That backward sweep has a name — backpropagation — and it is nothing more exotic than the chain rule, applied across an enormous composition, a few billion times per second. The rule you’re learning on is the literal engine of modern AI.