Concept units

The derivative: slope at a point

Basic

Before you start

You need nothing else first. This unit starts from scratch.

The idea in one paragraph

The derivative tells you how fast something changes at one moment. A car's speedometer shows it: the rate at which the distance traveled is growing right now. On a graph, the derivative is the slope of the curve at one point, the steepness of the straight line that just touches the curve there. You find it by measuring the slope over a smaller and smaller step and seeing what number it settles on.

Average speed over a shorter and shorter time becomes the speed now

A car starts from rest and speeds up. After t seconds it has gone t2 meters: 1 meter after 1 second, 4 after 2, 9 after 3, 16 after 4. How fast is it going at exactly 3 seconds?

An average is easy. Between 3 and 4 seconds it went 16 − 9 = 7 meters, so it averaged 7 meters per second. But it was speeding up the whole time, so 7 is too high for the moment t = 3. Take a shorter step and the average gets closer to the true speed at that moment.

Worked example

Speed at t = 3, for the distance f(t) = t2. Use a step of length h, and compute the change in distance divided by the change in time.

Step hDistance at 3 + hChangeAverage speed
142 = 1616 − 9 = 77 / 1 = 7
0.13.12 = 9.610.610.61 / 0.1 = 6.1
0.013.012 = 9.06010.06010.0601 / 0.01 = 6.01

The averages settle on 6. So at exactly 3 seconds the car moves at 6 meters per second. Algebra shows why: ((3 + h)2 − 9) / h = (6h + h2) / h = 6 + h, which becomes 6 as h shrinks to nothing.

Your turn. Use the same method to find the speed at t = 1.

Answer

((1 + h)2 − 1) / h = 2 + h, which settles on 2 meters per second.

On a graph, the derivative is the slope of the touching line

The slope of a straight line is how much it rises for each step to the right: rise divided by run. The average speed above is the slope of a line through two points of the curve, called a secant. As the step shrinks, the second point slides toward the first. The line then turns into the tangent: the line that just touches the curve at that one point. The derivative is the slope of the tangent.

For f(x) = x2, the same algebra at any point x gives a slope of 2x. People write this as f′(x) = 2x (say "f prime") or as df/dx, "a tiny change in f per tiny change in x."

The secant line turns into the tangent as the step shrinks
y = x²
secant slope = 4.0   tangent slope 2x = 3.0
Try this. Set the point to x = 2. Predict the tangent's slope, then drag the step h toward 0 and watch the orange secant swing onto the green tangent. Then find the one point where the tangent is flat.

The sign of the derivative tells you the direction. A positive slope means the curve is going up as you move right, a negative slope means it is going down, and zero means it is flat right there. A flat spot is often the top of a hill or the bottom of a valley, which is why the derivative helps find the lowest point of a curve.

This is a simplification

The words "settles on" stand for a precise idea called a limit, which this page skips. Also, not every curve has a slope everywhere. A sharp corner, like the point of a V, has no single touching line, so the derivative does not exist there. And a tangent can cross the curve where it touches it. The curve y = x3 does this at x = 0, where it levels off for an instant between two climbs.

deriv.py: estimating a slope with smaller and smaller steps

def f(x):
    return x ** 2

x = 3.0
for h in [1.0, 0.1, 0.01, 0.001]:
    slope = (f(x + h) - f(x)) / h
    print(h, round(slope, 6))
1.0 7.0
0.1 6.1
0.01 6.01
0.001 6.001

Check yourself

  1. For f(x) = x2, what is the slope at x = −2? Is the curve going up or down there?

    Answer

    2 × (−2) = −4. The slope is negative, so the curve is going down as you move right.

  2. A cyclist's distance in meters is 5t after t seconds. What is the derivative, and what does it mean?

    Answer

    5 at every moment. The graph is a straight line with slope 5, so the cyclist always moves at 5 meters per second.

  3. The derivative of a curve is zero at some point. What could the curve look like there?

    Answer

    Flat for an instant: often the top of a hill or the bottom of a valley, and sometimes a level step between two climbs.

Go further

Optional background, for readers who want more than this page.

Where this shows up

Units that build on this one