How fast is it changing right now? Secant lines that become tangents, a car’s speedometer and odometer, and curves that turn straight when you zoom in
Average speed is easy: distance over time. But a speedometer claims to know how fast you are going at a single instant, when no time passes and no distance is covered. Making sense of that zero-over-zero is where calculus begins.
Drag Q towards P, or press animate, and watch the slope of the secant line settle down. The table shows the difference quotients gaining a correct digit each time h shrinks tenfold.
f′(x) = 2x
| h | [f(a + h) − f(a)]/h | [f(a − h) − f(a)]/(−h) |
|---|---|---|
| 1 | 3.000000000 | 1.000000000 |
| 0.1 | 2.100000000 | 1.900000000 |
| 0.01 | 2.010000000 | 1.990000000 |
| 0.001 | 2.001000000 | 1.999000000 |
| 10⁻⁴ | 2.000100000 | 1.999900000 |
| 10⁻⁵ | 2.000010000 | 1.999990000 |
| 10⁻⁶ | 2.000001000 | 1.999999000 |
Drag P along the curve and Q towards it, or type your own function. Bold digits already agree with f′(a), which comes from differentiating the formula symbolically. Each tenfold cut in h buys about one more correct digit; push h much below 10⁻⁸ and rounding error in f(a + h) − f(a) starts to eat the digits again.
The secant through P = (a, f(a)) and Q = (a + h, f(a + h)) has slope Δy/Δx = [f(a + h) − f(a)]/h, the difference quotient. The derivative is what this approaches as Q slides into P:
f′(a) = lim_(h → 0) [f(a + h) − f(a)]/h.
You cannot just put h = 0, which gives 0/0. For f(x) = x², though, the algebra cancels the danger: [(a + h)² − a²]/h = (2ah + h²)/h = 2a + h, which tends to 2a. That is why the table’s quotients for x² at a = 1 read 3, 2.1, 2.01, 2.001: the error is exactly h. For any smooth function the error is roughly ½f″(a)·h, so each tenfold cut in h buys about one decimal digit.
The limit has to be the same from both sides. For |x| at 0 the right-hand quotients are all 1 and the left-hand ones all −1, so there is no single limit and no derivative: the graph has a corner. For √x at 0 the quotients 1/√h grow without bound and the tangent is vertical.
Fermat found tangents to curves like y = xⁿ in the 1630s by essentially this calculation, letting a small increment vanish at the end. Newton and Leibniz turned the trick into a general method in the 1660s and 1670s, but a satisfactory definition of the limit itself waited for Cauchy and Weierstrass in the nineteenth century.
Pick a journey and press play. The violet secant gives the average velocity over the window; the pink tangent and the speedometer give the velocity at one instant. Squeeze the window to make them meet.
Drag on the graph to move the playhead, or grab a dashed window edge. The dots on the road mark the car’s position every quarter second, so they spread out when it is fast and bunch up when it is slow. The pink needle is s′(t); the violet one is the window’s average.
If s(t) is the car’s position at time t, its average velocity between t₀ and t₁ is the displacement divided by the elapsed time, [s(t₁) − s(t₀)]/(t₁ − t₀): the slope of the secant on the graph. Its instantaneous velocity is the limit of that average as the window shrinks onto a single moment, v(t) = s′(t): the slope of the tangent.
Velocity has a sign. On the way home in the there-and-back journey s(t) decreases, s′(t) is negative, and the speedometer needle swings left. Speed is |s′(t)|, and the distance travelled is the total of the speeds, ∫₀ᵗ |s′(u)| du, which keeps growing even while the displacement s(t) − s(0) falls back to zero. That integral returns, and the connection between it and the slope is the Fundamental Theorem of Calculus.
For the accelerate-then-brake journey the formulas are s(t) = 24[t/2 − (10/4π) sin(2πt/10)] and v(t) = 24 sin²(πt/10): the speedometer needle rises and falls smoothly, and the steepest part of the graph is exactly where the needle peaks.
Zoom in on the point P, up to a million times. Smooth curves straighten into their tangent lines. Try the presets that refuse.
The microscope uses the same scale on both axes, so a 45° line really has slope 1. Its two slopes are measured across the left and right halves of the window. For a smooth curve the bend shrinks in proportion to the window: ten times more magnification, ten times straighter. At the origin x sin(1/x) and x² sin(1/x) are given the value 0 that continuity demands; their wiggles near 0 are finer than any screen, so what you see there is a sampled impression.
A function is differentiable at a exactly when, close to a, it is a straight line plus an error that is small even compared with the distance from a:
f(a + h) = f(a) + f′(a)·h + E(h), where E(h)/h → 0 as h → 0.
In the microscope the window has width w and the same height scale, so an error E is seen at size E/w. Because E(h)/h → 0, what remains on screen tends to the tangent line itself. For a smooth function E(h) is roughly ½f″(a)h², so the bend you see shrinks in proportion to w.
The corner of |x| is self-similar: zooming changes nothing, and the two halves keep slopes −1 and 1. The function x sin(1/x) is squeezed between ±x, so it is continuous at 0, but its difference quotient there is sin(1/h), which keeps swinging between −1 and 1. Multiply by one more x and the quotient becomes h sin(1/h), which does tend to 0: x² sin(1/x) is differentiable at 0 with derivative 0, even though its derivative is not continuous there. In 1872 Weierstrass presented a function that is continuous everywhere and has a corner-like failure at every point, so that no amount of zooming ever straightens it.
Spot a mistake or have an idea?