Average speed is easy — distance over time, two points, done. The derivative is the harder, sharper question: the exact rate at a single frozen instant, the slope of the curve at one lone point.
Zoom in on a smooth curve. Zoom in far enough and the bend flattens out — under enough magnification, any smooth curve looks like a straight line. The derivative is the slope of that line. It's the curve's local direction, the rate of change at one exact point, the speed at one instant of the clock.
That's the whole idea, and everything else in this chapter is machinery for pinning it down. You've met the pieces already:
x, get back a height.The plot: to get the slope at a single point you seem to need two points — but you only have one. The fix is to take a nearby second point, measure the slope between them, then slide the second point in until the gap vanishes. What that sliding slope settles on is the derivative. Let's earn it.
Your car's trip computer shows two numbers. Average speed is the honest bookkeeper: total distance ÷ total time — one number smeared across the whole drive. Current speed, the big needle on the dash, is something stranger. It claims to know how fast you're going right now, in an instant so thin that "distance ÷ time" would read 0 ÷ 0.
That needle is a derivative. If f(t) is your position at time t, then the derivative f′(t) is your speed at the exact instant t — the instantaneous rate of change of position.
Geometrically it's the same story told with pictures. Plot f as a curve. The derivative at a point is the slope of the tangent line there — the unique straight line that grazes the curve at that one spot, matching its direction without crossing through. Steep tangent, fast change. Flat tangent, momentarily standing still. The derivative turns a whole curve into a slope you can read off point by point.
Here's the trick that makes it work. A tangent touches at one point, and one point isn't enough to fix a slope — you need two. So cheat: pick a second point on the curve, a little step h away, and draw the straight line through both. That line is a secant, and its slope is just rise over run — the same formula you've always used:
secant slope = ( f(x₀ + h) − f(x₀) ) / h
The secant is an approximation of the tangent — a decent one when h is small, a lousy one when it's big. Now the payoff move: slide the second point toward the first. Shrink h. As the two points close in, the secant pivots and snaps onto the tangent, and its slope homes in on the true derivative. Drag the point below and watch the error collapse.
As h shrinks the secant slope marches toward f′(x₀) = cos(x₀) and the error dwindles to nothing — but notice you can never set h to exactly 0, because that's 0/0, undefined. The tangent slope is the value the secant slopes approach, never the value at the endpoint. That "approach a value you never plug in" is precisely a limit — which is why the definition can't be written without one.
Everything above collapses into a single line. The derivative of f at x is the limit of the secant slopes as the step h goes to zero:
f′(x) = limh→0 ( f(x + h) − f(x) ) / h
Stare at that fraction and you'll see the problem it's tiptoeing around. Set h = 0 outright and you get (f(x) − f(x)) / 0 = 0/0 — meaningless. The derivative is not the fraction's value at h = 0; it's the value the fraction converges to as h gets arbitrarily small without ever arriving. That is the entire job of the limit from Chapter 2: to give rigorous meaning to "the value being approached" at a point where the formula itself is undefined.
So the derivative isn't just helped by limits — it is defined as one. No completeness (Chapter 1), no guarantee the limit lands on a real number; no limit machinery (Chapter 2), no way to say what h→0 even means. Calculus stands on the foundation those chapters poured. When the limit exists, we say f is differentiable at x.
There's a one-way street between two properties from Chapter 3. If a function is differentiable at a point — it has a well-defined slope there — then it must also be continuous there: no jumps, no gaps. That direction is airtight. A curve with a clean tangent line obviously can't be torn apart at that spot.
The reverse fails, and the counterexample is one you can draw with a ruler: the absolute value f(x) = |x|. It's a perfect V — continuous everywhere, you never lift your pen. But at the point of the V, x = 0, it has a corner, and a corner has no single slope. Come in from the left and the slope is −1; come in from the right and it's +1. The secant slopes don't agree from the two sides, so the limit doesn't exist, so there's no derivative — even though the function is unbroken.
|x| at x = 0, the secant slope is (|0+h| − 0)/h = |h|/h, which equals +1 for every h > 0 and −1 for every h < 0. The left and right limits are −1 and +1 — they disagree, so limh→0 doesn't exist. Continuous, yes. Differentiable, no. Smoothness is the strictly stronger promise.You almost never compute a derivative from the limit definition by hand — that's for proving the rules, not using them. Once proved, the rules turn differentiation into pure symbol-pushing, the way a compiler pattern-matches its way through an expression tree. Three carry most of the weight:
With these three (plus sums and constants) you can differentiate essentially anything you'll write in code — and every automatic-differentiation library is just this toolkit, applied relentlessly by a machine.
Here's where the derivative pays rent. Back in Chapter 3 we found roots by bisection: bracket the answer, halve the interval, repeat. Safe and steady — but slow, buying just one bit of accuracy per step. Newton's method trades safety for blistering speed by using the slope.
The idea is pure "zoom in until it's a line." Standing at a guess x, don't creep — instead follow the tangent line straight down to where it hits zero, and jump there. That landing spot is your next, far better guess:
x ↦ x − f(x) / f′(x)
Iterate that map and, near a root, the number of correct digits roughly doubles every step — a handful of iterations nails answers bisection would still be grinding toward. The cost: you need the derivative f′, and a bad starting guess can send it flying off. It's a programmer favorite precisely because it's just a fixed-point iterate: apply one function over and over until the value stops moving.
deriv never computes a true derivative — it evaluates a secant slope with a tiny fixed h = 1e-6. It's the widget above, frozen at one small step: a numerical stand-in that's close enough for Newton to converge, but a reminder that the exact f′ only lives at the limit h → 0, never at any Double you can actually store.One clean theorem ties the instantaneous rate back to the average rate — and it's the one an automated speed camera relies on. Drive between two toll gates 60 km apart in exactly 30 minutes and your average speed was 120 km/h. The Mean Value Theorem promises that at some instant along the way, your speedometer read exactly 120 — your instantaneous speed matched your average speed, at least once.
In slope language: for a function f that's continuous on [a, b] and differentiable inside it, there is some point c between them where
f′(c) = ( f(b) − f(a) ) / ( b − a )
The left side is the tangent slope at c; the right side is the slope of the secant joining the two endpoints. So somewhere in the interval, the tangent runs exactly parallel to that secant. It sounds almost too obvious to need proving — yet it's the quiet engine behind much of what follows: it's how you prove that a zero derivative means a flat, constant function, and it's the bridge that will connect derivatives to integrals in Chapter 5.