The derivative: slope at a point
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.
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 h | Distance at 3 + h | Change | Average speed |
|---|---|---|---|
| 1 | 42 = 16 | 16 − 9 = 7 | 7 / 1 = 7 |
| 0.1 | 3.12 = 9.61 | 0.61 | 0.61 / 0.1 = 6.1 |
| 0.01 | 3.012 = 9.0601 | 0.0601 | 0.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 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.
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
-
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.
-
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.
-
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.
-
Starts from a moving car and asks what "speed at one instant" can mean, as this page does.
-
Draw any curve and see its slope curve drawn beneath it.
Where this shows up
Units that build on this one
- The gradient: the uphill direction Intermediate
- Velocity fields: an arrow at every point Intermediate
- The chain rule: slopes of chained steps Basic