Slope, the idea you already own
Picture a straight road climbing a hill. For every 10 metres you walk forward, you rise 2 metres up. That ratio — rise over run, here 2/10 — is the slope: a single number saying how steep the line is. Steeper road, bigger number; flat road, slope of zero; downhill, a negative slope. You met this in algebra long before anyone said the word *calculus*, and it is the seed the whole subject grows from.
The same arithmetic describes change of any kind, not just hills. If a [[function-calculus|function]] f tells you a quantity's value at each input — money in an account over the months, distance travelled over the seconds — then the slope between two of its points is the [[rate-of-change|average rate of change]]: how much the output moved, divided by how much the input moved. For a straight line that number is fixed everywhere. For a curve it is not, and that single fact is where the story turns interesting.
Average rate of change, written down
Take a function f and two inputs, a and b. The point at a sits at height f(a); the point at b sits at height f(b). Draw the straight line joining those two points — it cuts across the curve, so it's called a secant line (from the Latin for *cutting*). Its slope is the [[rate-of-change|average rate of change]] of f from a to b, and the formula is just rise over run again:
average rate of change = ( f(b) - f(a) ) / ( b - a )
Example: f(x) = x^2, from a = 1 to b = 3
f(3) - f(1) 9 - 1 8
------------- = ------- = --- = 4
3 - 1 3 - 1 2The most familiar example of all is motion. If f(t) is the distance a car has travelled by time t, then ( f(b) - f(a) ) / ( b - a ) is total distance divided by total time — plain average speed. Drive 120 km in 2 hours and your average speed is 60 km/h, no matter how the trip actually went.
The question average can't answer
Now glance at your speedometer. It doesn't show 60 km/h *for the trip* — it shows how fast you are going at this very instant, and it changes the moment you touch the pedal. That is a completely different quantity: not speed averaged over two hours, but speed at a single point in time, when no time at all has passed. This is the question calculus was born to answer — and notice that our formula chokes on it.
Try to compute speed at a single instant by setting b equal to a. The run, b - a, becomes 0, and so does the rise, f(b) - f(a). The formula collapses to 0/0 — meaningless. A single instant is one point, and you cannot draw a secant line through just one point; you need two to have a slope at all. So instead of demanding the impossible, we do something cleverer: we keep b a *little* away from a, then slide it closer and closer, watching what the secant slope does.
- Fix the instant you care about — say a = 1 on the curve f(x) = x^2.
- Pick a second point b a small step away, and compute the secant slope ( f(b) - f(1) ) / ( b - 1 ).
- Move b nearer to 1 — try 1.1, then 1.01, then 1.001 — and recompute each time.
- Watch whether those slopes home in on a single number. If they do, that number is the instantaneous rate of change.
Watching the secant slope settle
Let's actually run the experiment for f(x) = x^2 at a = 1. We never set b exactly equal to 1 — that would give 0/0 — but we creep it in and write down each secant slope. A few lines of arithmetic make the pattern impossible to miss.
def f(x):
return x * x
a = 1.0
for b in [2.0, 1.5, 1.1, 1.01, 1.001, 1.0001]:
secant_slope = (f(b) - f(a)) / (b - a)
print(b, secant_slope)
# b secant slope
# 2.0 3.0
# 1.5 2.5
# 1.1 2.1
# 1.01 2.01
# 1.001 2.001
# 1.0001 2.0001Look at what happened. We could never plug in b = 1 directly, yet the slopes left no doubt about where they were heading: 2. That target value — the number the secant slopes approach as the two points squeeze together — is what we will soon call a [[limit|limit]]. The slope they settle on is the slope of the [[tangent-line|tangent line]] that just grazes the curve at that one point, and it *is* the instantaneous rate of change. Carry it to its limit and this whole construction becomes the [[derivative-calculus|derivative]] — the engine of the next track.