Rates of Change

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

Rates of Change

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.

From Secant to Tangent

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.

1
a (drag P)
1
h (drag Q)
3
secant slope Δy/Δx
2
f′(a), the tangent slope

f′(x) = 2x

The secant slope 3 misses f′(1) = 2 by 1. Halve h and the miss roughly halves: for a smooth curve the error of the one-sided quotient is proportional to h.
h[f(a + h) − f(a)]/h[f(a − h) − f(a)]/(−h)
13.0000000001.000000000
0.12.1000000001.900000000
0.012.0100000001.990000000
0.0012.0010000001.999000000
10⁻⁴2.0001000001.999900000
10⁻⁵2.0000100001.999990000
10⁻⁶2.0000010001.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.

Go deeper:The Derivative as a Limit

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.

Speedometer and Odometer

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.

3.00 s
time t
17.8 m
position s(t)
17.8 m
distance travelled
19.35
average velocity on [t₀, t₁] (m/s)
15.71
instantaneous velocity s′(t) (m/s)
Over the 4.00 s window the car averages 19.35 m/s: the slope of the violet secant. The speedometer reads the slope of the pink tangent at a single instant. Squeeze the window around the playhead and the two numbers meet. The graph is steepest in the middle, where the car is fastest, and flat at both ends, where it is at rest.

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.

Go deeper:Average and Instantaneous Velocity

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.

The Microscope

Zoom in on the point P, up to a million times. Smooth curves straighten into their tangent lines. Try the presets that refuse.

0.84147
slope across the left half
0.067826
slope across the right half
19.34%
bend: distance from straight, % of window
0.5403
f′(a)
Across the window the curve rises with slope 0.8415 on the left and 0.06783 on the right. They will meet if you zoom further.

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.

Go deeper:Local Linearity

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.

Key Takeaways

  • The slope of a secant is a difference quotient; the derivative is its limit as h → 0.
  • Average velocity is a secant slope on the position graph; instantaneous velocity is the tangent slope.
  • The limit must agree from both sides: |x| has a corner at 0, and no derivative there.
  • Differentiable means locally linear: zoom in far enough and the curve becomes its tangent line.

Spot a mistake or have an idea?

Search