Survey of Mathematics

1.4 The derivative as best linear approximation

The derivative of f at a is the slope of the one straight line that hugs the graph better than any other near a. From that single idea come the rules of differentiation, the mean value theorem, and Taylor's theorem with an exact error bound.

Beyond the courseAbbott, Understanding Analysis, ch. 5Spivak, Calculus, ch. 9 to 11 and 20Apostol Vol. 2, 8.11 (the same idea in many variables)

In school the derivative was a slope, computed with rules. The rules worked, but where do they come from, and why does f′(a)f'(a) deserve the name “slope”? This chapter answers both with one idea: near aa, a differentiable function looks like a straight line, and f′(a)f'(a) is that line’s slope. That idea is also how derivatives work in many variables (Unit 5), where “slope” is replaced by a linear map from chapter 2.3.

Before you start

Chapter 1.3: limits of functions with ε\varepsilon and δ\delta, continuity, and the extreme value theorem.

Quick checkWhat does lim⁡x→ag(x)=L\lim_{x \to a} g(x) = L ignore?
Quick checkA continuous function on [a,b][a, b] always:

The picture: zoom until it is straight

Zoom in on x2x^2 at any point: by the time you have zoomed a hundredfold, the curve and the dashed tangent line are indistinguishable. The box below the picture shows why in numbers: the tangent’s error, divided by the step hh, shrinks towards 0. Two things to do:

  1. Zoom on a smooth curve. Pick x2x^2, then sin⁡x\sin x, then x3−xx^3 - x. Slide the point aa to a few places and zoom each time. Watch the number “error divided by hh” fall as you zoom. That falling number is what the definition below formalises.
  2. Zoom on the corner. Pick ∣x∣|x|. At its corner, every zoom shows the same V. No line fits it, at any scale.

“Differentiable at aa” means exactly that zooming in at aa produces a straight line.

Where this came from· Fermat's tangents, Newton's fluxions, Cauchy's limits

Pierre de Fermat wanted the highest point of a curve and the tangent at a point. In the 1630s he compared the value of a quantity at xx and at x+ex + e, divided by ee, and then set ee to zero. That is a difference quotient used to find a maximum, and his idea survives as the theorem below that the derivative vanishes at an interior maximum. Isaac Newton (his fluxions date from the mid-1660s) wanted velocities of moving bodies; Gottfried Leibniz, who published first, in 1684, wanted tangents and areas, and gave us the notation dydx\frac{dy}{dx}. Both worked with “infinitely small” increments that nobody could define exactly. Cauchy’s 1823 lectures at the École polytechnique defined the derivative as the limit of the difference quotient, the definition used in this chapter.

Definitions

Definition B

Derivative

Let ff be defined on an interval containing aa. The derivative of ff at aa is

f′(a)=lim⁡h→0f(a+h)−f(a)h,f'(a) = \lim_{h \to 0} \frac{f(a + h) - f(a)}{h},

if this limit exists. The fraction is the difference quotient: the slope of the chord from (a,f(a))(a, f(a)) to (a+h,f(a+h))(a + h, f(a + h)). Here aa is fixed and hh is the variable, so this is a limit of a function of hh as in 1.3. The step hh is never 0 inside the limit, which is why the fraction makes sense.

In one linef′(a)=lim⁡h→0f(a+h)−f(a)hf'(a) = \lim_{h \to 0} \frac{f(a + h) - f(a)}{h}, when the limit exists: the slope of the best straight-line fit to f at a.

Why it existsIt turns 'rate of change' and 'tangent slope' into one exact number, and it is the slope of the unique line that approximates f near a to better than first order.

Definition B

Differentiable

ff is differentiable at aa if f′(a)f'(a) exists. Equivalently, there is a number mm such that

f(a+h)=f(a)+m h+E(h),where E(h)h→0 as h→0,f(a + h) = f(a) + m\,h + E(h), \qquad \text{where } \frac{E(h)}{h} \to 0 \text{ as } h \to 0,

and then m=f′(a)m = f'(a). In words: ff near aa is a straight line of slope mm plus an error that is small even compared with hh.

In one lineff is differentiable at aa if f′(a)f'(a) exists; equivalently, f(a+h)=f(a)+f′(a)h+E(h)f(a + h) = f(a) + f'(a)h + E(h) with E(h)/h→0E(h)/h \to 0.

Why it existsThe second form says f is a line plus an error much smaller than h, which is the zoom picture and the definition that generalises to many variables.

Why· Why the two forms say the same thing

Divide f(a+h)=f(a)+mh+E(h)f(a + h) = f(a) + mh + E(h) by hh: f(a+h)−f(a)h=m+E(h)h\frac{f(a+h) - f(a)}{h} = m + \frac{E(h)}{h}. The left side tends to mm exactly when E(h)h→0\frac{E(h)}h \to 0. The second form is the zoom picture: the error of the line f(a)+mhf(a) + mh shrinks faster than hh, so at fine scales it vanishes from view. It is also the form that works in Rn\mathbb R^n, where you cannot divide by a vector hh but you can still ask that the error be small compared with ∣h∣|h| (Apostol 8.11, chapter 5.3).

Worked example
Find the derivative of f(x)=x2f(x) = x^2 at aa from the definition, in both forms.

Solution.

  1. Difference quotient. (a+h)2−a2h=2ah+h2h=2a+h\frac{(a + h)^2 - a^2}{h} = \frac{2ah + h^2}{h} = 2a + h for h≠0h \ne 0. Expand and cancel. Cancelling hh is allowed because h≠0h \ne 0 inside a limit.
  2. Take the limit. 2a+h→2a2a + h \to 2a as h→0h \to 0. So f′(a)=2af'(a) = 2a. 2a+h2a + h is within ε\varepsilon of 2a2a when ∣h∣<ε|h| < \varepsilon: take δ=ε\delta = \varepsilon.
  3. Linear-approximation form. (a+h)2=a2+2a h+h2(a + h)^2 = a^2 + 2a\,h + h^2, so E(h)=h2E(h) = h^2, and E(h)h=h→0\frac{E(h)}{h} = h \to 0. The same answer, read as ‘line plus small error’.

Answer. f′(a)=2af'(a) = 2a. Near a=1a = 1, x2≈1+2(x−1)x^2 \approx 1 + 2(x - 1), with error (x−1)2(x - 1)^2.

Your answerFor f(x)=x2f(x) = x^2 at a=3a = 3, compute the difference quotient f(3+h)−f(3)h\frac{f(3 + h) - f(3)}{h} with h=0.1h = 0.1.
Worked example
Find the derivative of f(x)=xf(x) = \sqrt x at a>0a > 0 from the definition.

Solution.

  1. Write the difference quotient. a+h−ah\frac{\sqrt{a + h} - \sqrt a}{h}. The definition. Setting h=0h = 0 gives 00\frac00, so we must simplify before taking the limit.
  2. Multiply top and bottom by the conjugate. (a+h−a)(a+h+a)h (a+h+a)=(a+h)−ah (a+h+a)\frac{(\sqrt{a + h} - \sqrt a)(\sqrt{a + h} + \sqrt a)}{h\,(\sqrt{a + h} + \sqrt a)} = \frac{(a + h) - a}{h\,(\sqrt{a + h} + \sqrt a)}. The same rationalising trick you used in JEE. It turns the difference of square roots into hh, which can cancel.
  3. Cancel hh. =1a+h+a= \frac1{\sqrt{a + h} + \sqrt a} for h≠0h \ne 0. Allowed, because inside a limit h≠0h \ne 0.
  4. Take the limit. As h→0h \to 0, a+h→a\sqrt{a + h} \to \sqrt a (continuity of x\sqrt x, 1.3), so the quotient tends to 12a\frac1{2\sqrt a}. The denominator tends to 2a2\sqrt a, which is not 0 because a>0a > 0, so the quotient law applies.

Answer. f′(a)=12af'(a) = \frac1{2\sqrt a}. ■\blacksquare At a=4a = 4 this is 14\frac14, the slope used in the 4.1\sqrt{4.1} estimate below.

Your answerFrom the definition, the difference quotient of f(x)=x3f(x) = x^3 at a=2a = 2 is (2+h)3−8h=12+6h+h2\frac{(2 + h)^3 - 8}{h} = 12 + 6h + h^2. What is f′(2)f'(2)?
Quick checkWhich error E(h)E(h), in f(a+h)=f(a)+mh+E(h)f(a + h) = f(a) + mh + E(h), is small enough for mm to be the derivative?
Worked example
Show f(x)=∣x∣f(x) = |x| is not differentiable at 0.

Solution.

  1. Difference quotient. ∣h∣−0h\frac{|h| - 0}{h} equals 11 for h>0h > 0 and −1-1 for h<0h < 0. ∣h∣=h|h| = h or −h-h depending on the sign.
  2. Use sequences (1.3). Along hn=1nh_n = \frac1n the quotient is 1; along hn=−1nh_n = -\frac1n it is −1-1. A limit would have to equal both. If a limit exists, every sequence hn→0h_n \to 0 gives the same value (the sequential criterion of 1.3, in its limit form).

Answer. No limit, so ∣x∣|x| is not differentiable at 0, although it is continuous there. The zoom picture shows the V that never straightens.

Theorem B Abbott Thm 5.2.3

Differentiable implies continuous

If ff is differentiable at aa, then ff is continuous at aa. (The converse fails: ∣x∣|x|.)

In one lineIf ff is differentiable at aa, it is continuous at aa.

Why it is truef(a + h) − f(a) = h · (difference quotient), and h → 0 while the quotient stays near f'(a).

ProofAbbott 5.2.3
The idea: Write f(a + h) − f(a) as h times the difference quotient. The first factor tends to 0, the second to f'(a), so the product tends to 0.
For h≠0h \ne 0: f(a+h)−f(a)=h⋅f(a+h)−f(a)hf(a + h) - f(a) = h \cdot \dfrac{f(a + h) - f(a)}{h}.
Multiply and divide by h≠0h \ne 0.
As h→0h \to 0 the right side tends to 0⋅f′(a)=00 \cdot f'(a) = 0.
Product of limits (the limit laws of 1.2 carry over to function limits through the sequential criterion of 1.3).
So f(a+h)→f(a)f(a + h) \to f(a): ff is continuous at aa. ■\blacksquare
That is the definition of continuity at aa, with x=a+hx = a + h.
Quick checkWhich of these is true?

The rules, from the definition

Theorem B Spivak ch. 10

Chain rule

If gg is differentiable at aa and ff is differentiable at g(a)g(a), then f∘gf \circ g is differentiable at aa with (f∘g)′(a)=f′(g(a)) g′(a)(f \circ g)'(a) = f'(g(a))\, g'(a).

In one lineIf gg is differentiable at aa and ff at g(a)g(a), then (f∘g)′(a)=f′(g(a)) g′(a)(f \circ g)'(a) = f'(g(a))\,g'(a).

Why it is trueApproximating each map by a line, composing two lines multiplies their slopes.

Why· The idea in one line, and why the naive proof fails

Linear approximations compose: if gg multiplies small changes by g′(a)g'(a) and ff multiplies small changes by f′(g(a))f'(g(a)), doing one after the other multiplies by the product. The tempting proof writes f(g(a+h))−f(g(a))h=f(g(a+h))−f(g(a))g(a+h)−g(a)⋅g(a+h)−g(a)h\frac{f(g(a+h)) - f(g(a))}{h} = \frac{f(g(a+h)) - f(g(a))}{g(a+h) - g(a)} \cdot \frac{g(a+h) - g(a)}{h}, but g(a+h)−g(a)g(a + h) - g(a) can be 0 for small hh (for example if gg is constant), and then the first fraction is undefined. The proof below avoids dividing by it.

ProofSpivak ch. 10, Abbott 5.2.5
The idea: Define a function φ(k) that equals the difference quotient of f at g(a) when k ≠ 0 and equals f'(g(a)) when k = 0. Then f(g(a) + k) − f(g(a)) = φ(k)·k for EVERY k, including 0, and φ is continuous at 0. Substitute k = g(a + h) − g(a).
Let b=g(a)b = g(a), and define φ(k)=f(b+k)−f(b)k\varphi(k) = \dfrac{f(b + k) - f(b)}{k} for k≠0k \ne 0, and φ(0)=f′(b)\varphi(0) = f'(b).
Abbreviate. b=g(a)b = g(a).
φ\varphi is continuous at 0.
Differentiability of ff at bb says exactly that the difference quotient tends to f′(b)=φ(0)f'(b) = \varphi(0).This patch at k=0k = 0 is the whole trick.
For every kk: f(b+k)−f(b)=φ(k) kf(b + k) - f(b) = \varphi(k)\, k.
For k≠0k \ne 0 multiply the definition of φ\varphi by kk; for k=0k = 0 both sides are 0.
f(g(a+h))−f(g(a))h=φ(g(a+h)−g(a))⋅g(a+h)−g(a)h\dfrac{f(g(a + h)) - f(g(a))}{h} = \varphi\big(g(a + h) - g(a)\big) \cdot \dfrac{g(a + h) - g(a)}{h}.
Substitute k=g(a+h)−g(a)k = g(a + h) - g(a), so b+k=g(a+h)b + k = g(a + h), and divide by h≠0h \ne 0.
As h→0h \to 0 the right side tends to φ(0)⋅g′(a)=f′(g(a)) g′(a)\varphi(0) \cdot g'(a) = f'(g(a))\,g'(a). ■\blacksquare
gg is continuous at aa (differentiable implies continuous), so g(a+h)−g(a)→0g(a + h) - g(a) \to 0; φ\varphi is continuous at 0; the second factor tends to g′(a)g'(a).
Worked example
See the patch φ\varphi at work: f(u)=u2f(u) = u^2 composed with g(x)=x3g(x) = x^3 at a=1a = 1.

Solution.

  1. Set the pieces. b=g(1)=1b = g(1) = 1, f′(b)=2f'(b) = 2, g′(1)=3g'(1) = 3. The chain rule predicts (f∘g)′(1)=f′(1) g′(1)=2×3=6(f \circ g)'(1) = f'(1)\,g'(1) = 2 \times 3 = 6.
  2. Build φ\varphi. For k≠0k \ne 0: φ(k)=(1+k)2−1k=2k+k2k=2+k\varphi(k) = \frac{(1 + k)^2 - 1}{k} = \frac{2k + k^2}{k} = 2 + k. At k=0k = 0 define φ(0)=f′(1)=2\varphi(0) = f'(1) = 2. The formula 2+k2 + k already gives 2 at k=0k = 0, so the patch costs nothing here. For a general ff the quotient is undefined at k=0k = 0 and the patch is needed.
  3. Check the key identity. f(1+k)−f(1)=(1+k)2−1=(2+k) k=φ(k) kf(1 + k) - f(1) = (1 + k)^2 - 1 = (2 + k)\,k = \varphi(k)\,k, true for every kk including k=0k = 0. This is the line that avoids dividing by g(a+h)−g(a)g(a + h) - g(a).
  4. Substitute k=g(1+h)−g(1)=(1+h)3−1=3h+3h2+h3k = g(1 + h) - g(1) = (1 + h)^3 - 1 = 3h + 3h^2 + h^3. Then f(g(1+h))−f(g(1))h=φ(k)⋅kh=(2+k)(3+3h+h2)\frac{f(g(1 + h)) - f(g(1))}{h} = \varphi(k)\cdot\frac{k}{h} = (2 + k)(3 + 3h + h^2). Here kh=g(1+h)−g(1)h\frac kh = \frac{g(1 + h) - g(1)}{h}, the difference quotient of gg.
  5. Let h→0h \to 0. Then k→0k \to 0, so 2+k→22 + k \to 2, and 3+3h+h2→33 + 3h + h^2 \to 3. The product tends to 66. Matches the prediction. Direct check: f(g(x))=x6f(g(x)) = x^6 has derivative 6x5=66x^5 = 6 at 1.

Answer. (f∘g)′(1)=6=f′(g(1)) g′(1)(f \circ g)'(1) = 6 = f'(g(1))\,g'(1). ■\blacksquare

Proof workshopPick the reason for each line of the chain rule proof

Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.

  1. Let b=g(a)b = g(a) and define φ(k)=f(b+k)−f(b)k\varphi(k) = \frac{f(b + k) - f(b)}{k} for k≠0k \ne 0, and φ(0)=f′(b)\varphi(0) = f'(b).
  2. φ\varphi is continuous at 0.
  3. For every kk, f(b+k)−f(b)=φ(k) kf(b + k) - f(b) = \varphi(k)\,k.
  4. Put k=g(a+h)−g(a)k = g(a + h) - g(a) and divide by h≠0h \ne 0: f(g(a+h))−f(g(a))h=φ(g(a+h)−g(a)) g(a+h)−g(a)h\frac{f(g(a+h)) - f(g(a))}{h} = \varphi\big(g(a+h) - g(a)\big)\,\frac{g(a+h) - g(a)}{h}.
  5. As h→0h \to 0, g(a+h)−g(a)→0g(a + h) - g(a) \to 0.
  6. So the right side tends to φ(0) g′(a)=f′(g(a)) g′(a)\varphi(0)\,g'(a) = f'(g(a))\,g'(a).
Quick checkA student proves the chain rule by writing f(g(a+h))−f(g(a))h=f(g(a+h))−f(g(a))g(a+h)−g(a)⋅g(a+h)−g(a)h\frac{f(g(a+h)) - f(g(a))}{h} = \frac{f(g(a+h)) - f(g(a))}{g(a+h) - g(a)}\cdot\frac{g(a+h) - g(a)}{h}. What is wrong?

The sum, product and quotient rules are proved the same way. The product rule uses the add-and-subtract trick of 1.2: f(a+h)g(a+h)−f(a)g(a)=f(a+h)(g(a+h)−g(a))+g(a)(f(a+h)−f(a))f(a+h)g(a+h) - f(a)g(a) = f(a+h)\big(g(a+h) - g(a)\big) + g(a)\big(f(a+h) - f(a)\big).

Worked example Abbott Thm 5.2.4
Prove the product rule: (fg)′(a)=f′(a) g(a)+f(a) g′(a)(fg)'(a) = f'(a)\,g(a) + f(a)\,g'(a).

Solution.

  1. Write the difference quotient of fgfg. f(a+h)g(a+h)−f(a)g(a)h\frac{f(a + h)g(a + h) - f(a)g(a)}{h}. The definition of (fg)′(a)(fg)'(a).
  2. Add and subtract f(a+h)g(a)f(a + h)g(a) in the numerator. The numerator becomes f(a+h)(g(a+h)−g(a))+g(a)(f(a+h)−f(a))f(a + h)\big(g(a + h) - g(a)\big) + g(a)\big(f(a + h) - f(a)\big). The aim is to produce difference quotients of ff and of gg separately. This is the same trick as the product law for sequences in 1.2: change one factor at a time.
  3. Split the quotient. f(a+h)⋅g(a+h)−g(a)h+g(a)⋅f(a+h)−f(a)hf(a + h)\cdot\frac{g(a + h) - g(a)}{h} + g(a)\cdot\frac{f(a + h) - f(a)}{h}. Divide each part by hh.
  4. Take limits. The two quotients tend to g′(a)g'(a) and f′(a)f'(a). Also f(a+h)→f(a)f(a + h) \to f(a). ff is differentiable at aa, hence continuous there, by the theorem above.
  5. Combine. The sum tends to f(a) g′(a)+g(a) f′(a)f(a)\,g'(a) + g(a)\,f'(a). Sum and product laws for limits.

Answer. (fg)′(a)=f′(a) g(a)+f(a) g′(a)(fg)'(a) = f'(a)\,g(a) + f(a)\,g'(a). ■\blacksquare

The mean value theorem

Theorem B Abbott Thm 5.2.6 (Fermat)

Interior extremum theorem

If ff is differentiable at an interior point cc of an interval and f(c)≥f(x)f(c) \ge f(x) for all xx in the interval (or ≤\le), then f′(c)=0f'(c) = 0.

In one lineIf f has a maximum or minimum at an interior point c and is differentiable there, then f'(c) = 0.

Why it is trueAt a maximum, chords to the right slope down and chords to the left slope up, so the limit is squeezed to 0.

ProofAbbott 5.2.6
The idea: At a maximum, f(c + h) − f(c) ≤ 0. Dividing by h > 0 gives quotients ≤ 0; dividing by h < 0 gives quotients ≥ 0. The common limit f'(c) is both ≤ 0 and ≥ 0.
For small hh: f(c+h)−f(c)≤0f(c + h) - f(c) \le 0.
cc is a maximum, and c+hc + h is in the interval for small ∣h∣|h| because cc is interior.
For h>0h > 0 the difference quotient is ≤0\le 0; for h<0h < 0 it is ≥0\ge 0.
Dividing by a positive hh keeps the sign; by a negative hh flips it.
So f′(c)≤0f'(c) \le 0 and f′(c)≥0f'(c) \ge 0, hence f′(c)=0f'(c) = 0. ■\blacksquare
Limits preserve non-strict inequalities (take limits along hn=±1nh_n = \pm\frac1n).
Theorem B Abbott Thm 5.3.2

Mean value theorem

Let ff be continuous on [a,b][a, b] and differentiable on (a,b)(a, b). Then there is c∈(a,b)c \in (a, b) with

f′(c)=f(b)−f(a)b−a.f'(c) = \frac{f(b) - f(a)}{b - a}.

The special case f(a)=f(b)f(a) = f(b), where f′(c)=0f'(c) = 0, is Rolle’s theorem.

In one lineIf f is continuous on [a, b] and differentiable on (a, b), some c in (a, b) has f'(c) = (f(b) − f(a))/(b − a).

Why it is trueTilt the graph so the chord is level; the tilted function has a maximum or minimum inside, where its derivative is 0.

Why· The picture behind the proof

The chord from (a,f(a))(a, f(a)) to (b,f(b))(b, f(b)) has slope f(b)−f(a)b−a\frac{f(b) - f(a)}{b - a}. Subtract the chord from the graph: what is left, g(x)=f(x)−(chord at x)g(x) = f(x) - (\text{chord at } x), starts and ends at 0. A continuous function on [a,b][a, b] has a maximum and a minimum (1.3); if gg is not constant, one of them is inside, where g′=0g' = 0 (Fermat), meaning f′f' equals the chord’s slope. Picture driving 100 km in one hour: at some instant the speedometer read exactly 100 km/h.

ProofAbbott 5.3.1 to 5.3.2
The idea: Subtract the chord: g(x) = f(x) − f(a) − m(x − a) with m the chord slope. Then g(a) = g(b) = 0, the extreme value theorem gives an extremum, and Fermat makes g' vanish there.
Let m=f(b)−f(a)b−am = \frac{f(b) - f(a)}{b - a} and g(x)=f(x)−f(a)−m(x−a)g(x) = f(x) - f(a) - m(x - a).
Name the chord slope.
g(a)=0g(a) = 0 and g(b)=f(b)−f(a)−m(b−a)=0g(b) = f(b) - f(a) - m(b - a) = 0.
Substitute x=ax = a and x=bx = b.
gg attains a maximum and a minimum on [a,b][a, b].
gg is continuous on [a,b][a, b]; extreme value theorem (1.3).
If gg is constant, any c∈(a,b)c \in (a, b) has g′(c)=0g'(c) = 0.
If both occur at the endpoints, max = min = 0 and gg is constant 0, so g′=0g' = 0 everywhere inside.
Otherwise an extremum occurs at some interior cc, and g′(c)=0g'(c) = 0.
Otherwise the max or the min is non-zero, so it is not at an endpoint (where g=0g = 0); interior extremum theorem.
So f′(c)=mf'(c) = m. ■\blacksquare
g′(x)=f′(x)−mg'(x) = f'(x) - m.
Proof workshopRebuild the mean value theorem proof

Tap the lines in the order a proof would write them. Each line can only use what is already above it.

    Quick checkf(x)=x3f(x) = x^3 has f′(0)=0f'(0) = 0. Does ff have a maximum or minimum at 0?
    Worked example
    Find the number cc promised by the mean value theorem for f(x)=x3f(x) = x^3 on [0,2][0, 2].

    Solution.

    1. Check the hypotheses. x3x^3 is a polynomial, so it is continuous on [0,2][0, 2] and differentiable on (0,2)(0, 2). The theorem applies only when both hold.
    2. Chord slope. f(2)−f(0)2−0=8−02=4\frac{f(2) - f(0)}{2 - 0} = \frac{8 - 0}{2} = 4. This is the average rate of change over the interval.
    3. Solve f′(c)=4f'(c) = 4. 3c2=43c^2 = 4, so c=±23c = \pm\frac2{\sqrt3}. The derivative is 3x23x^2. We set it equal to the chord slope.
    4. Keep the root in the open interval. 23≈1.155∈(0,2)\frac2{\sqrt3} \approx 1.155 \in (0, 2); the root −1.155-1.155 is outside. The theorem promises a cc inside (a,b)(a, b) only.

    Answer. c=23≈1.155c = \frac2{\sqrt3} \approx 1.155. ■\blacksquare At that instant the tangent is parallel to the chord.

    Your answerFor f(x)=x3f(x) = x^3 on [0,1][0, 1], the mean value theorem gives c∈(0,1)c \in (0, 1) with f′(c)=f'(c) = the chord slope. Find cc.
    Worked example
    Use the mean value theorem to prove ln⁡(1+x)≤x\ln(1 + x) \le x for all x>0x > 0.

    Solution.

    1. Pick the function and interval. f(t)=ln⁡(1+t)f(t) = \ln(1 + t) on [0,x][0, x]. The inequality compares f(x)−f(0)f(x) - f(0) with x−0x - 0, which is a chord, so this is a job for the mean value theorem.
    2. Apply the theorem. ff is continuous on [0,x][0, x] and differentiable on (0,x)(0, x), so ln⁡(1+x)−ln⁡1=f′(c) (x−0)\ln(1 + x) - \ln 1 = f'(c)\,(x - 0) for some c∈(0,x)c \in (0, x). Here f′(t)=11+tf'(t) = \frac1{1 + t}.
    3. Bound the derivative. f′(c)=11+c<1f'(c) = \frac1{1 + c} < 1 since c>0c > 0. We cannot find cc, but we do not need it: any cc in the interval gives a derivative below 1.
    4. Conclude. ln⁡(1+x)=f′(c) x<x\ln(1 + x) = f'(c)\,x < x. Multiply the inequality f′(c)<1f'(c) < 1 by x>0x > 0.

    Answer. ln⁡(1+x)<x\ln(1 + x) < x for x>0x > 0 (so certainly ≤\le). ■\blacksquare This is the standard way to use the theorem: bound f′f' on the whole interval.

    Corollary B Abbott Cor 5.3.3 and 5.3.4

    Zero derivative means constant

    If f′(x)=0f'(x) = 0 for all xx in an interval, then ff is constant on it. Hence two functions with the same derivative on an interval differ by a constant.

    In one lineIf f′(x)=0f'(x) = 0 for every x in an interval, f is constant there.

    Why it is trueBetween any two points, the mean value theorem finds a point where f' equals the chord slope; that slope must be 0.

    ProofAbbott 5.3.4
    The idea: Apply the mean value theorem on [x, y]: (f(y) − f(x))/(y − x) = f'(c) = 0.
    For x<yx < y in the interval, f(y)−f(x)=f′(c)(y−x)f(y) - f(x) = f'(c)(y - x) for some c∈(x,y)c \in (x, y).
    Any two points of the interval; MVT on [x,y][x, y].
    So f(y)=f(x)f(y) = f(x). Since x,yx, y were arbitrary, ff is constant. For two functions, apply this to their difference. ■\blacksquare
    f′(c)=0f'(c) = 0.
    Same idea elsewhere· This is the '+ C' of chapter 2.3

    Chapter 2.3 explained "+ C+\,C" by saying the null space of differentiation is the constant functions. That claim is this corollary: f′=0f' = 0 forces ff constant. It needs the mean value theorem, so it needs completeness. On the rationals, a function can have derivative 0 everywhere without being constant.

    Quick checkWhy does the mean value theorem need ff continuous on the CLOSED interval [a,b][a, b]?

    Taylor’s theorem

    The tangent line is the best degree-1 approximation. The best degree-nn approximation matches nn derivatives, and Taylor’s theorem says exactly how good it is.

    Definition B

    Taylor polynomial

    If ff has nn derivatives at aa, its Taylor polynomial of degree nn at aa is

    Tn(x)=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2+⋯+f(n)(a)n!(x−a)n.T_n(x) = f(a) + f'(a)(x - a) + \frac{f''(a)}{2!}(x - a)^2 + \dots + \frac{f^{(n)}(a)}{n!}(x - a)^n.

    It is the only polynomial of degree at most nn whose value and first nn derivatives at aa agree with ff‘s. (Here k!=1⋅2⋯kk! = 1 \cdot 2 \cdots k, the product of the first kk whole numbers, and 0!=10! = 1. The k!k! in the denominator is exactly what makes the kk-th derivative of (x−a)kk!\frac{(x - a)^k}{k!} equal to 1.)

    In one lineTn(x)=∑k=0nf(k)(a)k!(x−a)kT_n(x) = \sum_{k=0}^n \frac{f^{(k)}(a)}{k!}(x - a)^k: the polynomial of degree n with the same value and first n derivatives as f at a.

    Why it existsIt is the best polynomial approximation near a, and it is how calculators compute sin, exp and log.

    Worked example
    Find the Taylor polynomial T3T_3 of f(x)=ln⁡(1+x)f(x) = \ln(1 + x) at a=0a = 0.

    Solution.

    1. List the derivatives. f′(x)=11+xf'(x) = \frac1{1 + x}, f′′(x)=−1(1+x)2f''(x) = -\frac1{(1 + x)^2}, f′′′(x)=2(1+x)3f'''(x) = \frac2{(1 + x)^3}. T3T_3 needs ff and its first three derivatives.
    2. Evaluate at a=0a = 0. f(0)=0f(0) = 0, f′(0)=1f'(0) = 1, f′′(0)=−1f''(0) = -1, f′′′(0)=2f'''(0) = 2. The formula uses the derivatives at the centre aa.
    3. Divide by factorials. The coefficients are f(k)(0)k!\frac{f^{(k)}(0)}{k!}: 00, 11, −12-\frac12, 26=13\frac26 = \frac13. Definition of the Taylor polynomial.
    4. Assemble. T3(x)=x−x22+x33T_3(x) = x - \frac{x^2}2 + \frac{x^3}3. Sum of coefficient times (x−0)k(x - 0)^k.

    Answer. T3(x)=x−x22+x33T_3(x) = x - \frac{x^2}{2} + \frac{x^3}{3}. ■\blacksquare Check: ln⁡1.1=0.09531\ln 1.1 = 0.09531 and T3(0.1)=0.1−0.005+0.000333=0.09533T_3(0.1) = 0.1 - 0.005 + 0.000333 = 0.09533.

    Your answerThe Taylor polynomial of cos⁡x\cos x at 0 begins 1−x22+…1 - \frac{x^2}{2} + \dots. What is the coefficient of x4x^4?
    Theorem B Abbott Thm 6.6.3, Spivak ch. 20

    Taylor's theorem with Lagrange remainder

    If ff has n+1n + 1 derivatives on an interval containing aa and xx, then for some cc between aa and xx:

    f(x)=Tn(x)+f(n+1)(c)(n+1)!(x−a)n+1.f(x) = T_n(x) + \frac{f^{(n+1)}(c)}{(n + 1)!}(x - a)^{n+1}.

    In one lineIf f has n + 1 derivatives, f(x) = T_n(x) + f^{(n+1)}(c)(x − a)^{n+1}/(n+1)! for some c between a and x.

    Why it is trueApply Rolle's theorem n + 1 times to the error, which vanishes to order n + 1 at a.

    ProofSpivak ch. 20
    The idea: Fix x. Choose the constant M so that F(t) = f(t) − T_n(t) − M(t − a)^{n+1} vanishes at t = x. F and its first n derivatives vanish at a. Rolle's theorem, applied n + 1 times, finds a point c where F^{(n+1)}(c) = 0, and that equation says M = f^{(n+1)}(c)/(n+1)!.
    Let F(t)=f(t)−Tn(t)−M(t−a)n+1F(t) = f(t) - T_n(t) - M(t - a)^{n+1}, with MM chosen so that F(x)=0F(x) = 0.
    Fix x≠ax \ne a and choose MM to make F(x)=0F(x) = 0 (possible since (x−a)n+1≠0(x - a)^{n+1} \ne 0).
    F(a)=F′(a)=⋯=F(n)(a)=0F(a) = F'(a) = \dots = F^{(n)}(a) = 0.
    TnT_n was built to match ff's first nn derivatives at aa, and every derivative of (t−a)n+1(t - a)^{n+1} below order n+1n + 1 vanishes at aa.
    There is c1c_1 between aa and xx with F′(c1)=0F'(c_1) = 0.
    Rolle on [a,x][a, x]: F(a)=F(x)=0F(a) = F(x) = 0.
    Continuing, there are c2,…,cn+1c_2, \dots, c_{n+1}, each between aa and the previous one, with F(k)(ck)=0F^{(k)}(c_k) = 0.
    Rolle again on [a,c1][a, c_1] for F′F', which vanishes at both ends; repeat.
    0=F(n+1)(cn+1)=f(n+1)(cn+1)−M(n+1)!0 = F^{(n+1)}(c_{n+1}) = f^{(n+1)}(c_{n+1}) - M(n + 1)!.
    TnT_n has degree nn, so Tn(n+1)=0T_n^{(n+1)} = 0, and the (n+1)(n+1)-th derivative of (t−a)n+1(t - a)^{n+1} is (n+1)!(n + 1)!.
    M=f(n+1)(c)(n+1)!M = \frac{f^{(n+1)}(c)}{(n+1)!}, and F(x)=0F(x) = 0 is exactly the formula. ■\blacksquare
    Solve for MM, set c=cn+1c = c_{n+1}, and use F(x)=0F(x) = 0.
    Worked example
    Which degree nn makes the Taylor polynomial of exe^x at 0 give ee to within 10−610^{-6}?

    Solution.

    1. Write the remainder. For f=exf = e^x, a=0a = 0, x=1x = 1: e=Tn(1)+ec(n+1)!e = T_n(1) + \frac{e^c}{(n + 1)!} for some c∈(0,1)c \in (0, 1). Every derivative of exe^x is exe^x.
    2. Bound it. ec<e<3e^c < e < 3, so the error is less than 3(n+1)!\frac{3}{(n + 1)!}. Over-estimate freely, as in 1.2.
    3. Solve. 3(n+1)!<10−6\frac{3}{(n + 1)!} < 10^{-6} needs (n+1)!>3×106(n + 1)! > 3 \times 10^6. Since 10!=3628800>3×10610! = 3628800 > 3 \times 10^6 and 9!=362880<3×1069! = 362880 < 3 \times 10^6, the smallest nn with n+1≥10n + 1 \ge 10 is n=9n = 9. Factorials grow fast; check a few values. This bound is sufficient, so a smaller nn might also work, but this one is guaranteed.

    Answer. T9(1)=1+1+12+⋯+19!≈2.7182815T_9(1) = 1 + 1 + \frac12 + \dots + \frac1{9!} \approx 2.7182815, within 10−610^{-6} of e=2.7182818…e = 2.7182818\dots (the true error is about 3×10−73 \times 10^{-7}).

    Your answerUsing the same bound 3(n+1)!\frac{3}{(n+1)!}, what is the smallest degree nn that guarantees an error below 10−810^{-8}?
    Worked example
    Show ∣sin⁡x−x∣≤∣x∣36|\sin x - x| \le \frac{|x|^3}{6} for all xx, and use it to bound the error of sin⁡0.1≈0.1\sin 0.1 \approx 0.1.

    Solution.

    1. Taylor at 0 with n=2n = 2. T2(x)=0+x+0⋅x2=xT_2(x) = 0 + x + 0 \cdot x^2 = x, since sin⁡0=0\sin 0 = 0, cos⁡0=1\cos 0 = 1, −sin⁡0=0-\sin 0 = 0. The degree-2 polynomial happens to be xx.
    2. Remainder. sin⁡x−x=−cos⁡c3!x3\sin x - x = \frac{-\cos c}{3!}x^3. The third derivative of sin⁡\sin is −cos⁡-\cos.
    3. Bound. ∣cos⁡c∣≤1|\cos c| \le 1, so ∣sin⁡x−x∣≤∣x∣36|\sin x - x| \le \frac{|x|^3}{6}. For x=0.1x = 0.1: error ≤0.0016≈0.000167\le \frac{0.001}{6} \approx 0.000167. Actual error: 0.1−sin⁡0.1≈0.0001670.1 - \sin 0.1 \approx 0.000167, very close to the bound.

    Answer. The small-angle approximation sin⁡x≈x\sin x \approx x used in physics (pendulums, optics) has error at most ∣x∣36\frac{|x|^3}6.

    Your answerUse ∣sin⁡x−x∣≤∣x∣36|\sin x - x| \le \frac{|x|^3}{6} at x=0.5x = 0.5. What bound on the error of sin⁡0.5≈0.5\sin 0.5 \approx 0.5 do you get? (Give a fraction.)
    Worked example
    Estimate 26\sqrt{26} with the tangent line of x\sqrt x at 25, and bound the error.

    Solution.

    1. Tangent line. f(x)=xf(x) = \sqrt x, f(25)=5f(25) = 5, f′(x)=12xf'(x) = \frac1{2\sqrt x}, so f′(25)=110f'(25) = \frac1{10}. Then 26≈5+110(26−25)=5.1\sqrt{26} \approx 5 + \frac1{10}(26 - 25) = 5.1. This is T1T_1: the best straight-line estimate near 25.
    2. Remainder formula, n=1n = 1. 26−5.1=f′′(c)2!(26−25)2\sqrt{26} - 5.1 = \frac{f''(c)}{2!}(26 - 25)^2 for some c∈(25,26)c \in (25, 26). Taylor’s theorem with Lagrange remainder. We cannot find cc, so we bound the formula for every possible cc.
    3. Bound f′′f''. f′′(x)=−14x−3/2f''(x) = -\frac14 x^{-3/2}. For c≥25c \ge 25, c3/2≥125c^{3/2} \ge 125, so ∣f′′(c)∣≤14⋅125=1500|f''(c)| \le \frac1{4 \cdot 125} = \frac1{500}. x−3/2x^{-3/2} gets smaller as xx grows, so its largest value on (25,26)(25, 26) is at the left end.
    4. Error bound. ∣26−5.1∣≤12⋅1500⋅1=0.001|\sqrt{26} - 5.1| \le \frac12 \cdot \frac1{500} \cdot 1 = 0.001. Substitute into the remainder.

    Answer. 26≈5.1\sqrt{26} \approx 5.1 with error at most 0.0010.001. ■\blacksquare The true value is 5.099025.09902, error 0.000980.00098.

    Quick checkThe Taylor remainder says the error of TnT_n is f(n+1)(c)(n+1)!(x−a)n+1\frac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}. What is cc?

    Where it is used

    Used inside maths· Inside maths: optimisation and Unit 5

    Fermat’s theorem is why you set f′=0f' = 0 to find maxima; the second-derivative test is Taylor’s theorem with n=1n = 1. In several variables (5.6) the second-derivative test becomes “look at the eigenvalues of the Hessian matrix”, combining this chapter with 2.8.

    Used in the real world· Physics and computing: approximations you rely on daily

    The pendulum equation θ′′=−gLsin⁡θ\theta'' = -\frac gL \sin\theta is replaced by θ′′=−gLθ\theta'' = -\frac gL \theta, using sin⁡θ≈θ\sin\theta \approx \theta with the Taylor error bound above; for a 5° swing (0.0870.087 rad) the relative error is under 0.13%. Floating-point libraries compute sin⁡\sin, exp⁡\exp and log⁡\log with polynomial approximations derived from Taylor’s theorem and its refinements, choosing the degree from exactly the kind of remainder bound used in the ee example.

    Traps

    Watch out· Continuous does not mean differentiable

    ∣x∣|x| is continuous at 0 and not differentiable there. Weierstrass’s function is continuous everywhere and differentiable nowhere.

    Watch out· f' = 0 at a point does not mean a maximum

    x3x^3 has derivative 0 at 0 and no maximum or minimum there. Fermat’s theorem is “max implies f′=0f' = 0”, not the converse (0.1).

    Watch out· The mean value theorem's c is not computable from the theorem

    It guarantees a point exists. To use it, bound f′f' on the whole interval rather than trying to find cc.

    Problems

    check

    From the definition, find f′(a)f'(a) for f(x)=3x+7f(x) = 3x + 7.

    Solution

    3(a+h)+7−3a−7h=3\frac{3(a + h) + 7 - 3a - 7}{h} = 3, so f′(a)=3f'(a) = 3.

    check

    Verify the mean value theorem for f(x)=x2f(x) = x^2 on [1,3][1, 3]: find cc.

    Solution

    Chord slope 9−12=4\frac{9 - 1}{2} = 4; f′(c)=2c=4f'(c) = 2c = 4 gives c=2∈(1,3)c = 2 \in (1, 3).

    check

    Write the Taylor polynomial T3T_3 of exe^x at 0.

    Solution

    1+x+x22+x361 + x + \frac{x^2}{2} + \frac{x^3}{6}.

    use

    From the definition, prove f(x)=1xf(x) = \frac1x has f′(a)=−1a2f'(a) = -\frac1{a^2} for a≠0a \ne 0.

    Solution

    1a+h−1ah=a−(a+h)h a(a+h)=−1a(a+h)→−1a2\frac{\frac1{a+h} - \frac1a}{h} = \frac{a - (a + h)}{h\,a(a + h)} = \frac{-1}{a(a + h)} \to -\frac1{a^2}, using continuity of 1a(a+h)\frac1{a(a + h)} in hh at 0 (1.3) for a≠0a \ne 0.

    use

    Use the mean value theorem to prove ∣sin⁡x−sin⁡y∣≤∣x−y∣|\sin x - \sin y| \le |x - y| for all x,yx, y.

    Solution

    By the MVT, sin⁡x−sin⁡y=cos⁡c (x−y)\sin x - \sin y = \cos c\,(x - y) for some cc; since ∣cos⁡c∣≤1|\cos c| \le 1, ∣sin⁡x−sin⁡y∣≤∣x−y∣|\sin x - \sin y| \le |x - y|. (So sin⁡\sin is uniformly continuous, with δ=ε\delta = \varepsilon.)

    use

    Estimate 4.1\sqrt{4.1} with the tangent line of x\sqrt x at 4, and bound the error with Taylor’s theorem.

    Solution

    f(4)=2f(4) = 2, f′(4)=14f'(4) = \frac14, so 4.1≈2+0.14=2.025\sqrt{4.1} \approx 2 + \frac{0.1}4 = 2.025. Remainder: f′′(c)2(0.1)2\frac{f''(c)}{2}(0.1)^2 with f′′(c)=−14c−3/2f''(c) = -\frac14 c^{-3/2}, c∈(4,4.1)c \in (4, 4.1); ∣f′′(c)∣≤14⋅18=132|f''(c)| \le \frac14 \cdot \frac18 = \frac1{32}. Error ≤164(0.01)≈0.000156\le \frac1{64}(0.01) \approx 0.000156. (True: 4.1=2.024846\sqrt{4.1} = 2.024846, error 0.0001540.000154.)

    proveAbbott Thm 5.2.4 (quotient rule)

    Prove the quotient rule: if ff and gg are differentiable at aa and g(a)≠0g(a) \ne 0, then (fg)′(a)=f′(a)g(a)−f(a)g′(a)g(a)2\left(\frac fg\right)'(a) = \frac{f'(a)g(a) - f(a)g'(a)}{g(a)^2}. You may use the product rule (worked above), the chain rule, and the result (1x)′=−1x2\left(\frac1x\right)' = -\frac1{x^2} from the previous problem.

    Solution

    Let r(u)=1ur(u) = \frac1u, so 1g=r∘g\frac1g = r \circ g. Since gg is differentiable at aa, it is continuous there, so g≠0g \ne 0 near aa and r∘gr \circ g is defined near aa. The chain rule with r′(u)=−1u2r'(u) = -\frac1{u^2} gives (1g)′(a)=−g′(a)g(a)2\left(\frac1g\right)'(a) = -\frac{g'(a)}{g(a)^2}. Now write fg=f⋅1g\frac fg = f \cdot \frac1g and use the product rule: (fg)′(a)=f′(a)1g(a)+f(a)(−g′(a)g(a)2)=f′(a)g(a)−f(a)g′(a)g(a)2\left(\frac fg\right)'(a) = f'(a)\frac1{g(a)} + f(a)\left(-\frac{g'(a)}{g(a)^2}\right) = \frac{f'(a)g(a) - f(a)g'(a)}{g(a)^2}.

    prove

    Prove: if f′(x)>0f'(x) > 0 for all xx in an interval, then ff is strictly increasing there.

    Solution

    For x<yx < y, the MVT gives f(y)−f(x)=f′(c)(y−x)>0f(y) - f(x) = f'(c)(y - x) > 0, since both factors are positive.

    prove

    Prove ex≥1+xe^x \ge 1 + x for all real xx, using Taylor’s theorem.

    Solution

    ex=1+x+ec2x2e^x = 1 + x + \frac{e^c}{2}x^2 for some cc between 0 and xx. The last term is ≥0\ge 0, so ex≥1+xe^x \ge 1 + x.

    stretchAbbott Exercise 5.2.10 style

    Let f(x)=x2sin⁡(1/x)f(x) = x^2 \sin(1/x) for x≠0x \ne 0 and f(0)=0f(0) = 0. Show ff is differentiable at 0 with f′(0)=0f'(0) = 0, but f′f' is not continuous at 0.

    Solution

    ∣f(h)−0h∣=∣hsin⁡(1/h)∣≤∣h∣→0\left|\frac{f(h) - 0}{h}\right| = |h \sin(1/h)| \le |h| \to 0, so f′(0)=0f'(0) = 0. For x≠0x \ne 0: f′(x)=2xsin⁡(1/x)−cos⁡(1/x)f'(x) = 2x\sin(1/x) - \cos(1/x). Along xn=12πn→0x_n = \frac1{2\pi n} \to 0, f′(xn)=−1f'(x_n) = -1, not tending to f′(0)=0f'(0) = 0. So f′f' exists everywhere but is discontinuous at 0.

    stretch

    L’Hospital’s rule (one case). Suppose f(a)=g(a)=0f(a) = g(a) = 0, f,gf, g differentiable near aa, and g′(a)≠0g'(a) \ne 0. Prove lim⁡x→af(x)g(x)=f′(a)g′(a)\lim_{x \to a} \frac{f(x)}{g(x)} = \frac{f'(a)}{g'(a)}.

    Solution

    f(x)g(x)=f(x)−f(a)g(x)−g(a)=f(x)−f(a)x−ag(x)−g(a)x−a\frac{f(x)}{g(x)} = \frac{f(x) - f(a)}{g(x) - g(a)} = \frac{\frac{f(x) - f(a)}{x - a}}{\frac{g(x) - g(a)}{x - a}}. The numerator tends to f′(a)f'(a), the denominator to g′(a)≠0g'(a) \ne 0, so the quotient tends to f′(a)g′(a)\frac{f'(a)}{g'(a)} (quotient law). (The general version with limits of f′g′\frac{f'}{g'} uses the Cauchy mean value theorem.)

    Summary

    • f′(a)=lim⁡h→0f(a+h)−f(a)hf'(a) = \lim_{h \to 0} \frac{f(a + h) - f(a)}{h}. Equivalently, f(a+h)=f(a)+f′(a)h+E(h)f(a + h) = f(a) + f'(a)h + E(h) with E(h)h→0\frac{E(h)}h \to 0: near aa, ff is a line plus a tiny error.
    • Differentiable implies continuous; not conversely (∣x∣|x|).
    • The chain rule: linear approximations compose by multiplying slopes. The proof patches the difference quotient at 0.
    • Fermat: interior max or min implies f′=0f' = 0. Mean value theorem: some cc has f′(c)f'(c) = chord slope. Consequence: f′=0f' = 0 on an interval implies constant (the "+ C+\,C").
    • Taylor’s theorem: f(x)=Tn(x)+f(n+1)(c)(n+1)!(x−a)n+1f(x) = T_n(x) + \frac{f^{(n+1)}(c)}{(n+1)!}(x - a)^{n+1}; bound the remainder over all cc to control the error.

    Watch and read

    The same ideas explained by someone else. Use these when an explanation here does not land.

    Where this sits

    Comes from
    1.3 Limits and continuity with epsilon and delta
    Leads to
    1.5 The Riemann integral: area as a limit
    5.3 The total derivative, the Jacobian matrix and tangent planes
    Same idea elsewhere
    JEE / CBSE: You used the product, quotient and chain rules and L'Hospital's rule by heart. This chapter proves them from one definition and shows exactly when they apply.
    MATH 375: Apostol 8.11 defines the total derivative of a function of several variables as the best LINEAR MAP approximation. That is this chapter's idea in many dimensions, and Unit 5 builds it.
    AI: Training a neural network follows derivatives downhill. The chain rule here is, in many variables, exactly backpropagation (chapter 3.8).