Note · Fundamental concepts
What is a derivative? Rate of change, worked step by step
A derivative is the rate at which a quantity changes at one instant, the slope of its graph at a single point. How it is found from a limit, worked for y = x², and what it is used for.
Comments marked the Graphite mark are Graphite’s.
Graphite’s comments.
Contents · 6 sections
A derivative is the rate at which one quantity changes with respect to another at a single instant. On a graph, it is the slope of the curve at one point: how steeply the curve is rising or falling right there. A car's speed is the derivative of its position, and y = x² has a derivative of 6 at x = 3, where it climbs 6 units up for each unit across. This note is about the calculus idea, not the financial contracts also called derivatives.
In short
- A derivative is an instantaneous rate of change, found as the limit of average rates over smaller and smaller intervals.
- For y = x², the derivative is 2x: the curve gets steeper as x grows, with slope 6 at x = 3.
- Derivatives turn position into velocity, total cost into the cost of one more unit, and find the highest or lowest points of a curve.
What does a derivative measure?
For a straight line, the rate of change is easy: the slope is rise over run, the same everywhere. A taxi fare of 3 dollars plus 2 dollars a mile rises 2 dollars per mile at every point. Most functions aren't straight lines, so their rate of change differs from point to point. The derivative measures that changing rate, one point at a time.
The everyday picture is zooming in. Look closely enough at a smooth curve near any point and it starts to look like a straight line. The slope of that nearly straight piece, called the tangent line, is the derivative at that point. A speedometer does the same thing to a journey: it doesn't report your average over the trip, only how fast your position is changing at this moment.
How do you calculate a derivative?
Take y = x² and ask for its slope at x = 3, where y = 9. The idea is to measure slopes you can compute, between two points on the curve, and let the second point slide toward the first. A line through two points of a curve is called a secant line, and its slope is the change in y divided by the change in x.
Pick a second point a small distance h to the right, at x = 3 + h. Its height is (3 + h)². The secant slope is ((3 + h)² − 9) ÷ h. Now shrink h:
| Gap h | Second point | Secant slope |
|---|---|---|
| 1 | (4, 16) | 7 |
| 0.5 | (3.5, 12.25) | 6.5 |
| 0.1 | (3.1, 9.61) | 6.1 |
| 0.01 | (3.01, 9.0601) | 6.01 |
| 0.001 | (3.001, 9.006001) | 6.001 |
| −0.1 (to the left) | (2.9, 8.41) | 5.9 |
From the right the slopes come down toward 6; from the left they come up toward 6. Algebra shows why. Expand (3 + h)² to 9 + 6h + h², subtract 9, and divide by h: the secant slope is exactly 6 + h. As h shrinks toward zero, 6 + h approaches 6. That limit, 6, is the derivative of x² at x = 3.
The same steps work at any point x, not just 3. The secant slope there is ((x + h)² − x²) ÷ h, which simplifies to 2x + h, so the derivative of x² is 2x everywhere. At x = 1 the slope is 2, at x = 3 it is 6, at x = 10 it is 20, and at x = 0, the bottom of the curve, it is 0. Repeating this for other powers gives the power rule: the derivative of x^n is n × x^(n−1). The derivative of x³ is 3x², of x⁴ is 4x³.
How is a derivative written?
The general definition is the limit calculation above, written once for any function f:
f′(a) = the limit, as h goes to 0, of (f(a + h) − f(a)) ÷ h
Here a is the point you care about, h is the small step away from it, f(a + h) − f(a) is how much the output changes over that step, and dividing by h makes it a rate. The prime mark in f′, read "f prime", means "the derivative of f". Leibniz's notation, dy/dx, says the same thing and reminds you that it is a tiny change in y over a tiny change in x; Newton wrote a dot over the letter, as physicists still do for rates of change in time. The derivative at one point is a single number; the derivative at every point is a new function, here 2x.
Not every function has a derivative everywhere. The function |x|, which turns negatives positive, has a sharp corner at 0: the slope is −1 just left of it and +1 just right, so the secant slopes never settle and there is no derivative there. In 1872 Karl Weierstrass presented a curve that is unbroken yet so jagged that it has no slope, and so no derivative, at any point.
What are derivatives used for?
Velocity and acceleration. A ball dropped from a height falls s = 4.9t² meters in t seconds. Its derivative, by the power rule, is 9.8t, the ball's speed in meters per second: 19.6 at 2 seconds. Take the derivative again and you get 9.8, the acceleration due to gravity in meters per second per second, which doesn't change. Newton's second law, force equals mass times acceleration, is a statement about this second derivative of position.
The cost of one more. Suppose a workshop's total cost of making q chairs is C(q) = 500 + 20q + 0.01q² dollars: 500 in fixed costs, 20 a chair in materials, and a small extra cost that grows with volume. The derivative is C′(q) = 20 + 0.02q. At 1,000 chairs that is 40 dollars, and indeed the 1,001st chair adds 40.01 dollars to the total. Economists call this the marginal cost, and thinking at the margin is derivatives in words.
Finding the best. At the top of a hill or the bottom of a valley, a smooth curve is momentarily flat, so its derivative is zero. That turns "find the maximum" into "solve derivative = 0". Cut equal squares of side x from the corners of a 30-centimeter square of card and fold up the sides to make an open box. Its volume is V = x(30 − 2x)². The derivative works out to (30 − 2x)(30 − 6x), which is zero at x = 5 (x = 15 would leave no box). A 5-centimeter cut gives 5 × 20 × 20 = 2,000 cubic centimeters; cuts of 4 and 6 give 1,936 and 1,944, so 5 is the best.
The same idea, scaled up to millions of variables, is how deep learning trains a network. The derivative of the network's error with respect to each of its settings says which way is downhill, and training takes small steps that way, a method called gradient descent.
What do people get wrong about derivatives?
The most common mistake is to treat "slope zero" as "maximum". A zero derivative only says the curve is flat at that point. It may be a peak, a valley, or neither: y = x³ is flat at 0 but keeps rising on both sides. You have to check what the slope does on either side, or compare nearby values, as the box example did with cuts of 4 and 6.
A second is to picture the derivative as dividing zero by zero. It never does. The derivative is what the ratio approaches as the gap shrinks, a limit, and the gap is never actually zero. That distinction, worked out rigorously in the 19th century, is what put calculus on firm ground. The reverse question, recovering a total from a rate, belongs to the integral, and the fundamental theorem of calculus says the two operations undo each other.
Check yourself
- Without looking back, explain why the secant slopes for y = x² at x = 3 close in on 6, using the expression 6 + h.
- What is the derivative of a ball's position, and what is the derivative of that?
- Why doesn't a derivative of zero always mean you have found a maximum?
Sources
- Defining the derivative — OpenStax, Calculus Volume 1, Rice University, 2016
- Derivatives as rates of change — OpenStax, Calculus Volume 1, Rice University, 2016
- Maxima and minima — OpenStax, Calculus Volume 1, Rice University, 2016
- Derivative — Wikipedia