Unit 7: The derivative

Slopes, made precise

The derivative measures how fast a quantity changes at a single instant. But "speed at an instant" seems paradoxical: in an instant, nothing moves. The limit resolves the paradox. And one theorem, the mean value theorem, turns information about slopes into information about values.

123456789101112
In this unit
  1. Secants become a tangent
  2. The best straight-line approximation
  3. Differentiable implies continuous
  4. The rules of differentiation
  5. Flat points and Rolle's theorem
  6. The mean value theorem
  7. L'Hôpital's rule
  8. Practice set
  9. Summary and glossary

Secants become a tangent

The slope of a straight line is rise over run. A curve has no single slope, but we can measure the slope of a chord, or secant, between two of its points: from \(x = a\) to \(x = a + h\), it's the difference quotient

\[ \frac{f(a + h) - f(a)}{h}. \]

Now let \(h\) shrink. The second point slides along the curve towards the first, and the secant swings round towards the tangent line.

Swipe or scroll sideways to step through.

\(h = 1.2\)

Secant with h = 1.2A curve with a point P at x = a. A blue secant line runs from P to the point of the curve at a + 1.2, with an amber step showing the run h = 1.2 and the rise. Its slope is 2.820. A dashed grey tangent line at P, with slope 1.02, is shown for comparison.aa + hslope = 2.820tangent slope = 1.02

A long secant: slope 2.82, far from the tangent's 1.02.

\(h = 0.5\)

Secant with h = 0.5A curve with a point P at x = a. A blue secant line runs from P to the point of the curve at a + 0.5, with an amber step showing the run h = 0.5 and the rise. Its slope is 1.683. A dashed grey tangent line at P, with slope 1.02, is shown for comparison.aa + hslope = 1.683tangent slope = 1.02

Closer: slope 1.683.

\(h = 0.15\)

Secant with h = 0.15A curve with a point P at x = a. A blue secant line runs from P to the point of the curve at a + 0.15, with an amber step showing the run h = 0.15 and the rise. Its slope is 1.206. A dashed grey tangent line at P, with slope 1.02, is shown for comparison.aslope = 1.206tangent slope = 1.02

Slope 1.206, and the secant is nearly the tangent. As \(h \to 0\), the slopes tend to \(f'(a) = 1.02\).

Definition

\(f\) is differentiable at \(a\) if the limit

\[ f'(a) = \lim_{h\to0}\frac{f(a + h) - f(a)}{h} \]

exists. The number \(f'(a)\) is the derivative of \(f\) at \(a\): the slope of the tangent line, or the instantaneous rate of change.

Examples

For \(f(x) = x^2\): \(\dfrac{(a + h)^2 - a^2}{h} = \dfrac{2ah + h^2}{h} = 2a + h \to 2a\). So \(f'(a) = 2a\).

For \(f(x) = \frac1x\): \(\dfrac{\frac1{a + h} - \frac1a}{h} = \dfrac{-1}{a(a + h)} \to -\dfrac1{a^2}\), for \(a \neq 0\).

Notice that we never divide by zero. For each \(h \neq 0\) the quotient is an honest number; only then do we take the limit. This is exactly how analysis answers Berkeley's objection about "ghosts of departed quantities" from Unit 1.

The best straight-line approximation

There's another way to read the definition. Near \(a\), the function is almost a straight line:

\( f(a + h) = f(a) + f'(a)\,h + \text{error}(h), \qquad \dfrac{\text{error}(h)}{h} \to 0 \) The error is small compared with \(h\) itself. Zoom in on a differentiable graph and it looks more and more like its tangent line.

Example

Estimate \(\sqrt{4.1}\). With \(f(x) = \sqrt x\), \(f'(x) = \frac1{2\sqrt x}\), \(a = 4\), \(h = 0.1\): \(\sqrt{4.1} \approx 2 + \tfrac14(0.1) = 2.025\). The true value is \(2.02485\ldots\)

This viewpoint, "differentiable means locally linear", is the one that generalises to functions of several variables, where the derivative becomes a matrix.

Differentiable implies continuous

Theorem

If \(f\) is differentiable at \(a\), then \(f\) is continuous at \(a\).

Proof: \(f(a + h) - f(a) = \dfrac{f(a + h) - f(a)}{h}\cdot h \to f'(a)\cdot 0 = 0\). The converse is false.

A cornerThe V-shaped graph of |x|. To the right of 0 every secant has slope 1; to the left, slope −1. At the corner at 0 there is no single tangent line, so |x| is not differentiable at 0, even though it is continuous.slope 1slope −1
Continuous, but no slope. For \(|x|\) at 0, the difference quotient \(\frac{|h|}{h}\) is \(+1\) for \(h > 0\) and \(-1\) for \(h < 0\), so it has no limit. The graph has a corner. In Unit 11 you'll meet a function that is continuous everywhere and has a corner-like failure at every single point.

The rules of differentiation

All the familiar rules follow from the definition and the limit laws:

RuleFormula
Sum\((f + g)' = f' + g'\)
Product\((fg)' = f'g + fg'\)
Quotient\(\left(\frac fg\right)' = \frac{f'g - fg'}{g^2}\), where \(g \neq 0\)
Chain\((f \circ g)'(a) = f'(g(a))\,g'(a)\)
Inverse\((f^{-1})'(b) = \dfrac1{f'(a)}\), where \(b = f(a)\) and \(f'(a) \neq 0\)
Why the product rule works

Add and subtract \(f(a + h)g(a)\):

\[ \frac{f(a + h)g(a + h) - f(a)g(a)}{h} = f(a + h)\,\frac{g(a + h) - g(a)}{h} + g(a)\,\frac{f(a + h) - f(a)}{h}. \]

As \(h \to 0\), \(f(a + h) \to f(a)\) (differentiable implies continuous), so the right side tends to \(f(a)g'(a) + g(a)f'(a)\). ∎

The chain rule is subtler: the tempting proof that multiplies and divides by \(g(a + h) - g(a)\) fails when that difference is zero for small \(h\). The linear approximation viewpoint gives a clean proof: composing two "almost linear" maps gives an almost linear map whose slope is the product of the slopes.

Flat points and Rolle's theorem

Fermat's theorem

If \(f\) has a maximum or minimum at an interior point \(c\) of an interval, and \(f\) is differentiable at \(c\), then \(f'(c) = 0\).

At a maximum, the difference quotient is \(\le 0\) for \(h > 0\) (the function can only go down) and \(\ge 0\) for \(h < 0\). The limit must be both, so it's 0. Combining this with the extreme value theorem of Unit 6:

Rolle's theorem

If \(f\) is continuous on \([a, b]\), differentiable on \((a, b)\), and \(f(a) = f(b)\), then \(f'(c) = 0\) for some \(c\) in \((a, b)\).

By the EVT, \(f\) reaches a max and a min on \([a, b]\). If both are at the endpoints, \(f\) is constant and \(f' = 0\) everywhere. Otherwise one of them is inside, and Fermat's theorem applies there.

The mean value theorem

Tilt Rolle's picture and you get the single most useful theorem about derivatives.

The mean value theorem (MVT)

If \(f\) is continuous on \([a, b]\) and differentiable on \((a, b)\), then for some \(c\) in \((a, b)\),

\[ f'(c) = \frac{f(b) - f(a)}{b - a}. \]
The mean value theoremA smooth curve from x = a to x = b, with a blue chord joining its endpoints. At two points c between a and b, an amber tangent line is drawn; each one is parallel to the chord. At those points the instantaneous slope equals the average slope over the whole interval.abcc
Average slope equals instant slope, somewhere. Slide a copy of the chord (blue) up or down until it just touches the curve: it touches at a point where the tangent (amber) is parallel to the chord. If your average speed on a 10 km stretch of road is 100 km/h, at some instant your speedometer read exactly 100.
Proof

Subtract the chord: let \(g(x) = f(x) - \left[f(a) + \frac{f(b) - f(a)}{b - a}(x - a)\right]\). Then \(g(a) = g(b) = 0\), so by Rolle \(g'(c) = 0\) for some \(c\), which says \(f'(c) = \frac{f(b) - f(a)}{b - a}\). ∎

The MVT is the bridge from slopes to values. Its consequences are the facts calculus relies on every day:

Going deeper: derivatives can't jump

A derivative need not be continuous. \(f(x) = x^2\sin(1/x)\) (with \(f(0) = 0\)) is differentiable everywhere, with \(f'(0) = \lim \frac{h^2\sin(1/h)}{h} = 0\), but for \(x \neq 0\), \(f'(x) = 2x\sin(1/x) - \cos(1/x)\), which oscillates between about \(-1\) and \(1\) near 0. Still, Darboux proved in 1875 that derivatives always satisfy the intermediate value property, even when discontinuous. So a function like the jump in Unit 6 can never be anyone's derivative.

L'Hôpital's rule

A two-function version of the MVT (Cauchy's mean value theorem) gives a famous tool for limits of the form \(\frac00\):

L'Hôpital's rule

If \(f(a) = g(a) = 0\), and \(\lim_{x\to a}\frac{f'(x)}{g'(x)}\) exists, then \(\lim_{x\to a}\frac{f(x)}{g(x)}\) exists and equals it. (Versions also hold for \(\frac\infty\infty\) and for \(x \to \infty\).)

Example

\(\displaystyle\lim_{x\to0}\frac{e^x - 1 - x}{x^2} = \lim_{x\to0}\frac{e^x - 1}{2x} = \lim_{x\to0}\frac{e^x}{2} = \frac12\), using the rule twice.

Use it with care: check that the limit really has the form \(\frac00\) or \(\frac\infty\infty\) first, and remember the rule is about the quotient of derivatives, not the derivative of the quotient.

Practice set

Mixed questions covering the whole unit. Try each one before opening the answer.

1. Use the definition to find the derivative of \(x^3\) at \(a\).

Show answer

\(\frac{(a + h)^3 - a^3}{h} = \frac{3a^2h + 3ah^2 + h^3}{h} = 3a^2 + 3ah + h^2 \to 3a^2\).

2. Use the definition to find the derivative of \(\sqrt x\) at \(a > 0\).

Show answer

Multiply top and bottom by \(\sqrt{a + h} + \sqrt a\): \(\frac{\sqrt{a + h} - \sqrt a}{h} = \frac{1}{\sqrt{a + h} + \sqrt a} \to \frac1{2\sqrt a}\).

3. Is \(f(x) = x|x|\) differentiable at 0?

Show answer

Yes: \(\frac{f(h) - f(0)}{h} = \frac{h|h|}{h} = |h| \to 0\). So \(f'(0) = 0\), even though \(|x|\) itself has a corner there.

4. Use the MVT to show \(e^x \ge 1 + x\) for \(x > 0\).

Show answer

On \([0, x]\), \(e^x - e^0 = e^c\cdot x\) for some \(c \in (0, x)\). Since \(e^c > 1\), \(e^x - 1 > x\). (For \(x < 0\) a similar argument works, so it holds for all \(x\).)

5. A car covers 120 km in 1.5 hours. Explain why at some moment it was travelling at exactly 80 km/h.

Show answer

Its position is a differentiable function of time, with average rate of change \(120/1.5 = 80\) km/h. By the MVT, at some instant its speed (the derivative) equals that average.

6. Find \(\displaystyle\lim_{x\to0}\frac{1 - \cos x}{x^2}\).

Show answer

It's \(\frac00\). L'Hôpital: \(\lim\frac{\sin x}{2x} = \frac12\lim\frac{\sin x}{x} = \frac12\).

Summary and glossary

  1. \(f'(a) = \lim_{h\to0}\frac{f(a + h) - f(a)}{h}\): the limit of secant slopes, the slope of the tangent.
  2. Differentiable means locally linear: \(f(a + h) \approx f(a) + f'(a)h\) with error small compared with \(h\).
  3. Differentiable implies continuous, but not conversely (\(|x|\) at 0).
  4. At an interior max or min, \(f' = 0\) (Fermat). With the EVT this gives Rolle's theorem.
  5. The MVT: average slope = instantaneous slope somewhere. It shows \(f' = 0 \Rightarrow\) constant, and \(f' > 0 \Rightarrow\) increasing.
Difference quotient
\(\frac{f(a + h) - f(a)}{h}\), the slope of a secant.
Derivative
The limit of the difference quotient as \(h \to 0\).
Linear approximation
\(f(a) + f'(a)h\), the tangent-line estimate of \(f(a + h)\).
Rolle's theorem
Equal endpoint values force a flat point in between.
Mean value theorem
Some tangent is parallel to the chord.
Powered by Webloyt | Report abuse