A speedometer reads a single number — say 60 km/h — at a single instant. But speed is distance divided by time, and an instant has no duration. So what could that number even mean? Answering this honestly is the whole of calculus, and the answer is one of the most useful ideas you will ever learn: the derivative.
Average speed is the slope of a line
Start with something you already trust. You drive 120 km and it takes 2 hours. Your average speed is
\[ \frac{120 \text{ km}}{2 \text{ hours}} = 60 \text{ km/h}. \]Notice the shape of that calculation: a change in distance, divided by a change in time. Now picture a graph of your position against time. Pick the two moments — start and finish — and mark the two points on the curve. Draw the straight line through them. The "rise" of that line is the distance you covered; the "run" is the time it took. So your average speed is exactly the slope of that line.
A line cutting through a curve at two points has a name: a secant line. Hold on to that picture — average rate of change is the slope of a secant. Everything that follows is built from it.
The difference quotient
Let's write that idea in symbols so we can do something with it. Suppose a quantity is described by a function \( f \). To measure how fast \( f \) is changing near a point \( x = a \), look a small step \( h \) further along, at \( a + h \). Over that step, \( f \) changes from \( f(a) \) to \( f(a+h) \). The average rate of change is the change in output over the change in input:
\[ \frac{f(a+h) - f(a)}{h}. \]This expression is called the difference quotient. It is just rise over run again: \( f(a+h) - f(a) \) is the rise, and \( h \) is the run. It is the slope of the secant line joining the two points \( \big(a,\, f(a)\big) \) and \( \big(a+h,\, f(a+h)\big) \) on the graph.
In words The difference quotient \( \frac{f(a+h)-f(a)}{h} \) is the average rate at which \( f \) changes between \( a \) and \( a+h \). It tells you the typical speed over a stretch — not the speed at one instant. For that, we need to shrink the stretch.
Closing the gap: the derivative
Here is the move that makes calculus possible. The secant line measures speed over an interval of width \( h \). To find the speed at the single instant \( x = a \), make that interval smaller — slide the second point inward, toward the first. As \( h \) gets tiny, the two points almost merge, and the secant line swings around until it just grazes the curve at \( a \). That limiting line is the tangent line, and its slope is the instantaneous rate of change.
We capture "let \( h \) shrink toward zero" with a limit. The derivative of \( f \) at \( a \), written \( f'(a) \), is
\[ f'(a) = \lim_{h \to 0} \frac{f(a+h) - f(a)}{h}. \]Read it slowly: \( f'(a) \) is the number the secant slopes close in on as the second point slides into the first. It is the slope of the tangent line — the exact rate of change at the instant \( a \). That single definition is the engine of this entire stage.
Slide the second point inward yourself. Below is \( y = x^2 \) with a secant line anchored at \( a = 1 \); step \( h \) toward \( 0 \) and watch the secant slope \( 2a + h \) close in on the tangent slope \( f'(a) = 2a \).
Deriving it by hand for \( f(x) = x^2 \)
Let's earn that result instead of trusting the picture. Take \( f(x) = x^2 \) and feed it through the definition at a general point \( a \). First build the difference quotient:
\[ \frac{f(a+h) - f(a)}{h} = \frac{(a+h)^2 - a^2}{h}. \]Expand the square: \( (a+h)^2 = a^2 + 2ah + h^2 \). The \( a^2 \) terms cancel, leaving
\[ \frac{a^2 + 2ah + h^2 - a^2}{h} = \frac{2ah + h^2}{h}. \]Every term in the top has a factor of \( h \), so divide it out:
\[ \frac{2ah + h^2}{h} = 2a + h. \]This is the punchline. The messy quotient simplifies to the clean expression \( 2a + h \) — the secant slope you saw in the widget. Now let \( h \to 0 \). The stray \( h \) vanishes, and
\[ f'(a) = \lim_{h \to 0} (2a + h) = 2a. \]Because this works at every point \( a \), we drop the special name and write it as a function of \( x \): for \( f(x) = x^2 \), the derivative is \( f'(x) = 2x \). At \( x = 3 \) the tangent has slope \( 6 \); at \( x = -1 \) it has slope \( -2 \). The derivative is a new function that hands you the slope at any point you ask for.
Tip — why "zoom in"? Pick any point on a smooth curve and keep magnifying. The curve flattens until, under enough zoom, it is indistinguishable from a straight line — its tangent. The derivative is simply the slope of that line. Differentiable just means "looks straight when you zoom in far enough."
Two names, one idea: \( f'(x) \) and \( \frac{dy}{dx} \)
You will meet two notations for the derivative, and they mean exactly the same thing. The prime notation \( f'(x) \) reads "f-prime of x." The Leibniz notation \( \frac{dy}{dx} \) reads "dee-y dee-x" and is meant to remind you of \( \frac{\text{rise}}{\text{run}} \) — a change in \( y \) over a change in \( x \), pushed to the limit. If \( y = x^2 \), then both \( f'(x) = 2x \) and \( \frac{dy}{dx} = 2x \) say the identical thing. Use whichever is clearer in the moment.
A shortcut for every polynomial: the power rule
Running the limit by hand each time would be exhausting. Happily, a pattern emerges. Differentiate \( x^2 \) and you get \( 2x^1 \). Do the same work for \( x^3 \) and you get \( 3x^2 \); for \( x^4 \), \( 4x^3 \). In every case the exponent drops down front as a multiplier and the new exponent is one smaller. That is the power rule:
\[ \frac{d}{dx}\big[x^n\big] = n\,x^{\,n-1}. \]Check it against what we proved: with \( n = 2 \), the rule gives \( 2x^{2-1} = 2x \). Exactly the \( f'(x) = 2x \) we found from the definition. The power rule is just that limit, already done for you, for every power at once.
Three more rules let you differentiate any polynomial, and each is common sense once stated:
- Constant rule. A constant function never changes, so its rate of change is zero: \( \frac{d}{dx}[c] = 0 \). The graph is a flat line; flat means slope \( 0 \).
- Constant-multiple rule. Scaling a function scales its slope by the same factor: \( \frac{d}{dx}\big[c\,f(x)\big] = c\,f'(x) \). Stretch the graph vertically by \( 5 \) and every slope is \( 5 \) times steeper.
- Sum rule. The derivative of a sum is the sum of the derivatives: \( \frac{d}{dx}\big[f(x) + g(x)\big] = f'(x) + g'(x) \). Rates of change simply add.
Put them together and any polynomial falls in one pass. Differentiate term by term with the power rule, scale each by its coefficient, and send constants to zero. For example, \( \frac{d}{dx}\big[4x^3\big] = 4 \cdot 3x^2 = 12x^2 \), and \( \frac{d}{dx}[7] = 0 \).
- Set up the difference quotient at \( a = 3 \): \( \dfrac{f(3+h) - f(3)}{h} = \dfrac{(3+h)^2 - 3^2}{h}. \)
- Expand the square: \( (3+h)^2 = 9 + 6h + h^2 \), so the top becomes \( 9 + 6h + h^2 - 9 = 6h + h^2 \).
- Divide by \( h \): \( \dfrac{6h + h^2}{h} = 6 + h. \) This is the secant slope.
- Take the limit as \( h \to 0 \): \( \lim_{h \to 0}(6 + h) = 6. \)
The tangent to \( y = x^2 \) at \( x = 3 \) has slope 6. This matches the rule \( f'(x) = 2x \), since \( 2(3) = 6 \).
- Handle each term. By the power rule, \( \dfrac{d}{dx}\big[x^3\big] = 3x^2. \)
- For \( -3x = -3x^1 \), the constant-multiple and power rules give \( -3 \cdot 1 \cdot x^0 = -3. \)
- Add the pieces (sum rule): \( f'(x) = 3x^2 - 3. \)
- Evaluate at \( x = 2 \): \( f'(2) = 3(2)^2 - 3 = 3 \cdot 4 - 3 = 12 - 3. \)
So \( f'(x) = 3x^2 - 3 \) and \( f'(2) = \mathbf{9} \). At \( x = 2 \) the curve is rising steeply, with slope 9.
That is the derivative: a definition built from a limit of secant slopes, plus a handful of rules that turn the definition into quick arithmetic. In the next lesson you will put it to work — finding where curves peak, where they dip, and how fast things really move.
Practice
Try each one yourself, then reveal the full solution.
1. Use the definition — the difference quotient and its limit — to show that \( f'(x) = 2x \) for \( f(x) = x^2 \).
Start from the definition at a general point \( x \):
\[ f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} = \lim_{h \to 0} \frac{(x+h)^2 - x^2}{h}. \]Expand \( (x+h)^2 = x^2 + 2xh + h^2 \). The \( x^2 \) terms cancel:
\[ \frac{x^2 + 2xh + h^2 - x^2}{h} = \frac{2xh + h^2}{h} = 2x + h. \]Now let \( h \to 0 \), so the leftover \( h \) disappears:
\[ f'(x) = \lim_{h \to 0}(2x + h) = 2x. \]The derivative is \( f'(x) = 2x \).
2. Differentiate \( f(x) = x^3 - 3x \).
Differentiate term by term. The power rule gives \( \frac{d}{dx}\big[x^3\big] = 3x^2 \). For \( -3x \), the constant-multiple and power rules give \( -3 \cdot 1 = -3 \). Adding by the sum rule:
\[ f'(x) = 3x^2 - 3. \]The derivative is \( f'(x) = 3x^2 - 3 \).
3. Find the slope of the tangent to \( y = x^2 \) at \( x = -1 \).
We know \( y = x^2 \) has derivative \( \frac{dy}{dx} = 2x \). The slope of the tangent at a point is the value of the derivative there. Substitute \( x = -1 \):
\[ \left.\frac{dy}{dx}\right|_{x=-1} = 2(-1) = -2. \]The tangent at \( x = -1 \) has slope \( -2 \) — the curve is falling there.