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) deserve the name “slope”? This chapter answers both with one idea: near a, a differentiable function looks like a straight line, and 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 ε and δ, continuity, and the extreme value theorem.
Quick checkWhat does limx→ag(x)=L ignore?
The definition only looks at x with 0<∣x−a∣<δ. That matters here: the difference quotient is not even defined at h=0.Review: limits of functions
Zoom in on x2 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 h, shrinks towards 0. Two things to do:
Zoom on a smooth curve. Pick x2, then sinx, then x3−x. Slide the point a to a few places and zoom each time. Watch the number “error divided by h” fall as you zoom. That falling number is what the definition below formalises.
Zoom on the corner. Pick ∣x∣. At its corner, every zoom shows the same V. No line fits it, at any scale.
“Differentiable at a” means exactly that zooming in at a 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 x and at x+e, divided by e, and then set e 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 dxdy. 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 f be defined on an interval containing a. The derivative of f at a is
f′(a)=h→0limhf(a+h)−f(a),
if this limit exists. The fraction is the difference quotient: the slope of the chord from (a,f(a)) to (a+h,f(a+h)). Here a is fixed and h is the variable, so this is a limit of a function of h as in 1.3. The step h is never 0 inside the limit, which is why the fraction makes sense.
In one linef′(a)=limh→0hf(a+h)−f(a), 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
f is differentiable at a if f′(a) exists. Equivalently, there is a number m such that
f(a+h)=f(a)+mh+E(h),where hE(h)→0 as h→0,
and then m=f′(a). In words: f near a is a straight line of slope m plus an error that is small even compared with h.
In one linef is differentiable at a if f′(a) exists; equivalently, f(a+h)=f(a)+f′(a)h+E(h) with E(h)/h→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) by h: hf(a+h)−f(a)=m+hE(h). The left side tends to m exactly when hE(h)→0. The second form is the zoom picture: the error of the line f(a)+mh shrinks faster than h, so at fine scales it vanishes from view. It is also the form that works in Rn, where you cannot divide by a vector h but you can still ask that the error be small compared with ∣h∣ (Apostol 8.11, chapter 5.3).
Worked example
Find the derivative of f(x)=x2 at a from the definition, in both forms.
Solution.
Difference quotient.h(a+h)2−a2=h2ah+h2=2a+h for h=0. Expand and cancel. Cancelling h is allowed because h=0 inside a limit.
Take the limit.2a+h→2a as h→0. So f′(a)=2a. 2a+h is within ε of 2a when ∣h∣<ε: take δ=ε.
Linear-approximation form.(a+h)2=a2+2ah+h2, so E(h)=h2, and hE(h)=h→0. The same answer, read as ‘line plus small error’.
Answer.f′(a)=2a. Near a=1, x2≈1+2(x−1), with error (x−1)2.
Your answerFor f(x)=x2 at a=3, compute the difference quotient hf(3+h)−f(3) with h=0.1.
Use the formula 2a+h, or compute 3.12 directly.
0.13.12−32=0.19.61−9=6.1. The example's formula gives the same: 2a+h=6+0.1. As h→0 it tends to f′(3)=6.
Worked example
Find the derivative of f(x)=x at a>0 from the definition.
Solution.
Write the difference quotient.ha+h−a. The definition. Setting h=0 gives 00, so we must simplify before taking the limit.
Multiply top and bottom by the conjugate.h(a+h+a)(a+h−a)(a+h+a)=h(a+h+a)(a+h)−a. The same rationalising trick you used in JEE. It turns the difference of square roots into h, which can cancel.
Cancel h.=a+h+a1 for h=0. Allowed, because inside a limit h=0.
Take the limit. As h→0, a+h→a (continuity of x, 1.3), so the quotient tends to 2a1. The denominator tends to 2a, which is not 0 because a>0, so the quotient law applies.
Answer.f′(a)=2a1. ■ At a=4 this is 41, the slope used in the 4.1 estimate below.
Your answerFrom the definition, the difference quotient of f(x)=x3 at a=2 is h(2+h)3−8=12+6h+h2. What is f′(2)?
Let h→0 in 12+6h+h2.
Expand (2+h)3=8+12h+6h2+h3. Subtract 8 and divide by h: 12+6h+h2. As h→0 this tends to 12, so f′(2)=12. It matches the school rule 3a2=12.
Quick checkWhich error E(h), in f(a+h)=f(a)+mh+E(h), is small enough for m to be the derivative?
We need hE(h)→0. For h2 the ratio is h→0. For ∣h∣ the ratio is ±1, not tending to 0. For 0.01h the ratio is the constant 0.01, which is a small number that does not tend to 0. In that case f(a+h)=f(a)+(m+0.01)h exactly, so the derivative would be m+0.01 and m would be the wrong slope. 'Small compared with h' means the ratio shrinks to 0 as h does.
Worked example
Show f(x)=∣x∣ is not differentiable at 0.
Solution.
Difference quotient.h∣h∣−0 equals 1 for h>0 and −1 for h<0. ∣h∣=h or −h depending on the sign.
Use sequences (1.3). Along hn=n1 the quotient is 1; along hn=−n1 it is −1. A limit would have to equal both. If a limit exists, every sequence hn→0 gives the same value (the sequential criterion of 1.3, in its limit form).
Answer. No limit, so ∣x∣ is not differentiable at 0, although it is continuous there. The zoom picture shows the V that never straightens.
Theorem BAbbott Thm 5.2.3
Differentiable implies continuous
If f is differentiable at a, then f is continuous at a. (The converse fails: ∣x∣.)
In one lineIf f is differentiable at a, it is continuous at a.
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=0: f(a+h)−f(a)=h⋅hf(a+h)−f(a).
Multiply and divide by h=0.
As h→0 the right side tends to 0⋅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 is continuous at a. ■
That is the definition of continuity at a, with x=a+h.
Quick checkWhich of these is true?
The theorem proves the first. For the failure of the converse, ∣x∣ is continuous at 0 and not differentiable there. Remember the picture: continuity says the graph has no break, differentiability says it also has no corner.
The rules, from the definition
Theorem BSpivak ch. 10
Chain rule
If g is differentiable at a and f is differentiable at g(a), then f∘g is differentiable at a with (f∘g)′(a)=f′(g(a))g′(a).
In one lineIf g is differentiable at a and f at g(a), then (f∘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 g multiplies small changes by g′(a) and f multiplies small changes by f′(g(a)), doing one after the other multiplies by the product. The tempting proof writes hf(g(a+h))−f(g(a))=g(a+h)−g(a)f(g(a+h))−f(g(a))⋅hg(a+h)−g(a), but g(a+h)−g(a) can be 0 for small h (for example if g 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), and define φ(k)=kf(b+k)−f(b) for k=0, and φ(0)=f′(b).
Abbreviate. b=g(a).
φ is continuous at 0.
Differentiability of f at b says exactly that the difference quotient tends to f′(b)=φ(0).This patch at k=0 is the whole trick.
For every k: f(b+k)−f(b)=φ(k)k.
For k=0 multiply the definition of φ by k; for k=0 both sides are 0.
hf(g(a+h))−f(g(a))=φ(g(a+h)−g(a))⋅hg(a+h)−g(a).
Substitute k=g(a+h)−g(a), so b+k=g(a+h), and divide by h=0.
As h→0 the right side tends to φ(0)⋅g′(a)=f′(g(a))g′(a). ■
g is continuous at a (differentiable implies continuous), so g(a+h)−g(a)→0; φ is continuous at 0; the second factor tends to g′(a).
Worked example
See the patch φ at work: f(u)=u2 composed with g(x)=x3 at a=1.
Solution.
Set the pieces.b=g(1)=1, f′(b)=2, g′(1)=3. The chain rule predicts (f∘g)′(1)=f′(1)g′(1)=2×3=6.
Build φ. For k=0: φ(k)=k(1+k)2−1=k2k+k2=2+k. At k=0 define φ(0)=f′(1)=2. The formula 2+k already gives 2 at k=0, so the patch costs nothing here. For a general f the quotient is undefined at k=0 and the patch is needed.
Check the key identity.f(1+k)−f(1)=(1+k)2−1=(2+k)k=φ(k)k, true for every k including k=0. This is the line that avoids dividing by g(a+h)−g(a).
Substitute k=g(1+h)−g(1)=(1+h)3−1=3h+3h2+h3. Then hf(g(1+h))−f(g(1))=φ(k)⋅hk=(2+k)(3+3h+h2). Here hk=hg(1+h)−g(1), the difference quotient of g.
Let h→0. Then k→0, so 2+k→2, and 3+3h+h2→3. The product tends to 6. Matches the prediction. Direct check: f(g(x))=x6 has derivative 6x5=6 at 1.
Answer.(f∘g)′(1)=6=f′(g(1))g′(1). ■
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.
Let b=g(a) and define φ(k)=kf(b+k)−f(b) for k=0, and φ(0)=f′(b).
φ is continuous at 0.
For every k, f(b+k)−f(b)=φ(k)k.
Put k=g(a+h)−g(a) and divide by h=0: hf(g(a+h))−f(g(a))=φ(g(a+h)−g(a))hg(a+h)−g(a).
As h→0, g(a+h)−g(a)→0.
So the right side tends to φ(0)g′(a)=f′(g(a))g′(a).
Quick checkA student proves the chain rule by writing hf(g(a+h))−f(g(a))=g(a+h)−g(a)f(g(a+h))−f(g(a))⋅hg(a+h)−g(a). What is wrong?
If g is constant near a, or oscillates so that g(a+h)=g(a) for a sequence of h→0, we divide by zero. The function φ repairs exactly this: it multiplies by k instead of dividing by it, and it is defined and continuous even at k=0.
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)).
Worked example Abbott Thm 5.2.4
Prove the product rule: (fg)′(a)=f′(a)g(a)+f(a)g′(a).
Solution.
Write the difference quotient of fg.hf(a+h)g(a+h)−f(a)g(a). The definition of (fg)′(a).
Add and subtract 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)). The aim is to produce difference quotients of f and of g separately. This is the same trick as the product law for sequences in 1.2: change one factor at a time.
Split the quotient.f(a+h)⋅hg(a+h)−g(a)+g(a)⋅hf(a+h)−f(a). Divide each part by h.
Take limits. The two quotients tend to g′(a) and f′(a). Also f(a+h)→f(a). f is differentiable at a, hence continuous there, by the theorem above.
Combine. The sum tends to 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). ■
The mean value theorem
Theorem BAbbott Thm 5.2.6 (Fermat)
Interior extremum theorem
If f is differentiable at an interior point c of an interval and f(c)≥f(x) for all x in the interval (or ≤), then f′(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 h: f(c+h)−f(c)≤0.
c is a maximum, and c+h is in the interval for small ∣h∣ because c is interior.
For h>0 the difference quotient is ≤0; for h<0 it is ≥0.
Dividing by a positive h keeps the sign; by a negative h flips it.
So f′(c)≤0 and f′(c)≥0, hence f′(c)=0. ■
Limits preserve non-strict inequalities (take limits along hn=±n1).
Theorem BAbbott Thm 5.3.2
Mean value theorem
Let f be continuous on [a,b] and differentiable on (a,b). Then there is c∈(a,b) with
f′(c)=b−af(b)−f(a).
The special case f(a)=f(b), where f′(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)) to (b,f(b)) has slope b−af(b)−f(a). Subtract the chord from the graph: what is left, g(x)=f(x)−(chord at x), starts and ends at 0. A continuous function on [a,b] has a maximum and a minimum (1.3); if g is not constant, one of them is inside, where g′=0 (Fermat), meaning 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=b−af(b)−f(a) and g(x)=f(x)−f(a)−m(x−a).
Name the chord slope.
g(a)=0 and g(b)=f(b)−f(a)−m(b−a)=0.
Substitute x=a and x=b.
g attains a maximum and a minimum on [a,b].
g is continuous on [a,b]; extreme value theorem (1.3).
If g is constant, any c∈(a,b) has g′(c)=0.
If both occur at the endpoints, max = min = 0 and g is constant 0, so g′=0 everywhere inside.
Otherwise an extremum occurs at some interior c, and g′(c)=0.
Otherwise the max or the min is non-zero, so it is not at an endpoint (where g=0); interior extremum theorem.
So f′(c)=m. ■
g′(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.
Subtract the chord so the endpoints become level.
Substitute the endpoints.
You need g defined first.
Extreme value theorem; g is continuous on a closed interval.
State g's endpoint values before using its extremes; the next step compares them.
If both were at endpoints, both would be 0 and g would be constant.
This needs the max and min to exist.
Interior extremum theorem, and g′=f′−m.
You need an interior extremum before applying Fermat's theorem.
Quick checkf(x)=x3 has f′(0)=0. Does f have a maximum or minimum at 0?
Fermat's theorem says: interior extremum implies f′=0. The converse is false. x3 is negative for x<0 and positive for x>0, so 0 is neither a maximum nor a minimum.
Worked example
Find the number c promised by the mean value theorem for f(x)=x3 on [0,2].
Solution.
Check the hypotheses.x3 is a polynomial, so it is continuous on [0,2] and differentiable on (0,2). The theorem applies only when both hold.
Chord slope.2−0f(2)−f(0)=28−0=4. This is the average rate of change over the interval.
Solve f′(c)=4.3c2=4, so c=±32. The derivative is 3x2. We set it equal to the chord slope.
Keep the root in the open interval.32≈1.155∈(0,2); the root −1.155 is outside. The theorem promises a c inside (a,b) only.
Answer.c=32≈1.155. ■ At that instant the tangent is parallel to the chord.
Your answerFor f(x)=x3 on [0,1], the mean value theorem gives c∈(0,1) with f′(c)= the chord slope. Find c.
First find the chord slope, then solve 3c2= that slope.
Chord slope: 1−01−0=1. Then 3c2=1, so c=31≈0.577 (the negative root is outside the interval).
Worked example
Use the mean value theorem to prove ln(1+x)≤x for all x>0.
Solution.
Pick the function and interval.f(t)=ln(1+t) on [0,x]. The inequality compares f(x)−f(0) with x−0, which is a chord, so this is a job for the mean value theorem.
Apply the theorem.f is continuous on [0,x] and differentiable on (0,x), so ln(1+x)−ln1=f′(c)(x−0) for some c∈(0,x). Here f′(t)=1+t1.
Bound the derivative.f′(c)=1+c1<1 since c>0. We cannot find c, but we do not need it: any c in the interval gives a derivative below 1.
Conclude.ln(1+x)=f′(c)x<x. Multiply the inequality f′(c)<1 by x>0.
Answer.ln(1+x)<x for x>0 (so certainly ≤). ■ This is the standard way to use the theorem: bound f′ on the whole interval.
Corollary BAbbott Cor 5.3.3 and 5.3.4
Zero derivative means constant
If f′(x)=0 for all x in an interval, then f is constant on it. Hence two functions with the same derivative on an interval differ by a constant.
In one lineIf f′(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<y in the interval, f(y)−f(x)=f′(c)(y−x) for some c∈(x,y).
Any two points of the interval; MVT on [x,y].
So f(y)=f(x). Since x,y were arbitrary, f is constant. For two functions, apply this to their difference. ■
f′(c)=0.
Same idea elsewhere· This is the '+ C' of chapter 2.3
Chapter 2.3 explained "+C" by saying the null space of differentiation is the constant functions. That claim is this corollary: f′=0 forces f 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 f continuous on the CLOSED interval [a,b]?
The proof subtracts the chord and uses that the result has a maximum and minimum. Without continuity at the endpoints that can fail: f(x)=x on [0,1) with f(1)=0 has no point where f′ equals the chord slope 0.
Taylor’s theorem
The tangent line is the best degree-1 approximation. The best degree-n approximation matches n derivatives, and Taylor’s theorem says exactly how good it is.
Definition B
Taylor polynomial
If f has n derivatives at a, its Taylor polynomial of degree n at a is
It is the only polynomial of degree at most n whose value and first n derivatives at a agree with f‘s. (Here k!=1⋅2⋯k, the product of the first k whole numbers, and 0!=1. The k! in the denominator is exactly what makes the k-th derivative of k!(x−a)k equal to 1.)
In one lineTn(x)=∑k=0nk!f(k)(a)(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 T3 of f(x)=ln(1+x) at a=0.
Solution.
List the derivatives.f′(x)=1+x1, f′′(x)=−(1+x)21, f′′′(x)=(1+x)32. T3 needs f and its first three derivatives.
Evaluate at a=0.f(0)=0, f′(0)=1, f′′(0)=−1, f′′′(0)=2. The formula uses the derivatives at the centre a.
Divide by factorials. The coefficients are k!f(k)(0): 0, 1, −21, 62=31. Definition of the Taylor polynomial.
Assemble.T3(x)=x−2x2+3x3. Sum of coefficient times (x−0)k.
Answer.T3(x)=x−2x2+3x3. ■ Check: ln1.1=0.09531 and T3(0.1)=0.1−0.005+0.000333=0.09533.
Your answerThe Taylor polynomial of cosx at 0 begins 1−2x2+…. What is the coefficient of x4?
Differentiate four times and evaluate at 0, then divide by 4!=24.
The fourth derivative of cosx is cosx, which is 1 at 0. The coefficient is 4!f(4)(0)=241. (The derivatives cycle cos,−sin,−cos,sin,cos.)
Theorem BAbbott Thm 6.6.3, Spivak ch. 20
Taylor's theorem with Lagrange remainder
If f has n+1 derivatives on an interval containing a and x, then for some c between a and x:
f(x)=Tn(x)+(n+1)!f(n+1)(c)(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+1, with M chosen so that F(x)=0.
Fix x=a and choose M to make F(x)=0 (possible since (x−a)n+1=0).
F(a)=F′(a)=⋯=F(n)(a)=0.
Tn was built to match f's first n derivatives at a, and every derivative of (t−a)n+1 below order n+1 vanishes at a.
There is c1 between a and x with F′(c1)=0.
Rolle on [a,x]: F(a)=F(x)=0.
Continuing, there are c2,…,cn+1, each between a and the previous one, with F(k)(ck)=0.
Rolle again on [a,c1] for F′, which vanishes at both ends; repeat.
0=F(n+1)(cn+1)=f(n+1)(cn+1)−M(n+1)!.
Tn has degree n, so Tn(n+1)=0, and the (n+1)-th derivative of (t−a)n+1 is (n+1)!.
M=(n+1)!f(n+1)(c), and F(x)=0 is exactly the formula. ■
Solve for M, set c=cn+1, and use F(x)=0.
Worked example
Which degree n makes the Taylor polynomial of ex at 0 give e to within 10−6?
Solution.
Write the remainder. For f=ex, a=0, x=1: e=Tn(1)+(n+1)!ec for some c∈(0,1). Every derivative of ex is ex.
Bound it.ec<e<3, so the error is less than (n+1)!3. Over-estimate freely, as in 1.2.
Solve.(n+1)!3<10−6 needs (n+1)!>3×106. Since 10!=3628800>3×106 and 9!=362880<3×106, the smallest n with n+1≥10 is n=9. Factorials grow fast; check a few values. This bound is sufficient, so a smaller n might also work, but this one is guaranteed.
Answer.T9(1)=1+1+21+⋯+9!1≈2.7182815, within 10−6 of e=2.7182818… (the true error is about 3×10−7).
Your answerUsing the same bound (n+1)!3, what is the smallest degree n that guarantees an error below 10−8?
Compute 3/(n+1)! for n=9,10,11 until it drops below 10−8.
11!3=399168003≈7.5×10−8 is still too big. 12!3=4790016003≈6.3×10−9 is below 10−8. So n+1=12, that is n=11.
Worked example
Show ∣sinx−x∣≤6∣x∣3 for all x, and use it to bound the error of sin0.1≈0.1.
Solution.
Taylor at 0 with n=2.T2(x)=0+x+0⋅x2=x, since sin0=0, cos0=1, −sin0=0. The degree-2 polynomial happens to be x.
Remainder.sinx−x=3!−coscx3. The third derivative of sin is −cos.
Bound.∣cosc∣≤1, so ∣sinx−x∣≤6∣x∣3. For x=0.1: error ≤60.001≈0.000167. Actual error: 0.1−sin0.1≈0.000167, very close to the bound.
Answer. The small-angle approximation sinx≈x used in physics (pendulums, optics) has error at most 6∣x∣3.
Your answerUse ∣sinx−x∣≤6∣x∣3 at x=0.5. What bound on the error of sin0.5≈0.5 do you get? (Give a fraction.)
0.53=0.125. Divide by 6.
60.53=60.125=481≈0.0208. The true error is 0.5−sin0.5=0.0206, so the bound is close.
Worked example
Estimate 26 with the tangent line of x at 25, and bound the error.
Solution.
Tangent line.f(x)=x, f(25)=5, f′(x)=2x1, so f′(25)=101. Then 26≈5+101(26−25)=5.1. This is T1: the best straight-line estimate near 25.
Remainder formula, n=1.26−5.1=2!f′′(c)(26−25)2 for some c∈(25,26). Taylor’s theorem with Lagrange remainder. We cannot find c, so we bound the formula for every possible c.
Bound f′′.f′′(x)=−41x−3/2. For c≥25, c3/2≥125, so ∣f′′(c)∣≤4⋅1251=5001. x−3/2 gets smaller as x grows, so its largest value on (25,26) is at the left end.
Error bound.∣26−5.1∣≤21⋅5001⋅1=0.001. Substitute into the remainder.
Answer.26≈5.1 with error at most 0.001. ■ The true value is 5.09902, error 0.00098.
Quick checkThe Taylor remainder says the error of Tn is (n+1)!f(n+1)(c)(x−a)n+1. What is c?
The theorem only says such a c exists, like the mean value theorem (which is the case n=0). In practice you bound ∣f(n+1)∣ over the whole interval.
Where it is used
Used inside maths· Inside maths: optimisation and Unit 5
Fermat’s theorem is why you set f′=0 to find maxima; the second-derivative test is Taylor’s theorem with n=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 θ′′=−Lgsinθ is replaced by θ′′=−Lgθ, using sinθ≈θ with the Taylor error bound above; for a 5° swing (0.087 rad) the relative error is under 0.13%. Floating-point libraries compute sin, exp and 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 e example.
Traps
Watch out· Continuous does not mean differentiable
∣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
x3 has derivative 0 at 0 and no maximum or minimum there. Fermat’s theorem is “max implies f′=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′ on the whole interval rather than trying to find c.
Problems
check
From the definition, find f′(a) for f(x)=3x+7.
Solution
h3(a+h)+7−3a−7=3, so f′(a)=3.
check
Verify the mean value theorem for f(x)=x2 on [1,3]: find c.
Solution
Chord slope 29−1=4; f′(c)=2c=4 gives c=2∈(1,3).
check
Write the Taylor polynomial T3 of ex at 0.
Solution
1+x+2x2+6x3.
use
From the definition, prove f(x)=x1 has f′(a)=−a21 for a=0.
Solution
ha+h1−a1=ha(a+h)a−(a+h)=a(a+h)−1→−a21, using continuity of a(a+h)1 in h at 0 (1.3) for a=0.
use
Use the mean value theorem to prove ∣sinx−siny∣≤∣x−y∣ for all x,y.
Solution
By the MVT, sinx−siny=cosc(x−y) for some c; since ∣cosc∣≤1, ∣sinx−siny∣≤∣x−y∣. (So sin is uniformly continuous, with δ=ε.)
use
Estimate 4.1 with the tangent line of x at 4, and bound the error with Taylor’s theorem.
Solution
f(4)=2, f′(4)=41, so 4.1≈2+40.1=2.025. Remainder: 2f′′(c)(0.1)2 with f′′(c)=−41c−3/2, c∈(4,4.1); ∣f′′(c)∣≤41⋅81=321. Error ≤641(0.01)≈0.000156. (True: 4.1=2.024846, error 0.000154.)
proveAbbott Thm 5.2.4 (quotient rule)
Prove the quotient rule: if f and g are differentiable at a and g(a)=0, then (gf)′(a)=g(a)2f′(a)g(a)−f(a)g′(a). You may use the product rule (worked above), the chain rule, and the result (x1)′=−x21 from the previous problem.
Solution
Let r(u)=u1, so g1=r∘g. Since g is differentiable at a, it is continuous there, so g=0 near a and r∘g is defined near a. The chain rule with r′(u)=−u21 gives (g1)′(a)=−g(a)2g′(a). Now write gf=f⋅g1 and use the product rule: (gf)′(a)=f′(a)g(a)1+f(a)(−g(a)2g′(a))=g(a)2f′(a)g(a)−f(a)g′(a).
prove
Prove: if f′(x)>0 for all x in an interval, then f is strictly increasing there.
Solution
For x<y, the MVT gives f(y)−f(x)=f′(c)(y−x)>0, since both factors are positive.
prove
Prove ex≥1+x for all real x, using Taylor’s theorem.
Solution
ex=1+x+2ecx2 for some c between 0 and x. The last term is ≥0, so ex≥1+x.
stretchAbbott Exercise 5.2.10 style
Let f(x)=x2sin(1/x) for x=0 and f(0)=0. Show f is differentiable at 0 with f′(0)=0, but f′ is not continuous at 0.
Solution
hf(h)−0=∣hsin(1/h)∣≤∣h∣→0, so f′(0)=0. For x=0: f′(x)=2xsin(1/x)−cos(1/x). Along xn=2πn1→0, f′(xn)=−1, not tending to f′(0)=0. So f′ exists everywhere but is discontinuous at 0.
stretch
L’Hospital’s rule (one case). Suppose f(a)=g(a)=0, f,g differentiable near a, and g′(a)=0. Prove limx→ag(x)f(x)=g′(a)f′(a).
Solution
g(x)f(x)=g(x)−g(a)f(x)−f(a)=x−ag(x)−g(a)x−af(x)−f(a). The numerator tends to f′(a), the denominator to g′(a)=0, so the quotient tends to g′(a)f′(a) (quotient law). (The general version with limits of g′f′ uses the Cauchy mean value theorem.)
Summary
f′(a)=limh→0hf(a+h)−f(a). Equivalently, f(a+h)=f(a)+f′(a)h+E(h) with hE(h)→0: near a, f is a line plus a tiny error.
Differentiable implies continuous; not conversely (∣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′=0. Mean value theorem: some c has f′(c) = chord slope. Consequence: f′=0 on an interval implies constant (the "+C").
Taylor’s theorem:f(x)=Tn(x)+(n+1)!f(n+1)(c)(x−a)n+1; bound the remainder over all c to control the error.
Watch and read
The same ideas explained by someone else. Use these when an explanation here does not land.
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).