Visual walkthrough — Derivatives and rules (product, quotient, chain)
Step 1 — What "slope" even means (a picture, not a formula)
WHAT. A function is a machine: feed it a number , it hands back a number . Draw on the horizontal line, on the vertical line, and mark the dot. As slides, the dot traces a curve.
WHY. Before any rule, we need one honest question: if I push right by a tiny step, how far does the dot rise? That "rise per push" is the entire subject.
PICTURE. In the figure, the small horizontal push is called (the width of our step). The matching vertical jump is (the height gained). Their ratio is the steepness of the little staircase step.
This is only the average over a window of width . To get the slope at the point we shrink the window. See Limits and Continuity for what "shrink to zero" formally means.
Step 2 — Shrinking the step to a single point
WHAT. Slide the right edge of the step toward the left edge: let get smaller and smaller.
WHY. A wide step averages over a stretch of curve. We want the steepness exactly here, at one dot. So we let the run and read off where the ratio settles.
PICTURE. As the step narrows, the little staircase line pivots until it just kisses the curve — that kissing line is the tangent. Its slope is the derivative.
Everything below is just this one idea, applied to a machine made of two machines.
Step 3 — Stacking two machines (composition)
WHAT. Now build a bigger machine by feeding one into another. Call the inner machine and the outer machine . Input goes into , out comes a middle number we name , and goes into , out comes .
WHY. Real formulas are nested: is "square-and-add-one" wrapped inside "raise-to-the-fifth"; the sigmoid is a stack too. We need the slope of the whole stack, not the pieces. This nesting is exactly a neural-network layer feeding the next — see Backpropagation.
PICTURE. Three number lines in a row: the -line, the middle -line, and the -line, with arrows showing .
Step 4 — Push the input, watch the ripple
WHAT. Nudge by a tiny . This forces to move by some small amount we call (Greek "delta u" = "a small change in "). That in turn forces to move by .
WHY. A change can only reach by first passing through . So the effect travels in two hops: , then . If we understand each hop's steepness, we can chain them.
PICTURE. The same three-line diagram, now with a small red bracket on the -line, a blue bracket on the middle line, and a pink bracket on the -line. The push propagates left to right.
Step 5 — Why the rates MULTIPLY (the gear picture)
WHAT. We assemble the total steepness from the two hop-steepnesses.
WHY. Watch a purely algebraic magic trick: the that comes out of hop 1 is the very same that goes into hop 2. So we can wedge it in and cancel it:
- ::: total steepness of the whole stack.
- ::: how strongly the outer machine amplifies a wiggle (hop 2 gear ratio).
- ::: how strongly the inner machine amplifies a wiggle (hop 1 gear ratio).
- the ::: appears once on top, once on bottom — it cancels, which is why the equation is even allowed.
Why multiply and not add? Gears. If a small gear turns a middle gear 3× as fast, and the middle turns a big gear 2× as fast, the big gear spins × as fast — you compound the ratios, you don't add them. Adding would say "", which is plainly wrong: nothing added, everything passed through and got amplified twice.
PICTURE. Three interlocking gears labelled with ratios and , the far gear spinning at .
Step 6 — Take the limit: the Chain Rule
WHAT. Shrink the push . Each hop-ratio settles into a genuine derivative.
WHY. By Step 2, and . The product of two settling numbers settles to the product of the limits.
PICTURE. The gear diagram with each ratio replaced by its derivative label, and a banner equation underneath.
Step 7 — Watch it run: term by term
WHAT. Outer , inner .
WHY. This is the smallest example where forgetting the inner slope changes the answer dramatically — a stress test for the rule.
- ::: outer slope — power rule on ; see Power Rule and Basic Derivatives.
- then ::: put the middle value back so the outer slope is measured where we are.
- ::: inner slope — power rule on .
- product ::: the two gear ratios compounded.
PICTURE. The stack drawn concretely with both slopes labelled on their own hop.
Step 8 — The degenerate cases (so you never get surprised)
WHAT. Cover the boundary situations the smooth formula quietly handles.
WHY. The contract: the reader must never hit a scenario we didn't show. Three matter.
| Case | What happens | Why it's fine |
|---|---|---|
| (inner is momentarily flat) | Whole product | The first gear isn't turning, so nothing downstream moves — . |
| (outer flat at the landed spot) | Whole product | The middle gear turns but the last gear is at a flat plateau — motion arrives but produces no output rise. This is the vanishing-gradient seed in Backpropagation. |
| Constant inner, | , so | If the middle value never changes, the outer machine's output never changes either. |
PICTURE. Two mini-curves: left, a flat inner (gear stuck); right, a flat outer plateau (last gear on a flat).
The one-picture summary
Everything collapses to one image: a chain of gears. Push , the wiggle rides through each machine, and every machine multiplies it by its local slope. Read left to right, multiply as you go.
Recall Feynman retelling — the whole walkthrough in plain words
A derivative is just how steep — push the input a hair, see how much the output climbs. To find the steepness at a single spot, we shrink the push until our little step-line pivots into the tangent that kisses the curve. Now stack two machines. A push on can only reach the answer by first passing through a middle value . So it takes two hops. Hop one has a steepness; hop two has a steepness. Because the same middle wiggle leaves hop one and enters hop two, we can cancel it — and what's left is: total steepness = (second steepness) × (first steepness). Why times and not plus? Gears. A small gear spinning a big gear spinning a huge gear — the huge one's speed is all the ratios multiplied. Add nothing; pass through and amplify twice. Edge cases: if any gear is stuck (a slope is zero), the whole chain's slope is zero — nothing gets through. In a deep neural net you have hundreds of these gears in a row, and many slopes are small; multiply many small numbers and you get almost nothing. That vanishing product is the deep-learning headache the whole chain-rule story predicts.
Connections
- Parent: Derivatives and rules
- Limits and Continuity — the "shrink to zero" that makes slope exact.
- Power Rule and Basic Derivatives — the outer/inner slopes we plugged in.
- Gradient and Partial Derivatives — the multi-input version of this same push-and-watch idea.
- Backpropagation — the chain rule run backwards through many layers.
- Gradient Descent / Activation Functions — why multiplied small slopes make deep training hard.