How Differentiation Actually Works

You already know how to measure a slope. Differentiation is what happens when you try to measure it at a single point — and the answer turns out to be the most important idea in calculus.

By Petrus Sheya

June 26, 2026 · 6 min read

You already know how to find the slope of a straight line. Pick two points, divide the rise by the run. Done.

Now: what is the slope of a curve at a single point?

A single point has no rise and no run. Divide zero by zero and the formula breaks. And yet this is the question calculus answers — exactly, not approximately.


The obvious first try

Here's a curve: f(x)=x2f(x) = x^2. It's steep on the right, nearly flat near the origin, and constantly changing its tilt. You can't find "the slope" of this curve the way you would for a line — the slope is different everywhere.

But you can cheat a little.

Pick two points on the curve and draw a straight line through them. That line — called a secant line, from the Latin secare, to cut — has a perfectly ordinary slope. It's not the slope at a point, but the slope between two points. It's a start.

With a fixed point at x0=1x_0 = 1 and a second point at x0+hx_0 + h, the secant slope is:

f(x0+h)f(x0)h\frac{f(x_0 + h) - f(x_0)}{h}

For f(x)=x2f(x) = x^2, this simplifies exactly. Expand the numerator:

(1+h)212h=1+2h+h21h=2h+h2h=2+h\frac{(1 + h)^2 - 1^2}{h} = \frac{1 + 2h + h^2 - 1}{h} = \frac{2h + h^2}{h} = 2 + h

The slope of the secant is 2+h2 + h. Try pulling the second point closer.

Visualizer 01

Secant to Tangent

Drag h toward zero — the purple secant line rotates onto the orange tangent.

12312345PQhf(x) = x²secanttangent at P
Secant slope3.5000
= 2 + h2 + 1.500
True slope (h → 0)2.0000

As hh shrinks, the slope readout approaches 22. The secant line rotates. It's converging on a specific line — the one that just grazes the curve at x=1x = 1 without cutting through.

That convergence is not a coincidence.


The key insight

Look at the formula again: 2+h2 + h. As h0h \to 0, this approaches 22.

The derivative is the value that ratio approaches.

Not the ratio at h=0h = 0 — that's 00\frac{0}{0}, which is undefined. The value the ratio is heading toward as hh gets smaller and smaller. That value has a name: a limit.

f(x0)=limh0f(x0+h)f(x0)hf'(x_0) = \lim_{h \to 0} \frac{f(x_0 + h) - f(x_0)}{h}

The lim\lim notation says: watch what this expression approaches. Don't evaluate it at h=0h = 0. Track where it's going.

For f(x)=x2f(x) = x^2 at x0=1x_0 = 1: the ratio is 2+h2 + h, and it approaches 22. The derivative is 22. Exact.

The graph below plots the ratio f(1+h)f(1)h\frac{f(1+h) - f(1)}{h} as a function of hh. The open circle at h=0h = 0 is where the formula fails — the function is not defined there. But the curve makes the answer unmistakable.

Visualizer 02

The Limit in Motion

The open circle at h = 0 is where the formula is undefined — but the curve has a clear destination.

f ′(1) = 200.511.522.5234h (gap size)slope of secant
Current slope4.0000
Limit (h → 0)2.0000
Error from limit2.0000

Watch the error column as hh shrinks. It's heading toward zero. The slope is heading toward 22. They arrive together.


Why this works

Your car's speedometer doesn't measure speed by recording your position every hour and dividing. It measures over a very short interval — so short the speed barely changes during it — and reports the result as instantaneous.

That reading isn't obtained at a zero-length interval. It's obtained over a very small one, and the limit is what the reading becomes as the interval shrinks to nothing.

A derivative is the same device applied to any function. The gap hh is never zero, but we ask what the ratio approaches as h0h \to 0. When that value exists, it is the exact instantaneous rate of change — not an approximation.

The formula f(1)=2f'(1) = 2 for f(x)=x2f(x) = x^2 isn't rounded. It's the value the ratio is locked onto. More precisely: for any ε>0\varepsilon > 0, no matter how small, there is a δ>0\delta > 0 such that whenever h<δh < \delta, the ratio is within ε\varepsilon of 22. The derivative is the unique number with that property.


A second angle

Let's make the speedometer literal.

A ball rolls along a track. Its position at time tt (in seconds) is:

s(t)=t(4t)2s(t) = \frac{t(4 - t)}{2}

At t=0t = 0 it starts at rest position s=0s = 0, moving fast. It slows, peaks at t=2t = 2, then rolls back. Its velocity — how fast its position is changing — is the derivative of ss:

v(t)=s(t)=42t2=2tv(t) = s'(t) = \frac{4 - 2t}{2} = 2 - t

At t=0t = 0: velocity is 22 m/s (moving forward quickly). At t=2t = 2: velocity is 00 (stopped at the peak). At t=3t = 3: velocity is 1-1 m/s (rolling back).

The tangent line to the position curve has a slope equal to the velocity at that moment. Not approximately — exactly. The two panels below show both at once.

Visualizer 03

Position → Velocity

Drag across the graph — the tangent slope above equals the velocity below.

position s(t)velocity v(t) = s′(t)0s1s2s3s4s
Position s(t)1.500 m
Tangent slope1.000
Velocity v(t)1.000 m/s

Drag the slider to t=2t = 2. The tangent is horizontal — slope zero — and the velocity graph hits zero at the same moment. The ball isn't moving. Then drag past t=2t = 2 and both values go negative together.

The slope of a position graph and the instantaneous velocity are not analogous. They are the same number, described two ways.


What can go wrong

Not every function has a derivative everywhere.

A derivative is a limit, and limits require the ratio to approach the same value from both directions — as h0+h \to 0^+ and as h0h \to 0^-. If those two values disagree, the limit does not exist and neither does the derivative.

Consider f(x)=xf(x) = |x|, the absolute value function. At x=0x = 0, the graph has a sharp corner. Approaching from the right (h>0h > 0), the secant slope heads toward +1+1. Approaching from the left (h<0h < 0), it heads toward 1-1. The two limits are different, so no single value exists for f(0)f'(0).

A smooth, continuous curve has a derivative. A corner breaks it. A jump discontinuity breaks it even harder — the function isn't even defined on both sides of the limit. Everywhere you see a kink or gap in a graph, differentiation has given up at that point.

This is not a technical failure. It's the definition working correctly. The derivative is only as precise as the function allows.


Try it yourself

Pick any function below and slide x0x_0 across the domain. Watch the tangent track the curve. For x|x|, slide x0x_0 to exactly 00 and notice what the readout says.

Visualizer 04

Try It Yourself

Pick a function, slide x₀ — or try |x| near 0 to see where the derivative breaks.

-2-1012
Function
f(x₀)1.000
f ′(x₀)2.0000
Derivative rule2 · 1.00 = 2.000

The short version

A derivative measures how fast a function's output is changing, at a single specific input value. You compute it by looking at how the output changes over a small input interval, dividing by that interval's size, and asking what value the result approaches as the interval shrinks toward zero. That value — when it exists — is exact, not approximate. It is the slope of the curve at the point, the speedometer reading of a moving object at an instant, and the starting point of everything else in calculus.