- A derivative is a slope: how fast one quantity changes as another moves, measured at a single point instead of averaged over a stretch.
- It is found by taking the slope over a window and shrinking the window toward nothing. Zoomed in far enough, any smooth curve is a straight line, and the derivative is that line's slope.
- The rules for derivatives come from pictures: a square growing gives the power rule, a rectangle the product rule, linked stretches the chain rule, and a circle the slope of the sine wave.
- Set a derivative to zero and you find peaks and valleys. Follow tangent lines and you find roots. Stand on a tangent line and you estimate values a calculator would otherwise give.
A car's odometer tells you how far you have gone. Its speedometer tells you something stranger: how fast you are going right now, at this instant, when no time passes and the car covers no distance. Speed is distance divided by time, and at a single instant both are zero. Yet the needle points at a number, and that number is a derivative.
Here is a half-hour drive as a graph: time along the bottom, distance from home up the side. The car pulls away through town, waits at a red light, then picks up speed on the open road. Drag the two orange points to pick a stretch of the trip, and watch the line joining them:
The orange line is a secant, a straight line through two points of the curve. Its steepness is the gray rise divided by the green run: kilometers gained per minute spent, which is the average speed over that stretch. Over the it is 15 km in 30 minutes, 30 km/h. Over the the line lies flat and the average is zero. On the it climbs steeply, over 60 km/h.
So steepness on this graph is speed: steep means a lot of distance for little time, flat means standing still. The question is how to get the speed at one moment rather than over a stretch.
Shrinking the window
An average over a long window blurs together the fast parts and the slow parts. A shorter window blurs less. Fix the left end at one moment, drag the slider to shrink the window from ten minutes down to a thousandth of a minute, and watch the secant's slope on the right:
At four minutes in, a ten-minute window says 29 km/h, because it reaches into the red light. A window says 56, because it takes in the car's top speed. says 51, a 45.67, a hundredth 45.07, and from there the orange curve on the right lies flat on the dashed red line. The slope stops changing. Drag the blue point to another moment and the same thing happens at a different number.
On the left, the secant pivots on the blue point and settles onto one particular line, the red dashed one, which touches the curve at that moment and leans exactly as steeply as the curve does there. It is the tangent. Its slope is what the speedometer shows. To see the settling digit by digit, divide the window by ten again and again:
Every row is an honest average: the distance covered in the window divided by the window's length. None of them is the instantaneous speed, because every window still has some length. But the red digits that stop changing pile up, one more for each tenfold squeeze, and they spell out 45 km/h with more and more zeros after it. The number they close in on is the instantaneous speed.
Mathematicians call that number the limit of the slopes as the window shrinks to zero. Write the window as \green{h} and the curve as \blue{f}, and the derivative at x is
Read it from the inside out: rise over run for a window, then the value those slopes settle on as the window closes. You never put \green{h} = 0 into the fraction, which would give a meaningless 0/0. You watch where it is heading.
Zoom in until it's straight
There is a second way to see the same thing, and it is the one most worth carrying around. Pick a point on a curve and magnify the neighborhood around it. Drag the zoom slider from 1 to 1,000 and watch the curve inside the lens:
At ×1 the lens shows a hump. By ×10 it is a gentle bend, by ×100 you can't tell it from the dashed red tangent, and at ×1,000 the curve strays from a straight line by less than a hundredth of a percent of what the lens shows. Drag the point anywhere along the curve and it is the same story. Every smooth curve, looked at closely enough, is a straight line. This is local linearity, and the derivative is the slope of that line.
Now switch to the curve and put the point on the corner itself. No zoom straightens it out. The left side keeps one slope, the right side keeps another, and the lens shows a V at ×10 and at ×1,000 alike. There is no single line to read a slope from, so at that point the curve has no derivative.
A slope for every point
The speedometer doesn't give one number for the trip. It gives a number at every moment. In the same way, a curve has a slope at every point, and those slopes together make a new function, the derivative function \red{f'}. Pick a curve, then drag across the figure to slide the point along it, and watch the slope leave a trail in the lower graph:
For the dots fall on a straight line through the origin: the slope at x is 2x. Left of zero the parabola falls, so the slopes are negative; at the bottom it is flat, slope zero. For the slopes trace 3x^2, never negative, because the curve never goes down. For they trace a wave shifted a quarter turn, which is cos x. And is the odd one: its trail lies right on top of the curve itself. It is the function that is its own slope.
Now try and slide through zero. The slopes jump from −1 to +1 with nothing in between, and at zero itself the two sides disagree. That is the corner from the lens again: the function exists there, but its derivative doesn't.
Reading a derivative off a graph takes three rules. Rising means a positive slope, falling a negative one. At a peak or the bottom of a valley the slope is zero. Steep means a big slope, gentle a small one. Before the next figure, guess:
Where on a curve is its slope graph highest?
At the highest point the curve is flat, so its slope is zero. The slope graph peaks where the curve climbs fastest, which on a hill is partway up the side.
Point at or drag across either graph, and compare the curve with its slope graph underneath. The brass marks are where the curve turns:
Every brass peak and valley sits directly over a place where the red curve crosses zero, and between them the sign of the red curve tells you which way the blue one is heading. The slope graph is highest not at the top of a hill but partway up its side, where the climb is steepest. On the , the slope graph is the speedometer's record: a hump for the town leg, a flat zero at the red light, a taller hump on the open road.
Rules you can see
Shrinking windows by hand every time would be slow. Luckily the derivatives of common functions follow a handful of rules, and each rule comes from a picture. Start with x^2, the area of a square with side \blue{x}. Grow the side by a little \green{dx} and look at the new area:
The new area is two red strips, each x long and dx wide, plus a gray corner dx on each side. Divide by dx to get area gained per unit of growth: 2x + dx. Now shrink dx. The strips shrink in proportion, but the corner shrinks with the square of dx, so its share falls from about 12% at dx = 0.4 to under 1% at . In the limit only the strips are left, and the derivative of x^2 is \red{2x}, the same line the dots traced earlier.
A cube does the same in three dimensions: growing it adds three slabs of size x^2 \cdot dx, plus edges and a corner that vanish faster, so the slope of x^3 is 3x^2. The pattern holds for every power: the derivative of x^n is n\,x^{n-1}. That's the power rule.
When two changing quantities are multiplied, the picture is a rectangle with both sides growing. Take width u = x and height v = x^2, so the area is x^3 again. Nudge x and watch where the new area goes:
Again the growth is two strips and a corner. The side strip is the height times the change in width, v\,du; the top strip is the width times the change in height, u\,dv. The corner du\,dv is a small change times a small change, and it disappears in the limit. Dividing by dx gives the product rule, (uv)' = u'v + uv'. With u = x and v = x^2 it gives x^2 + 2x^2 = 3x^2, the same answer the cube gave.
The third rule is for a function inside another function, like \sin(x^2): square first, then take the sine. Think of each step as a number line that gets stretched. Squaring stretches the line near x by some factor, the sine stretches the result by another, and a small window on the first line comes out stretched by both. Drag the green window along the top line:
The gray lines show squaring spreading the numbers apart as x grows, and the sine squeezing them, then flipping them where it turns down. A small window only feels the local stretch. At x = 0.8 squaring stretches it 1.65 times, the sine shrinks that to 0.78, and the bottom window is the product, 1.28 times the original. Shrink the window and the factors settle on the two derivatives, \orange{2x} = 1.6 and \blue{\cos u} = 0.80. Rates through a chain multiply. That's the chain rule:
Gears work the same way: if the first gear drives the second three times as fast, and the second drives the third twice as fast, the third turns six times as fast as the first. The chain rule is that, for stretches that vary from place to place.
One more rule, the one the slope trail hinted at: the slope of \sin x is \cos x. The sine is the height of a point going round a circle of radius 1. Move the point a small step \green{d\theta} along the circle and watch how much its height rises compared with the brass base of the big triangle:
The arc step leaves the point at right angles to the radius, so the little triangle it makes with its rise is the big triangle turned a quarter turn. In the big triangle, the brass base is \cos\theta on a slanted side of 1. In the little one, the rise plays the base's part and the step plays the slanted side's, so the rise is about \cos\theta \cdot d\theta. With a big step the guess is rough: 0.40 against 0.62 at the start. At a it is 0.618, within 0.004. Drag the point round: the rise is largest at the right of the circle, zero at the top, and negative on the way down, just as the cosine goes.
Acceleration and bending
A derivative is a function, so it has a derivative of its own. On the trip, the slope of distance is speed, and the slope of speed is acceleration: how fast the speedometer needle is moving. Drag across the three graphs, from the distance on top to the speed and the acceleration below:
The car's speed peaks at 60 km/h six minutes in, and right there the acceleration is zero: the needle has stopped climbing and is about to fall. The steepest climb of the speed, about 16 km/h per minute, is where acceleration peaks. Braking for the light shows up as negative acceleration, and at the light itself all three are flat. This is the second derivative, written \purple{f''}, and a car's accelerometer measures it directly.
On a graph, the second derivative shows as bending. Where the slope is increasing, the curve bends upward like a cup and sits above its tangent line. Where the slope is decreasing it bends down like a cap and sits below. Slide the tangent along this curve and watch the gap between them:
Right of the middle, the shaded gap opens upward on both sides of the tangent, and the purple f'' is positive. Left of the middle the gap hangs below, and f'' is negative. At the curve switches from cap to cup and crosses its own tangent. That switch is called an inflection point. The two derivatives answer different questions: f' says which way the curve is heading, f'' says which way it is turning.
Finding the best
The most common use of a derivative is finding the largest or smallest value of something. At the top of a smooth hill the curve is flat, so find where the slope is zero and you have every candidate for a peak. A classic: cut equal squares from the corners of a 20 cm sheet and fold up the sides into an open box. Change the cut and watch the volume:
A thin cut gives a wide, shallow tray; a deep cut gives a tall, narrow tube. Somewhere between is the biggest box, and the tangent finds it: it tilts up while more cut still helps, down once it starts to hurt, and lies flat at the top. The volume is V = x(20 - 2x)^2. Its derivative, by the product and chain rules, is (20 - 2x)(20 - 6x), which is zero at x = 10 (no box at all) and at cm, about 3.33 cm. That box holds about 593 cm³, and no other cut beats it.
Riding the tangent
A tangent line is the best straight stand-in for a curve near a point, and straight lines are easy to solve. Newton used that to find roots, the places where a function crosses zero, in his own worked example x^3 - 2x - 5 = 0 . Start from a guess, follow the tangent down to where it hits zero, and use that as the next guess. Step it:
From a first guess of 3, the tangent lands at 2.36, then 2.127, 2.0951, and 2.0945517. The red digits match the true root, and once the guess is close their count roughly doubles each step: three, then seven, then all eleven shown. Each step needs only the function's value and its slope at the current guess:
From most starting points the method closes in within a few steps, which is why computers use it to take square roots and solve equations. But , near the flat bottom of the valley, and the first tangent shoots off to 37 before the guesses find their way back.
The same stand-in line gives quick estimates. The square root of 4 is 2, and the slope of \sqrt{x} there is 1/(2\sqrt{4}) = 1/4. So for a number a little past 4, add a quarter of the overshoot. Move x and compare the tangent's estimate with the true root:
At the tangent says 2.025 and the true value is 2.02485, off by about 0.00015: four good digits from one division. At it says 2.25 against 2.236, and at 3.25 against 3, because the curve has bent away from the line. Halve the distance from the base point and the error drops to about a quarter, like the corner of the growing square. This is linear approximation: near a point you know, swap the curve for its tangent.
Back to the speedometer
Now the needle makes sense. Play the trip, or drag along the curve, and watch the speedometer read the slope of the tangent:
A speed at a single instant, when no time passes, is the slope of the tangent: the number that averages over shorter and shorter stretches close in on. Zoom in on the distance curve at any moment and it's a straight line, and the needle reads that line's slope. The odometer is the function, the speedometer its derivative, and the push into your seat when the driver speeds up is the second derivative.
The idea runs well beyond cars. A falling stone's speed is the derivative of its height, an electric current the derivative of charge, and the gradient that trains a neural network is a list of derivatives, one per weight. Whenever something changes and you ask how fast, right now, the answer is a derivative.
Going deeper: what "the limit" means exactly 4 min
The limit in the definition was settled in the 1800s. Augustin-Louis Cauchy defined the derivative as the limit of the difference quotient in 1823 , and Karl Weierstrass later made "limit" exact with two small numbers, written ε (epsilon) and δ (delta) . The statement
means: for every tolerance \varepsilon \gt 0, however small, there is a window size \delta \gt 0 such that whenever 0 \lt |h| \lt \delta, the quotient is within \varepsilon of L. It is a game. You name how close you want to be; I have to find a window narrow enough to guarantee it. Here Q is the trip's slope at four minutes, and L = 45 km/h. Shrink the tolerance:
Inside the green window, the blue curve never leaves the orange band. Make ε ten times smaller and δ shrinks too, but a δ always exists, and that is all "the limit is 45" claims. The hole at h = 0 is honest: the quotient is never computed there, and the definition never needs it to be.
The same definition explains the corner. For |x| at 0, the quotient is −1 for every negative h and +1 for every positive one. Ask for ε = 0.5 and no window works, because any window holds both values. Stranger still, Weierstrass built a curve that is continuous everywhere and has corners at every scale, so it has no derivative anywhere: zoom in on it as far as you like and it never straightens out.
References
- Silvanus P. Thompson, Calculus Made Easy, Macmillan, 1910. The "little bits" approach to the growing square and cube used here.
- Gilbert Strang, Calculus, Wellesley-Cambridge Press, 1991.
- Tjalling J. Ypma, “Historical development of the Newton-Raphson method”, SIAM Review 37(4) (1995), 531-551.
- Augustin-Louis Cauchy, Résumé des leçons données à l'École royale polytechnique sur le calcul infinitésimal, Paris, 1823.
- Judith V. Grabiner, “Who gave you the epsilon? Cauchy and the origins of rigorous calculus”, The American Mathematical Monthly 90(3) (1983), 185-194.