JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

The Derivative: Instantaneous Rate of Change

How fast is something changing at one exact instant, not over a stretch of time? Watch the average rate of change tighten down to a single point and become the **derivative** — the slope of the curve right where you're standing.

From average speed to one instant

Imagine driving from home to a shop 60 km away, and it takes you one hour. Your average speed was 60 km/h — total distance divided by total time. But that single number hides everything that actually happened: you sped up, you slowed for a red light, maybe you stopped completely. The question a derivative answers is sharper: not "how fast on average?" but "how fast exactly now, at this very instant?" — the number your speedometer shows.

Here is the honest trick. An instant has no duration, so you can't divide distance by zero time. Instead you measure the average rate of change over a tiny window — say, between time t and a moment t+h just afterwards — and then make that window shrink toward nothing. The averages settle down toward one number, and that settling-down is exactly a limit. The derivative is that limit.

The difference quotient and the tangent line

Now picture the graph of a function f instead of a road. Pick a point on the curve at x, and a second point a little to the right at x+h. Draw the straight line through those two points — a secant line. Its slope is the rise over the run: (f(x+h) - f(x)) / h. This fraction is called the difference quotient, and it is just the average rate of change dressed in graph clothing.

Now slide the second point toward the first by letting h shrink to 0. The secant line pivots, and in the limit it touches the curve at just one spot: the tangent line. The slope of that tangent line is the derivative. In symbols: f'(x) = lim h->0 (f(x+h) - f(x)) / h. That single formula is the definition you build everything else on.

f'(x) = lim h->0  ( f(x+h) - f(x) ) / h

        rise        f(x+h) - f(x)
slope = ----  =  ------------------
        run               h
The derivative as a limit of difference quotients — the secant slope as the second point slides in.

Working one out: f(x) = x^2

Let's grind through the definition once, by hand, so the magic is demystified. Take f(x) = x^2 and follow the recipe. The algebra is gentle, and watching the h's cancel is the whole point.

  1. Write the difference quotient: ( f(x+h) - f(x) ) / h = ( (x+h)^2 - x^2 ) / h.
  2. Expand the top: (x+h)^2 = x^2 + 2xh + h^2, so the numerator becomes 2xh + h^2 (the x^2 cancels).
  3. Divide by h (this is legal because h is not yet 0): (2xh + h^2) / h = 2x + h.
  4. Now take the limit as h->0: 2x + h -> 2x. So f'(x) = 2x.

Read the answer back as a sentence: for a parabola y = x^2, the steepness at any point x is 2x. At x = 0 the slope is 0 (the bottom of the bowl is flat); at x = 3 the slope is 6 (climbing steeply). One formula, f'(x) = 2x, tells you the tangent slope everywhere at once.

Smoothness, corners, and a numeric check

A derivative only exists where the curve is smooth enough to have one clear tangent line. This property is called differentiability. Wherever a function is differentiable it must also be continuous — no jumps or gaps — because you can't take a sensible limit across a break. But the reverse is not true: a function can be continuous and still fail to have a derivative.

The classic example is f(x) = |x|, the absolute-value V-shape, at x = 0. It is perfectly continuous there — the graph never lifts off the page. But it has a sharp corner: sneak up from the left and the slope is -1; sneak up from the right and the slope is +1. The two one-sided limits of the difference quotient disagree, so the limit doesn't exist, so there is no single tangent line. At a corner, the derivative simply isn't defined.

def numeric_derivative(f, x, h=1e-6):
    # approximate f'(x) with a tiny but nonzero h
    return (f(x + h) - f(x)) / h

f = lambda x: x**2
print(numeric_derivative(f, 3))   # ~ 6.0, matching f'(x) = 2x at x = 3
A computer can't take a true limit, so it picks a small h and computes the difference quotient directly — landing very close to the exact answer 2x.