The Derivative as a Function

Glance at a car's speedometer and you get one number: how fast you are going right now. That is what the derivative at a single point gave us — f'(a), one slope, at one chosen a, at the cost of one limit calculation.

But a modern car does better than a glance: it logs the speed at every instant of the journey. Plot that log and you get a whole new graph — a speed-against-time curve, telling the complete story of how the trip changed: pulling away, cruising, braking for the junction. Nobody sat there computing speeds one at a time; the log simply records "the speed at whatever moment you ask".

That is exactly the leap this page makes. There is nothing special about the point a — we can find the slope at every point. Replace the fixed a with a roaming variable x, and the answer stops being a number and becomes a brand-new function, the derivative function f'(x):

f'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}

Feed f' any input x and it hands back the slope of f at that x. The graph of f' is the journey log of f: the story of the original curve's slopes, told as a curve of its own. This one shift in viewpoint — from a slope to the slope function — is what turns differentiation from a one-off calculation into a whole machinery.

Worked example 1: do the limit once, use it forever

Take f(x) = x^2 and run the limit definition with the variable x left in place. Watch the h-algebra — it is the same three moves every time.

Step 1 — expand f(x+h).

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

Step 2 — subtract and divide by h. The x^2 terms cancel, and then every surviving term contains an h to cancel against the denominator:

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

Step 3 — let h \to 0. Only the term with no h survives:

f(x) = x^2 \quad\Longrightarrow\quad f'(x) = \lim_{h \to 0}\,(2x + h) = 2x

Now collect the payoff. We did one limit — and got every slope. Want the slope at x = 1? Substitute: f'(1) = 2. At x = 3? f'(3) = 6. At x = -2? f'(-2) = -4. At x = 100? f'(100) = 200. No fresh limit, no fresh algebra — just plug into the formula. Compare that with the point-by-point method, which would demand a brand-new limit calculation for each of those four answers.

And notice how much the formula f'(x) = 2x tells us at a glance: it is negative for x < 0 (the parabola falls), zero at x = 0 (the flat bottom), and positive and growing for x > 0 (the curve climbs ever more steeply). One tidy formula captures every tangent slope at once — that is the whole point of making the derivative a function.

Read f' off the slope of f

Here is the key picture, and it is worth staring at until it clicks. The faint curve is f(x) = x^2; the dashed line is the tangent at your chosen point; the bold line is the derivative f'(x) = 2x. Slide x and watch two things move together: the tangent tilts on the parabola, and the point on the bold line sits at a height equal to that tangent's slope.

Try the landmarks. Park the slider at x = 0: the tangent lies flat, and the bold line passes through height 0 — slope zero, recorded as zero. Drag left of zero: the tangent tips downhill, and the bold line dips below the axis — a falling curve gives a negative slope reading. Drag far right: the tangent gets steeper and steeper, and the reading climbs. Trace the moving reading across the whole range and you draw the line 2x — you are drawing f' by hand.

Watch the slope become a curve

The same idea, animated. Press play: a point sweeps across f(x) = x^2 from left to right, and at every instant its tangent slope is dropped onto the picture as a height. The heights accumulate into a line — and that line is f'(x) = 2x. The derivative function isn't a second, unrelated graph we happened to draw; it is the original graph's steepness, replayed point by point.

Worked example 2: sketch f' from a graph alone

Formulas are not required. Given only a picture of f, you can sketch f' by interrogating the slopes. Here is a curve with a hill and a valley — step through how its derivative takes shape from three clues: where the tangent is flat, where the curve is falling, and where it is steepest.

The checklist that just did all the work, in general form:

(Mind the direction: the theorem says peaks and troughs force zeros of f'. A zero of f' does not force a peak or trough — f(x) = x^3 has f'(0) = 0 yet just flattens momentarily and keeps climbing.)

Worked example 3: match a curve to its derivative

Exam papers love this the other way round: here are some graphs — which one is the derivative of that one? Take f(x) = 3 - x^2, a downward parabola peaking at x = 0, and run the checklist:

Clue 1 — the flat point. f peaks at x = 0, so the derivative must be zero at x = 0. Any candidate that misses the origin is out.

Clue 2 — the signs. Left of the peak, f rises, so f' must be positive for x < 0; right of the peak it falls, so f' must be negative for x > 0. Positive-then-negative, through zero: that is a falling line through the origin.

Clue 3 — confirm with algebra. The same h-computation as before gives f'(x) = -2x — indeed a falling line through the origin. Two clues from the picture were already enough to pick it out of a line-up; the algebra just signs it off. You will meet exactly this kind of line-up in the quiz below.

The single most common error with this topic: assuming the graph of f' is the graph of f shifted, stretched, or otherwise cosmetically edited. It is not — the two graphs answer different questions. f answers "how high?"; f' answers "how steep?". In particular:

If you catch yourself "copying the shape" of f when sketching f', stop and run the three-clue checklist instead.

Step back and look at what we have built. A function like f(x) = x^2 eats a number and returns a number. But differentiation itself — the act of turning f into f' — eats a whole function and returns a whole function. Feed it x^2, out comes 2x. Feed it any line mx + b, out comes the constant m. Feed it (as you'll see later) \sin x, out comes \cos x.

Mathematicians call a function-eating machine like this an operator, and write it \dfrac{d}{dx} — an empty machine waiting for input, so that \dfrac{d}{dx}\!\left(x^2\right) = 2x. Treating operations themselves as objects you can study, combine and invert is one of the big ideas of higher mathematics — and you have just met your first example.

It is also everywhere outside the classroom. A weather map's pressure chart is a function over the whole country; the forecaster's gradient map — where pressure changes fastest, which is where the wind howls — is its derivative, drawn as a function over the very same map. One function in, one function out.

Watch it explained

Sal Khan derives the derivative of f(x) = x^2 for any x — the same once-for-all limit as worked example 1, narrated on a whiteboard — turning the slope into a function.

See it explained