The Difference Quotient

An average-speed camera clocks you by timing how long you take to cross a short painted stretch of road. Shorten that stretch — a hundred metres, then ten, then one — and the figure closes in on your speed at a single instant. The difference quotient is exactly that measurement written as one tidy formula, with a dial for the length of the stretch so we can turn it right down.

The average rate of change needs two input values, a and b — two separate anchors, planted wherever you like. That's fine for answering "how fast, on average, between here and there?" But the last page ended with a different, itchier question: what happens as the two points slide together? To chase that, we want a formula built for shrinking — one where the whole interval is controlled by a single number we can squeeze.

So here is the one small, brilliant change of notation. Keep the first point and call it x. Then, instead of naming the second point independently, describe it by how far past the first it sits: step forward by h, landing at x + h. Using function notation, the average rate of change between those two inputs becomes the difference quotient:

\frac{f(x + h) - f(x)}{(x + h) - x} = \frac{f(x + h) - f(x)}{h}

The run is simply h — the second input minus the first collapses to the step size — and the numerator is the rise: how much the output changed over that step. Nothing new has been computed. This is exactly the same fraction as \tfrac{f(b) - f(a)}{b - a} with b = x + h. But the new costume matters enormously: the width of the stretch is now a single dial, h, and a dial can be turned down. One formula now describes every secant through the point \big(x, f(x)\big) — the wide ones, the narrow ones, and (soon) the vanishingly thin ones. The difference quotient is the derivative's chrysalis: everything the derivative will be is already folded up inside it, waiting for h to shrink.

Getting to know h

Three quick facts about the new dial, worth fixing in place before the algebra starts.

h is a width, not a location. It measures how far the second point sits from the first. h = 2 is a wide stretch; h = 0.01 is a sliver. And h may be negative: h = -1 just means the second point is one unit to the left, and the same fraction still computes the secant's slope, sign and all.

The one forbidden value is h = 0. Set h = 0 and both points coincide; the fraction reads \tfrac{f(x) - f(x)}{0} = \tfrac{0}{0}, which is meaningless. A secant needs two distinct points. The entire drama of the next few pages is about sneaking up on h = 0 without ever standing on it.

It is a machine with two dials. Feed it a base point x and a step h; it returns the slope of the secant from \big(x, f(x)\big) to \big(x+h, f(x+h)\big). Different x, different part of the curve; different h, different width of view.

It is the slope of a secant

Geometrically, the difference quotient is the slope of the secant line joining \big(x, f(x)\big) to \big(x + h, f(x + h)\big). Below, the base point is pinned at x = 1 on f(x) = x^2, and the slider is the h dial. Slide it and watch the second point travel along the curve while the secant tilts to match.

Two experiments worth running. First, park h at 1 and note the secant's steepness — we'll compute below that its slope is exactly 2x + h = 2(1) + 1 = 3. Then drag h slowly down toward the left end. The two points crowd together, the secant stops swinging, and its tilt settles toward one particular steepness — the slope readings 3, 2.5, 2.1, \dots are closing in on 2. The slider physically cannot reach h = 0 (that's the forbidden value), but the secant's destination is already unmistakable. Hold that thought.

Worked example: simplify it for f(x) = x^2

The real power of the difference quotient is that the algebra often simplifies — and the whole point of the exercise is to simplify it completely, until the lone h downstairs is gone. Watch it happen for f(x) = x^2, honestly, with no steps skipped.

Step 1 — build f(x+h). Substitute (x+h) for the input and expand the square in full:

f(x + h) = (x + h)^2 = (x+h)(x+h) = x^2 + 2xh + h^2.

Step 2 — subtract f(x). The x^2 terms annihilate each other — this cancellation is the engine of the whole method, and it happens for every function you'll meet:

f(x+h) - f(x) = (x^2 + 2xh + h^2) - x^2 = 2xh + h^2.

Step 3 — divide by h. Every surviving term in the numerator carries a factor of h, so factor it out and cancel (legal precisely because h \neq 0):

\frac{2xh + h^2}{h} = \frac{h(2x + h)}{h} = 2x + h.

Pause and admire what just happened. The pesky h in the denominator is gone. The slope of any secant on the parabola — any base point, any width — is the clean expression 2x + h. From x = 1 with step h = 1: slope 2(1) + 1 = 3. From x = 3 with step h = 0.5: slope 6.5. Infinitely many secants, one formula. And crucially, the formula no longer objects to small h: where \tfrac{2xh + h^2}{h} degenerates into \tfrac{0}{0} at h = 0, the simplified 2x + h is perfectly happy there. That is why the simplification is the whole game.

See the algebra animated

The numerator and denominator change together as the step h plays out. Press play to build the difference quotient for f(x) = x^2 at x = 1: the step along the axis is the run h, the vertical leg is the rise f(x+h) - f(x), and their ratio is the secant's slope — 2x + h, exactly as the algebra promised.

Worked example: a straight line, f(x) = 3x + 1

Now run the same three steps on a function whose answer you already know. A line has one slope, everywhere — so its average rate of change over any stretch had better come out the same. Does the machinery agree?

Step 1: substitute and expand (the input (x+h) replaces every x):

f(x+h) = 3(x+h) + 1 = 3x + 3h + 1.

Step 2: subtract — and this time almost everything cancels:

f(x+h) - f(x) = (3x + 3h + 1) - (3x + 1) = 3h.

Step 3: divide:

\frac{3h}{h} = 3.

Just 3. No x, no h — the answer doesn't care where you stand or how wide you look, which is precisely what "a line has constant slope" means. (The +1 never stood a chance: any added constant appears in both f(x+h) and f(x) and is wiped out by the subtraction. Shifting a graph up or down changes none of its slopes.) The extreme case is a constant function f(x) = k: numerator k - k = 0, difference quotient 0. A flat graph has zero rate of change over every stretch — the machine confirms the obvious, which is exactly what a machine should do before you trust it on the non-obvious.

Turn the dial: watch 2x + h as h shrinks

Back to the parabola, armed with the simplified formula. Fix the base point at x = 1, so every secant slope is 2(1) + h = 2 + h, and now do the thing the notation was built for — turn the h dial down and just read off the answers:

step h secant slope 2 + h
1 3
0.5 2.5
0.1 2.1
0.01 2.01
0.001 2.001

No fresh computation, no new function values, no wrestling with tiny numerators over tiny denominators — the unsimplified fraction would have had you dividing 0.002001 by 0.001 at the last row. Instead the pattern is naked: 3,\ 2.5,\ 2.1,\ 2.01,\ 2.001,\ \dots The slopes are converging on 2, and the formula says why: as h melts away, 2 + h can only go to 2. What you are watching emerge from that table is the derivative of x^2 at x = 1 — the parabola's exact steepness at a single point. We haven't formally defined it yet (that's the limit's job, coming shortly), but the difference quotient has already handed us the number.

Worked example: a fraction, f(x) = \dfrac{1}{x}

One more, because not every function is a polynomial and the cancellation doesn't always arrive by expanding brackets. For f(x) = \tfrac{1}{x} the tool you need is an old friend: common denominators.

Step 1: substituting is easy here — the whole input drops into the denominator:

f(x+h) = \frac{1}{x+h}.

Step 2: subtract. Two fractions with different denominators want a common one, namely x(x+h):

\frac{1}{x+h} - \frac{1}{x} = \frac{x}{x(x+h)} - \frac{x+h}{x(x+h)} = \frac{x - (x+h)}{x(x+h)} = \frac{-h}{x(x+h)}.

Watch the top line closely: x - (x+h). The x's cancel and only -h survives — there's the factor of h again, delivered by subtraction rather than expansion. (Mind the minus sign: subtracting the whole bracket gives x - x - h, not x - x + h.)

Step 3: divide by h — dividing a fraction by h multiplies its denominator:

\frac{f(x+h)-f(x)}{h} = \frac{-h}{x(x+h)} \cdot \frac{1}{h} = \frac{-1}{x(x+h)}.

Fully simplified: \dfrac{-1}{x(x+h)}. The bare h in the denominator is gone (the x + h that remains is harmless — it doesn't vanish when h does), and the formula already whispers the ending: shrink h and the secant slopes head for \tfrac{-1}{x \cdot x} = -\tfrac{1}{x^2}. Negative, as it should be — the graph of \tfrac{1}{x} falls as x grows. Three functions, three different kinds of algebra (expanding, cancelling, common denominators), one ritual: build, subtract, divide, and simplify until the lone h downstairs is gone.

Difference-quotient homework is graded around the world every day, and the same two mistakes account for most of the red ink.

Fair question. Once you learn the derivative rules a few pages from now, you'll differentiate x^2 in your head, and the expand-subtract-divide ritual can feel like being made to churn butter when the shop sells it. But here's the secret: every rule in the derivative toolbox was proved by someone doing exactly this simplification, once, in general. The power rule is the difference quotient of x^n simplified with the binomial expansion; the product rule is the difference quotient of f(x)g(x) plus one sneaky added-and-subtracted term. When you do it for x^2, you're not practising arithmetic — you're rehearsing the proof technique behind the whole subject.

And the ritual is older than calculus itself. In the 1630s — decades before Newton or Leibniz, with no notion of a limit anywhere in mathematics — Pierre de Fermat found maxima and tangent lines by a method he called adequality: compare f(x) with f(x + E), divide the difference by E, simplify… and then simply discard whatever still contained E, treating the step as zero after having divided by it as if it weren't. It worked beautifully and it was logically indefensible, and everyone half-knew it: a century later the philosopher Bishop Berkeley mocked these vanishing steps as "the ghosts of departed quantities." The taunt stung because it was fair — and mathematics needed until the 19th century, and the rigorous idea of a limit, to answer it properly. The algebra you just did is Fermat's method, finally standing on solid ground: simplify first, so that letting h vanish afterwards asks nothing illegal of the denominator.

Where this is pointing

You now hold the derivative's chrysalis. The difference quotient \tfrac{f(x+h) - f(x)}{h} packages every average rate of change near x into one expression with a shrink dial; simplifying it removes the 0/0 booby-trap; and the shrinking-h table shows the secant slopes converging on a single number — the curve's exact steepness at a point. What remains is to make "let h shrink to nothing" an honest mathematical operation, and to meet the line the secants tilt toward: the tangent line. When you get there, remember this page's ritual — build, subtract, divide, simplify — it is the engine under everything that follows.

Watch it explained

Sal Khan finds the slope of a secant line for an arbitrary difference — exactly the difference quotient, built and simplified on a live example. A good second pass over the worked examples above.