---
title: The Derivative and Rates of Change
module: Derivatives
moduleNumber: 2
lessonNumber: 1
order: 201
summary: >
  A single limit with three readings: the slope of the tangent line, the
  instantaneous velocity of a moving object, and the rate of change of one
  quantity with respect to another. Built from the difference quotient,
  extended from a value at one point to a function of x, and undefined exactly
  where a corner, jump, or vertical tangent appears.
topics: [Derivatives]
sources:
  - book: Stewart
    ref: "Ch. 2 — Derivatives; §2.1 Derivatives and Rates of Change, §2.2 The Derivative as a Function"
draft: false
---

Finding the line tangent to a curve at a point is geometry; finding the
velocity of a falling ball at an instant is physics. Both reduce to evaluating
a limit of the form

$$
\lim_{h \to 0} \frac{f(a+h) - f(a)}{h}.
$$

That limit is the **derivative**. Read one way it is the slope of a tangent
line; read another it is an instantaneous rate of change. Letting the base
point vary turns it from a number attached to one point into a function in its
own right.

## The tangent problem

A [secant line](/calculus/limits-and-continuity/the-limit-of-a-function) through
two points of a curve has a slope we can compute with algebra. The tangent line
touches at a single point, so the slope formula $\tfrac{y_2 - y_1}{x_2 - x_1}$
has nothing to work with. The way around is to compute the slope of a secant and
then slide one intersection point toward the other.

Let $C$ be the graph of $y = f(x)$ and fix a point $P(a, f(a))$ on it. A nearby
point $Q(x, f(x))$ with $x \ne a$ determines the secant line $PQ$, whose slope is

$$
m_{PQ} = \frac{f(x) - f(a)}{x - a}.
$$

As $x \to a$, the point $Q$ slides along the curve toward $P$ and the secant
pivots. If the secant slopes approach a single number $m$, that number is the
slope of the tangent, and the tangent is the limiting position of the secant.

> **Definition (Tangent line).** The tangent line to $y = f(x)$ at $P(a, f(a))$
> is the line through $P$ with slope
> $$
> m = \lim_{x \to a} \frac{f(x) - f(a)}{x - a},
> $$
> provided this limit exists.

$$
% caption: As Q slides toward P along the curve, the secant line PQ pivots into
% the tangent at P, and its slope approaches the limiting value m.
\begin{tikzpicture}[>=stealth, font=\footnotesize, scale=1.0]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black, thick, domain=-0.35:2.95, samples=90, variable=\x] plot ({\x},{0.5*\x*\x});
\draw[acc, very thick, domain=0.15:2.25, variable=\x] plot ({\x},{0.5 + 1*(\x-1)});
\draw[black, domain=0.55:2.85, variable=\x] plot ({\x},{0.5 + 1.8*(\x-1)});
\draw[black, domain=0.6:2.4, variable=\x] plot ({\x},{0.5 + 1.55*(\x-1)});
\draw[black, domain=0.65:2.0, variable=\x] plot ({\x},{0.5 + 1.3*(\x-1)});
\fill[black] (1,0.5) circle (1.7pt) node[below right] {$P$};
\fill[black] (2.6,3.38) circle (1.5pt) node[right] {$Q_1$};
\fill[black] (2.1,2.205) circle (1.5pt) node[right] {$Q_2$};
\fill[black] (1.6,1.28) circle (1.5pt) node[right] {$Q_3$};
\node[acc, anchor=west] at (2.3,1.35) {tangent};
\end{tikzpicture}
$$

**Example.** For the parabola $y = x^2$ at $P(1,1)$, take $a = 1$ and
$f(x) = x^2$:

$$
m = \lim_{x \to 1} \frac{x^2 - 1}{x - 1}
  = \lim_{x \to 1} \frac{(x-1)(x+1)}{x-1}
  = \lim_{x \to 1} (x + 1) = 2.
$$

The point-slope form gives the tangent $y - 1 = 2(x - 1)$, that is, $y = 2x - 1$.
Zooming in on $(1,1)$ makes the parabola indistinguishable from this line, which
is the geometric content of the tangent being a local approximation to the curve.

### The $h$ form

Setting $h = x - a$ (so $x = a + h$ and $h \to 0$ as $x \to a$) rewrites the same
slope with the increment $h$ as the variable:

$$
m = \lim_{h \to 0} \frac{f(a+h) - f(a)}{h}.
$$

The quotient $\tfrac{f(a+h) - f(a)}{h}$ is the **difference quotient**: rise
over run for the secant joining $P(a, f(a))$ to $Q(a+h, f(a+h))$.

$$
% caption: The difference quotient is the slope of the secant through P and Q,
% the rise f(a+h) - f(a) divided by the run h.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black, thick, domain=0.3:3.35, samples=80, variable=\x] plot ({\x},{0.45*\x*\x});
\draw[acc, very thick, domain=0.6:3.1, variable=\x] plot ({\x},{0.45 + 1.665*(\x-1)});
\draw[black, dashed] (1,0.45) -- (2.7,0.45) node[midway,below] {$h$};
\draw[black, dashed] (2.7,0.45) -- (2.7,3.28) node[midway,right] {$f(a+h) - f(a)$};
\fill[black] (1,0.45) circle (1.6pt) node[left] {$P\,(a,\,f(a))$};
\fill[black] (2.7,3.28) circle (1.6pt) node[above left] {$Q$};
\node[acc, anchor=west] at (2.35,3.9) {secant $PQ$};
\end{tikzpicture}
$$

**Example.** For $y = 3/x$ at $(3,1)$, with $f(x) = 3/x$:

$$
m = \lim_{h \to 0} \frac{\tfrac{3}{3+h} - 1}{h}
  = \lim_{h \to 0} \frac{3 - (3+h)}{h(3+h)}
  = \lim_{h \to 0} \frac{-h}{h(3+h)}
  = \lim_{h \to 0} \frac{-1}{3+h} = -\tfrac{1}{3}.
$$

The tangent at $(3,1)$ is $y - 1 = -\tfrac{1}{3}(x - 3)$, or $x + 3y - 6 = 0$.

## Velocity and the rate of change

Suppose an object moves along a line with position $s = f(t)$, the directed
distance from the origin at time $t$. Over the interval from $t = a$ to
$t = a + h$ the displacement is $f(a+h) - f(a)$, so the **average velocity** is

$$
\text{average velocity} = \frac{f(a+h) - f(a)}{h},
$$

exactly the slope of the secant. Letting $h \to 0$ shrinks the interval to the
instant $t = a$ and defines the **instantaneous velocity**:

$$
v(a) = \lim_{h \to 0} \frac{f(a+h) - f(a)}{h}.
$$

The tangent-slope limit and the velocity limit are identical in form, so they
are computed the same way. This is the general pattern: whenever $y = f(x)$, the
quantity

$$
\lim_{h \to 0} \frac{f(a+h) - f(a)}{h}
$$

measures how fast $y$ changes with respect to $x$ at $x = a$.

$$
% caption: On a position-time graph the secant over the interval has slope the
% average velocity; shrinking the interval pivots it into the tangent, whose
% slope is the instantaneous velocity v(a).
\begin{tikzpicture}[>=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black,->] (-0.2,0) -- (4.6,0) node[right]{$t$};
\draw[black,->] (0,-0.2) -- (0,3.5) node[above]{$s$};
\draw[black, thick, domain=0:3.15, samples=90, variable=\x] plot ({\x},{0.4*\x*\x});
\draw[black, domain=0.4:3.0, variable=\x] plot ({\x},{0.4 + 1.44*(\x-1)});
\draw[acc, very thick, domain=0.25:2.35, variable=\x] plot ({\x},{0.4 + 0.8*(\x-1)});
\fill[black] (1,0.4) circle (1.6pt) node[anchor=north west]{$P$};
\fill[black] (2.6,2.704) circle (1.5pt) node[anchor=west]{$Q$};
\node[acc, anchor=west] at (1.95,1.28) {tangent};
\node[black, anchor=south west] at (2.9,3.28) {secant};
\end{tikzpicture}
$$

**Example.** A ball dropped from a $450$ m tower falls $s = f(t) = 4.9t^2$ metres
in $t$ seconds. Its velocity at a general time $t$ is

$$
v(t) = \lim_{h \to 0} \frac{4.9(t+h)^2 - 4.9t^2}{h}
     = \lim_{h \to 0} \frac{4.9(2th + h^2)}{h}
     = \lim_{h \to 0} 4.9(2t + h) = 9.8t.
$$

After $5$ s the velocity is $v(5) = 49$ m/s. The ball lands when
$4.9t^2 = 450$, i.e. $t = \sqrt{450/4.9} \approx 9.6$ s, so its impact speed is
$v(\sqrt{450/4.9}) \approx 94$ m/s.

> **Definition (Derivative at a number).** The derivative of a function $f$ at a
> number $a$ is
> $$
> f'(a) = \lim_{h \to 0} \frac{f(a+h) - f(a)}{h},
> $$
> if this limit exists. Equivalently, with $x = a + h$,
> $$
> f'(a) = \lim_{x \to a} \frac{f(x) - f(a)}{x - a}.
> $$

Both forms are used; the $h$ form usually leads to simpler algebra. The tangent
line to $y = f(x)$ at $(a, f(a))$ therefore has the compact equation

$$
y - f(a) = f'(a)(x - a).
$$

**Example.** For $f(x) = x^2 - 8x + 9$,

$$
\begin{aligned}
f'(a) &= \lim_{h \to 0}\frac{\bigl[(a+h)^2 - 8(a+h) + 9\bigr] - \bigl[a^2 - 8a + 9\bigr]}{h}\\
      &= \lim_{h \to 0}\frac{2ah + h^2 - 8h}{h}
       = \lim_{h \to 0}(2a + h - 8) = 2a - 8.
\end{aligned}
$$

At $a = 3$ the slope is $f'(3) = -2$, so the tangent at $(3, -6)$ is $y = -2x$.

Because "average rate of change" is the difference quotient and "instantaneous
rate of change" is its limit, the derivative is the single object underneath
several names.

| Setting | $f$ | $x$ | $f'(a)$ reads as |
| --- | --- | --- | --- |
| Geometry | height $y$ | position $x$ | slope of the tangent line |
| Kinematics | displacement $s$ | time $t$ | instantaneous velocity |
| Economics | cost $C$ | quantity $q$ | marginal cost |
| General | $y$ | $x$ | rate of change of $y$ per unit $x$ |

The units follow the ratio: $f'(a)$ carries the units of $y$ divided by the
units of $x$.

## The derivative as a function

Fixing $a$ produced a number. Letting the base point vary produces a function.
Replace the constant $a$ by the variable $x$:

$$
f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}.
$$

For each $x$ where this limit exists we assign the value $f'(x)$, so $f'$ is a
new function **derived** from $f$. Its value at $x$ is the slope of the tangent
to $f$ at $(x, f(x))$. The domain of $f'$ is the set of $x$ where the limit
exists, and it may be smaller than the domain of $f$.

**Example.** For $f(x) = x^3 - x$, treating $x$ as constant and $h$ as the limit
variable,

$$
\begin{aligned}
f'(x) &= \lim_{h \to 0}\frac{(x+h)^3 - (x+h) - (x^3 - x)}{h}\\
      &= \lim_{h \to 0}\frac{3x^2 h + 3x h^2 + h^3 - h}{h}
       = \lim_{h \to 0}(3x^2 + 3xh + h^2 - 1) = 3x^2 - 1.
\end{aligned}
$$

Where $f$ has a horizontal tangent, $f'(x) = 0$; where $f$ rises, $f'(x) > 0$;
where $f$ falls, $f'(x) < 0$. The derivative graph therefore encodes the shape
of $f$: its zeros mark the horizontal tangents, its sign marks the rise and
fall.

> **Worked example.** Find every point of $y = x^3 - x$ with a horizontal
> tangent. A horizontal tangent has slope zero, so set the derivative to zero:
> $$
> f'(x) = 3x^2 - 1 = 0 \;\Longrightarrow\; x = \pm\frac{1}{\sqrt{3}}.
> $$
> At $x = 1/\sqrt3$ the height is $y = \tfrac{1}{3\sqrt3} - \tfrac{1}{\sqrt3} =
> -\tfrac{2}{3\sqrt3}$, and by the odd symmetry of $f$ the other point is its
> reflection. The two horizontal tangents sit at
> $\left(\tfrac{1}{\sqrt3}, -\tfrac{2}{3\sqrt3}\right)$ and
> $\left(-\tfrac{1}{\sqrt3}, \tfrac{2}{3\sqrt3}\right)$, one a local minimum and
> one a local maximum.

$$
% caption: Reading f' off f. Where f has a horizontal tangent (A, B) the
% derivative crosses zero; f' is positive where f rises, negative where it falls.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black,->] (-0.2,0) -- (4.8,0) node[right] {$x$};
\draw[acc, very thick, domain=0:4.35, samples=110, variable=\x]
   plot ({\x},{\x*\x*\x/3 - 2*\x*\x + 3*\x});
\node[acc, anchor=west] at (3.55,2.45) {$y=f(x)$};
\fill[black] (1,1.3333) circle (1.5pt) node[above] {$A$};
\fill[black] (3,0) circle (1.5pt) node[below right] {$B$};
\begin{scope}[yshift=-3.5cm]
  \draw[black,->] (-0.2,0) -- (4.8,0) node[right] {$x$};
  \draw[acc, very thick, domain=0:4.35, samples=110, variable=\x]
     plot ({\x},{0.5*(\x*\x - 4*\x + 3)});
  \node[acc, anchor=west] at (3.75,1.35) {$y=f'(x)$};
  \fill[black] (1,0) circle (1.5pt) node[above right] {$A'$};
  \fill[black] (3,0) circle (1.5pt) node[above right] {$B'$};
\end{scope}
\draw[black, dashed] (1,1.3333) -- (1,-3.5);
\draw[black, dashed] (3,0) -- (3,-3.5);
\end{tikzpicture}
$$

**Example.** For $f(x) = \sqrt{x}$, rationalizing the numerator,

$$
f'(x) = \lim_{h \to 0}\frac{\sqrt{x+h} - \sqrt{x}}{h}
      = \lim_{h \to 0}\frac{(x+h) - x}{h\bigl(\sqrt{x+h} + \sqrt{x}\bigr)}
      = \lim_{h \to 0}\frac{1}{\sqrt{x+h} + \sqrt{x}} = \frac{1}{2\sqrt{x}}.
$$

Here the domain shrinks: $f$ is defined on $[0, \infty)$ but $f'$ only on
$(0, \infty)$, because the tangent at the origin is vertical.

> **Worked example.** For $f(x) = 1/x$, combine the two fractions in the
> numerator over a common denominator before cancelling the $h$:
> $$
> \begin{aligned}
> f'(x)
>   &= \lim_{h \to 0}\frac{\tfrac{1}{x+h} - \tfrac{1}{x}}{h}
>    = \lim_{h \to 0}\frac{1}{h}\cdot\frac{x - (x+h)}{x(x+h)}\\
>   &= \lim_{h \to 0}\frac{-h}{h\,x(x+h)}
>    = \lim_{h \to 0}\frac{-1}{x(x+h)} = -\frac{1}{x^2}.
> \end{aligned}
> $$
> Both $f$ and $f'$ are defined for all $x \ne 0$. The slope $-1/x^2$ is
> negative everywhere the function exists, matching the decrease of $1/x$ on
> each side of the origin, and it steepens sharply as $x \to 0$.

### Notation

Writing $y = f(x)$, the derivative goes by several equivalent symbols. The
Leibniz symbol $\d y/\d x$ is a synonym for $f'(x)$; for now it is one indivisible
piece of notation, not a genuine ratio of two quantities.

$$
f'(x) = y' = \frac{\d y}{\d x} = \frac{\d f}{\d x} = \frac{\d}{\d x} f(x) = D f(x).
$$

To evaluate a Leibniz derivative at a specific number, write
$\left.\dfrac{\d y}{\d x}\right|_{x=a}$, which means $f'(a)$.

> **Definition (Differentiable).** A function $f$ is **differentiable at** $a$ if
> $f'(a)$ exists. It is differentiable on an open interval if it is
> differentiable at every number in the interval.

## Differentiability implies continuity

Differentiability is a stronger condition than continuity: a smooth-enough
function is automatically unbroken, though the converse fails.

> **Theorem (Differentiability implies continuity).** If $f$ is differentiable
> at $a$, then $f$ is [continuous](/calculus/limits-and-continuity/continuity)
> at $a$.

The proof connects the given (the derivative exists) to the goal (the function
value is the limit) by inserting the difference quotient. For $x \ne a$,

$$
f(x) - f(a) = \frac{f(x) - f(a)}{x - a}\,(x - a),
$$

so by the product law for limits,

$$
\lim_{x \to a}\bigl[f(x) - f(a)\bigr]
  = \lim_{x \to a}\frac{f(x) - f(a)}{x - a}\cdot \lim_{x \to a}(x - a)
  = f'(a) \cdot 0 = 0.
$$

Therefore $\lim_{x \to a} f(x) = f(a)$, which is continuity at $a$.

The converse is false. The function $f(x) = |x|$ is continuous everywhere but
not differentiable at $0$, because the one-sided limits of the difference
quotient disagree:

$$
\lim_{h \to 0^+}\frac{|h|}{h} = 1,
\qquad
\lim_{h \to 0^-}\frac{|h|}{h} = -1.
$$

## Failure modes of differentiability

A function can fail to be differentiable at $a$ in three geometrically distinct
ways.

- **A corner.** The graph changes direction abruptly, so the left and right
  difference quotients approach different slopes (as for $|x|$ at $0$). No single
  tangent line exists.
- **A discontinuity.** If $f$ is not continuous at $a$, the previous theorem
  (in contrapositive form) forbids differentiability. A jump discontinuity is
  the standard case.
- **A vertical tangent.** The graph is continuous and the tangent lines get
  steeper without bound, so $\lim_{x \to a}|f'(x)| = \infty$ and the slope is not
  a finite number (as for $\sqrt[3]{x}$ at $0$).

$$
% caption: Three ways a function fails to be differentiable at a: a corner where
% left and right slopes differ, a discontinuity, and a vertical tangent.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\begin{scope}
  \draw[black,->] (-0.1,0) -- (2.25,0);
  \draw[acc, very thick] (0.2,1.5) -- (1.1,0.25) -- (2.0,1.5);
  \fill[black] (1.1,0.25) circle (1.4pt);
  \node[anchor=north] at (1.1,-0.15) {corner};
\end{scope}
\begin{scope}[xshift=3.3cm]
  \draw[black,->] (-0.1,0) -- (2.25,0);
  \draw[acc, very thick] (0.2,0.45) .. controls (0.7,0.95) .. (1.1,1.05);
  \draw[acc, very thick] (1.1,1.75) .. controls (1.5,1.95) .. (2.0,1.6);
  \fill[acc] (1.1,1.05) circle (1.4pt);
  \draw[acc, fill=white] (1.1,1.75) circle (1.4pt);
  \node[anchor=north] at (1.1,-0.15) {jump};
\end{scope}
\begin{scope}[xshift=6.6cm]
  \draw[black,->] (-0.1,0) -- (2.25,0);
  \draw[acc, very thick, domain=-1:1, samples=61, variable=\t]
     plot ({1.1 + 0.85*\t*\t*\t},{1.0 + 0.85*\t});
  \fill[black] (1.1,1.0) circle (1.4pt);
  \node[anchor=north] at (1.1,-0.15) {vertical tangent};
\end{scope}
\end{tikzpicture}
$$

Differentiability at $a$ has a hands-on test: zoom in on $(a, f(a))$. If the
graph straightens into a line, $f$ is differentiable there; a corner or a break
persists at any magnification.

## Higher derivatives

The derivative $f'$ is itself a function, so it may have a derivative. The
**second derivative** $f'' = (f')'$ measures the rate of change of the slope:

$$
f''(x) = \frac{\d}{\d x}\!\left(\frac{\d y}{\d x}\right) = \frac{\d^2 y}{\d x^2}.
$$

**Example.** For $f(x) = x^3 - x$ we found $f'(x) = 3x^2 - 1$, so

$$
f''(x) = \lim_{h \to 0}\frac{\bigl[3(x+h)^2 - 1\bigr] - \bigl[3x^2 - 1\bigr]}{h}
       = \lim_{h \to 0}(6x + 3h) = 6x.
$$

Continuing, $f'''(x) = 6$ and $f^{(4)}(x) = 0$. In general the $n$th derivative
$f^{(n)}$ is obtained by differentiating $n$ times, written $\d^n y/\d x^n$.

For a position function $s = s(t)$, the derivatives are the standard chain of
motion quantities.

| Derivative | Symbol | Physical meaning |
| --- | --- | --- |
| First | $s'(t) = v(t)$ | velocity |
| Second | $s''(t) = a(t)$ | acceleration |
| Third | $s'''(t) = j(t)$ | jerk (rate of change of acceleration) |

A large jerk is a sudden change in acceleration, felt as an abrupt lurch in a
vehicle. The second derivative also measures
[concavity and inflection](/calculus/applications-of-derivatives/how-derivatives-shape-a-graph),
and the full tower $f^{(n)}$ supplies the coefficients of the
[Taylor series](/calculus/sequences-and-series/taylor-and-maclaurin-series)
that represent a function as an infinite polynomial.
