---
title: The Derivative
module: Differentiation
moduleNumber: 5
lessonNumber: 1
order: 501
summary: >
  The derivative is the limit of the difference quotient, the slope the secant
  lines approach as the second point slides into the first. Differentiability
  forces continuity; linearity and the product, quotient, and chain rules follow
  from the definition; and a continuous function can fail to be differentiable,
  as the absolute value does at the origin.
topics: [Differentiation]
sources:
  - book: Lebl
    ref: "Ch. 4 — The Derivative; §4.1 The derivative"
  - book: Rosenlicht
    ref: "Ch. 5 — Differentiation"
draft: false
---

Near a point where it is well-behaved, the graph of a function looks like a
straight line, and that line has a slope recording the rate at which the
function's value changes. Analysis makes this precise without appealing to the
picture: the slope is a
[limit of a function](/real-analysis/continuity/limits-of-functions), and every
rule of differential calculus becomes a theorem about that limit rather than a
fact read off a drawing.

## The difference quotient and its limit

Fix an interval $I$, a function $f : I \to \mathbb{R}$, and a point $c \in I$.
The **difference quotient** of $f$ based at $c$ is

$$
\frac{f(x) - f(c)}{x - c}, \qquad x \in I,\ x \neq c.
$$

It is the slope of the **secant line** through the two graph points
$\bigl(c, f(c)\bigr)$ and $\bigl(x, f(x)\bigr)$. As $x$ moves toward $c$ the
second point slides along the graph toward the first, and the secant pivots. If
those secant slopes approach a single number, that number is the slope of the
**tangent line**, and it is the derivative.

> **Definition (Derivative).** Let $I$ be an interval, $f : I \to \mathbb{R}$,
> and $c \in I$. If the limit
> $$
> L \;=\; \lim_{x \to c} \frac{f(x) - f(c)}{x - c}
> $$
> exists, then $f$ is **differentiable at $c$**, the number $L$ is the
> **derivative of $f$ at $c$**, written $f'(c) \coloneqq L$. If $f$ is
> differentiable at every $c \in I$, then $f$ is **differentiable**, and $f'$ is
> a function $I \to \mathbb{R}$.[^lebl-def]

Two conventions are worth stating once. First, $c$ is allowed to be an endpoint
of $I$; the limit is then automatically one-sided, and every theorem below still
holds, which saves the trouble of excising endpoints. Second, the derivative is
sometimes written $\frac{\d f}{\d x}$ or $\frac{\d}{\d x} f(x)$; the notations name the
same object.

$$
% caption: As x slides toward c the secant lines through (c,f(c)) and (x,f(x))
% pivot toward the tangent, whose slope is the derivative at c.
\begin{tikzpicture}[scale=1.05,>=stealth,font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black,->] (-0.2,0) -- (5.4,0) node[right]{x};
\draw[black,->] (0,-0.2) -- (0,4.4) node[above]{y};
\draw[thick,black] (0.35,0.2) to[out=22,in=205] (2,1.2) to[out=42,in=212] (3.4,2.85) to[out=55,in=232] (4.5,4.15);
\coordinate (c) at (2,1.2);
\coordinate (x1) at (4.25,3.75);
\coordinate (x2) at (3.4,2.85);
\coordinate (x3) at (2.7,1.85);
\draw[black] (c) -- (x1);
\draw[black] (c) -- (x2);
\draw[black] (c) -- (x3);
\draw[acc,very thick] (0.85,0.05) -- (3.35,2.6);
\foreach \p in {x1,x2,x3}{\fill[black] (\p) circle (1.3pt);}
\fill[acc] (c) circle (1.8pt);
\node[below right,acc] at (c) {c};
\node[above left] at (x1) {x};
\node[acc] at (3.35,1.85) {tangent};
\node[black] at (4.55,3.1) {chords};
\end{tikzpicture}
$$

### Worked derivatives from the definition

Every basic derivative is a limit computation: simplify the difference quotient
algebraically until the $x - c$ in the denominator cancels, then let $x \to c$.

> **Worked example (Derivative of $x^2$).** For $f(x) = x^2$ and any $c \in
> \mathbb{R}$, factor the difference of squares:
> $$
> \frac{x^2 - c^2}{x - c} = \frac{(x + c)(x - c)}{x - c} = x + c,
> $$
> so
> $$
> f'(c) = \lim_{x \to c} (x + c) = 2c.
> $$

For an affine function $f(x) = ax + b$ the quotient is $\frac{a(x - c)}{x - c} = a$,
so $f'(c) = a$ at every $c$. Every differentiable function behaves infinitesimally
like an affine function, so working a formula out for $ax + b$ first is a reliable
way to guess the general rule.

> **Worked example (Derivative of $\sqrt{x}$).** For $f(x) = \sqrt{x}$ with
> $c > 0$, rationalize the difference quotient:
> $$
> \frac{\sqrt{x} - \sqrt{c}}{x - c}
> = \frac{\sqrt{x} - \sqrt{c}}{(\sqrt{x} - \sqrt{c})(\sqrt{x} + \sqrt{c})}
> = \frac{1}{\sqrt{x} + \sqrt{c}},
> $$
> so
> $$
> f'(c) = \lim_{x \to c} \frac{1}{\sqrt{x} + \sqrt{c}} = \frac{1}{2\sqrt{c}}.
> $$
> The derivative blows up as $c \to 0^+$: the graph has a vertical tangent at the
> origin.

$$
% caption: The square root has an ever-steepening secant as c approaches the
% origin; its slope 1/(2 root c) grows without bound, leaving a vertical tangent
% at 0.
\begin{tikzpicture}[scale=1.0,>=stealth,font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black,->] (-0.2,0) -- (5.2,0) node[right]{x};
\draw[black,->] (0,-0.2) -- (0,2.9) node[above]{y};
\draw[thick,acc] plot[domain=0:4.7,samples=80] (\x,{1.2*sqrt(\x)});
\node[acc,anchor=west] at (4.4,2.35) {$x^{\frac{1}{2}}$};
\draw[black] (0.15,0.46) -- (2.2,1.78);
\draw[black] (0.05,0.27) -- (1.0,1.2);
\draw[black,densely dashed] (0,0) -- (0,1.3);
\node[black,align=center] at (1.2,0.35) {steepening\\chords};
\fill[acc] (0,0) circle (1.6pt);
\node[below right,black] at (0.05,-0.02) {vertical tangent};
\end{tikzpicture}
$$

### The increment form and one-sided derivatives

Substituting $x = c + h$ recenters the difference quotient on the increment $h$:
$$
f'(c) = \lim_{h \to 0} \frac{f(c + h) - f(c)}{h}.
$$
The two forms are identical, but the increment form makes the two-sidedness
explicit. The limit exists only if the **right-hand derivative** (letting
$h \to 0^+$) and the **left-hand derivative** ($h \to 0^-$) both exist and agree.
When $c$ is an endpoint of $I$ only one side is available, which is why
endpoints need no special treatment. When both sides exist but differ, $f$ has a
corner and is not differentiable, the situation of $|x|$ at the origin below.

## Differentiability forces continuity

A function cannot have a jump or a hole where it is differentiable: the finite
limit defining $f'(c)$ cannot exist across a break.

> **Proposition (Differentiability $\Rightarrow$ continuity).** If
> $f : I \to \mathbb{R}$ is differentiable at $c \in I$, then $f$ is continuous
> at $c$.[^lebl-cont]

> **Proof.** For $x \neq c$ write the increment as a product:
> $$
> f(x) - f(c) = \frac{f(x) - f(c)}{x - c}\,(x - c).
> $$
> Both factors have limits as $x \to c$: the difference quotient tends to
> $f'(c)$, and $x - c$ tends to $0$. By the product rule for
> [limits of functions](/real-analysis/continuity/limits-of-functions),
> $$
> \lim_{x \to c} \bigl(f(x) - f(c)\bigr) = f'(c) \cdot 0 = 0,
> $$
> so $\lim_{x \to c} f(x) = f(c)$, which is continuity at $c$. $\blacksquare$

The converse fails: continuity is a much weaker property than
differentiability.

## Continuous functions with no derivative

The absolute value is the first counterexample.

> **Worked example (The absolute value at $0$).** The function $f(x) = |x|$ is
> continuous everywhere, but at the origin its difference quotient takes two
> different one-sided values:
> $$
> \frac{|x| - |0|}{x - 0} =
> \begin{cases}
> +1, & x > 0, \\[2pt]
> -1, & x < 0.
> \end{cases}
> $$
> The right-hand secants all have slope $+1$ and the left-hand secants slope
> $-1$, so no single limiting slope exists and $f'(0)$ does not exist. The graph
> has a corner, and a corner has no tangent line.

$$
% caption: The absolute value has a corner at the origin: right secants have
% slope one, left secants the opposite sign, so no single tangent exists.
\begin{tikzpicture}[scale=1.0,>=stealth,font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black,->] (-2.4,0) -- (2.6,0) node[right]{x};
\draw[black,->] (0,-0.3) -- (0,2.4) node[above]{y};
\draw[thick,acc] (-2.1,2.1) -- (0,0) -- (2.1,2.1);
\fill[acc] (0,0) circle (1.8pt);
\node[below,acc] at (0,-0.05) {corner};
\node[black,rotate=45] at (1.35,1.05) {slope 1};
\node[black,rotate=-45] at (-1.35,1.05) {slope 1};
\node[align=center,black] at (0,-0.95) {one-sided slopes disagree};
\end{tikzpicture}
$$

The absolute value fails at a single point. Weierstrass exhibited a function that
is continuous on all of $\mathbb{R}$ yet differentiable at no point at all: a
graph with a corner everywhere and a tangent nowhere. Its construction rests on
[uniformly convergent series](/real-analysis/function-sequences/pointwise-uniform-convergence).
Continuity places no bound on how badly a function can fail to be smooth.

## The algebra of derivatives

Differentiation is linear, and it interacts with products, quotients, and
compositions through fixed rules. Each rule is proved by manipulating difference
quotients and passing to the limit, so each rests on the limit laws already
established for functions.

### Linearity

> **Proposition (Linearity).** Let $f, g : I \to \mathbb{R}$ be differentiable at
> $c$ and let $\alpha \in \mathbb{R}$. Then $\alpha f$ and $f + g$ are
> differentiable at $c$, with
> $$
> (\alpha f)'(c) = \alpha f'(c), \qquad (f + g)'(c) = f'(c) + g'(c).
> $$

> **Proof.** Scaling factors out of the quotient,
> $\frac{\alpha f(x) - \alpha f(c)}{x - c} = \alpha\,\frac{f(x) - f(c)}{x - c}$,
> and a limit respects constant multiples. For the sum, split the quotient,
> $$
> \frac{(f + g)(x) - (f + g)(c)}{x - c}
> = \frac{f(x) - f(c)}{x - c} + \frac{g(x) - g(c)}{x - c},
> $$
> and the limit of a sum is the sum of the limits. $\blacksquare$

### The product rule

The derivative of a product is not the product of the derivatives. The correct
statement is the **product rule**, and its shape is visible in a picture: an
increment in $fg$ is an $f$-strip plus a $g$-strip on a rectangle of sides $f$
and $g$.

> **Proposition (Product rule).** If $f, g : I \to \mathbb{R}$ are differentiable
> at $c$ and $h = fg$, then $h$ is differentiable at $c$ and
> $$
> h'(c) = f(c)\,g'(c) + f'(c)\,g(c).
> $$

The proof rests on the algebraic identity
$$
f(x)g(x) - f(c)g(c) = f(x)\bigl(g(x) - g(c)\bigr) + \bigl(f(x) - f(c)\bigr)g(c),
$$
which decomposes the shaded region below. Dividing by
$x - c$, taking $x \to c$, and using continuity of $f$ at $c$ (so $f(x) \to f(c)$)
gives the stated formula.[^lebl-prod]

$$
% caption: The product rule as areas. The full rectangle f(x)g(x) exceeds the
% white f(c)g(c) by strip A of area f times the change in g and strip B of area
% the change in f times g.
\begin{tikzpicture}[scale=1.0,>=stealth,font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\fill[acc!14] (0,1.6) rectangle (3.2,2.7);
\fill[acc!8]  (2,0)   rectangle (3.2,1.6);
\draw[thick,black] (0,0) rectangle (3.2,2.7);
\draw[black] (2,0) -- (2,2.7);
\draw[black] (0,1.6) -- (3.2,1.6);
\node at (1,0.8) {f(c)g(c)};
\node[acc] at (1.6,2.15) {A};
\node[acc] at (2.6,0.8) {B};
\draw[black] (0,0) -- (0,-0.05);
\node[below] at (2,0) {f(c)};
\node[below] at (3.2,0) {f(x)};
\node[left] at (0,1.6) {g(c)};
\node[left] at (0,2.7) {g(x)};
\end{tikzpicture}
$$

Strip $A$ has area $f(x)\bigl(g(x) - g(c)\bigr)$ and strip $B$ has area
$\bigl(f(x) - f(c)\bigr)g(c)$; roughly, $\Delta(fg) = f\,\Delta g + \Delta f\,g$,
and dividing by $\Delta x$ and shrinking it recovers the rule.

### The quotient rule

> **Proposition (Quotient rule).** If $f, g : I \to \mathbb{R}$ are
> differentiable at $c$ and $g(x) \neq 0$ on $I$, then $h = f/g$ is
> differentiable at $c$ and
> $$
> h'(c) = \frac{f'(c)\,g(c) - f(c)\,g'(c)}{\bigl(g(c)\bigr)^2}.
> $$

The quickest derivation differentiates $1/x$ from the definition, then combines
the reciprocal with the chain and product rules; the direct difference-quotient
computation also works.

## The chain rule

Composition is how complicated functions are built, and the **chain rule**
differentiates a composition. Its content is that local linear approximations
compose by multiplying their slopes: if $g$ scales small increments near $c$ by
$g'(c)$ and $f$ scales small increments near $g(c)$ by $f'\bigl(g(c)\bigr)$, then
$f \circ g$ scales by the product.

> **Proposition (Chain rule).** Let $g : I_1 \to I_2$ be differentiable at
> $c \in I_1$ and $f : I_2 \to \mathbb{R}$ be differentiable at $g(c)$. Then
> $h = f \circ g$ is differentiable at $c$ and
> $$
> h'(c) = f'\bigl(g(c)\bigr)\,g'(c).
> $$

$$
% caption: The chain rule composes local linearizations: g multiplies a small
% input change near c, then f multiplies the result near g(c), so the composite
% multiplies by the product of the two slopes.
\begin{tikzpicture}[scale=1.0,>=stealth,font=\footnotesize,
  box/.style={draw,thick,minimum width=20mm,minimum height=11mm,align=center}]
\definecolor{acc}{HTML}{4A6FA5}
\node[box] (a) at (0,0) {input\\change};
\node[box,draw=acc] (b) at (3.6,0) {middle\\change};
\node[box] (c2) at (7.2,0) {output\\change};
\draw[acc,thick,->] (a) -- node[above]{apply g} (b);
\draw[acc,thick,->] (b) -- node[above]{apply f} (c2);
\draw[black,->] (a.south) .. controls (2,-1.5) and (5.2,-1.5) .. (c2.south);
\node[black] at (3.6,-1.35) {composite multiplies the two slopes};
\end{tikzpicture}
$$

> **Proof (sketch).** Set $d = g(c)$ and define the auxiliary functions
> $$
> u(y) =
> \begin{cases}
> \dfrac{f(y) - f(d)}{y - d}, & y \neq d,\\[6pt]
> f'(d), & y = d,
> \end{cases}
> \qquad
> v(x) =
> \begin{cases}
> \dfrac{g(x) - g(c)}{x - c}, & x \neq c,\\[6pt]
> g'(c), & x = c.
> \end{cases}
> $$
> Differentiability of $f$ at $d$ makes $u$ continuous at $d$; differentiability
> of $g$ at $c$ makes $v$ continuous at $c$. The defining identities
> $f(y) - f(d) = u(y)(y - d)$ and $g(x) - g(c) = v(x)(x - c)$ hold for all
> arguments (including the removed points), so
> $$
> h(x) - h(c) = f\bigl(g(x)\bigr) - f\bigl(g(c)\bigr)
> = u\bigl(g(x)\bigr)\,v(x)\,(x - c).
> $$
> For $x \neq c$ divide by $x - c$. Continuity of $g$ at $c$ sends
> $g(x) \to g(c) = d$, so $u\bigl(g(x)\bigr) \to f'(d)$ and $v(x) \to g'(c)$; the
> product of limits is $f'\bigl(g(c)\bigr)g'(c)$.[^lebl-chain] $\blacksquare$

The device of patching the difference quotient into a _continuous_ function $u$
is what avoids the false step of dividing by $g(x) - g(c)$, which can be zero even
when $x \neq c$.

## Powers and polynomials

The rules together compute the derivative of every power of $x$ by induction,
which in turn differentiates every polynomial.

> **Proposition (Power rule).** For $n \in \mathbb{Z}$ the function $x^n$ is
> differentiable, with $\frac{\d}{\d x}x^n = n x^{n-1}$, where for $n < 0$ the point
> $x = 0$ is excluded.

> **Proof.** For $n = 1$ the derivative of $x$ is $1 = 1 \cdot x^0$, the affine
> case. Assume the formula for some $n \geq 1$. Writing $x^{n+1} = x \cdot x^n$
> and applying the product rule,
> $$
> \frac{\d}{\d x}x^{n+1} = 1 \cdot x^n + x \cdot n x^{n-1} = (n + 1)x^n,
> $$
> which is the formula for $n + 1$; induction covers all $n \geq 0$. For $n < 0$
> write $x^n = 1/x^{-m}$ with $m = -n > 0$ and apply the quotient rule to
> $1/x^m$. $\blacksquare$

A polynomial $p(x) = \sum_{k=0}^{d} a_k x^k$ is a finite linear combination of
powers, so linearity and the power rule give
$p'(x) = \sum_{k=1}^{d} k\,a_k x^{k-1}$ at every $x$. Rational functions follow from
the quotient rule on their domains. Between the four algebraic rules and the power
rule, every function built by finite arithmetic from $x$ is differentiable and its
derivative is mechanical.

## Reading the rules as one table

The four rules turn any expression built from known derivatives into a
mechanical computation. Each is an identity about the derivative _at a point_
where the ingredients are differentiable.

| Rule | Hypothesis at $c$ | Derivative at $c$ |
| --- | --- | --- |
| Linearity | $f, g$ differentiable | $\alpha f'(c) + \beta g'(c)$ |
| Product | $f, g$ differentiable | $f(c)g'(c) + f'(c)g(c)$ |
| Quotient | $f, g$ diff., $g(c) \neq 0$ | $\dfrac{f'(c)g(c) - f(c)g'(c)}{g(c)^2}$ |
| Chain | $g$ diff. at $c$, $f$ diff. at $g(c)$ | $f'\bigl(g(c)\bigr)g'(c)$ |

Applied repeatedly, these give the derivative of every polynomial
($\frac{\d}{\d x} x^n = n x^{n-1}$ from the product rule and induction), every
rational function on its domain, and every algebraic combination of functions
whose derivatives are already known.

[^lebl-def]: **Lebl**, _Basic Analysis I_, §4.1, Definition 4.1.1 — the derivative as the limit of the difference quotient, with $c$ permitted to be an endpoint.
[^lebl-cont]: **Lebl**, _Basic Analysis I_, §4.1, Proposition 4.1.6 — differentiability at a point implies continuity there. See also **Rosenlicht**, Ch. 5.
[^lebl-prod]: **Lebl**, _Basic Analysis I_, §4.1, Proposition 4.1.8 and Figure 4.2 — the product rule and its area interpretation.
[^lebl-chain]: **Lebl**, _Basic Analysis I_, §4.1, Proposition 4.1.10 — the chain rule via continuous auxiliary difference quotients.
