** The Derivative**

**4.2 Mean value theorem**

Note: 2 lectures (some applications may be skipped)

### 4.2.1

### Relative minima and maxima

We talked about absolute maxima and minima. These are the tallest peaks and lowest valleys in the whole mountain range. We also want to talk about peaks of individual mountains and bottoms of individual valleys.

Definition 4.2.1. LetS_{⊂}_{R}be a set and let f: S_{→}_{R}be a function. The function f is said to have
arelative maximumatc_{∈}Sif there exists aδ >0 such that for allx∈Swhere|x−c|<δ we have

f(x)_{≤} f(c). The definition ofrelative minimumis analogous.

Lemma 4.2.2. Let f: [a,b]_{→}_{R}be a function differentiable at c_{∈}(a,b), and f has a relative

minimum or a relative maximum at c. Then f0_{(c) =}_{0}_{.}

Proof. We prove the statement for a maximum. For a minimum the statement follows by considering the function−f.

Letcbe a relative maximum of f. In particular, as long as|x−c|<δ we have f(x)−f(c)≤0.

Then we look at the difference quotient. Ifx>cwe note that

f(x)_{−}f(c)
x−c ≤0,
and ify<cwe have

f(y)−f(c)
y_{−}c ≥0.
See for an illustration.

c y

slope= f(y_{y})−_{−}_{c}f(c) _{≥}0

x

slope= f(x)_{x}−_{−}_{c}f(c) _{≤}0

Figure 4.3:Slopes of secants at a relative maximum.

Asa<c<b, there exist sequences_{{}x_{n}}and_{{}y_{n}}, such thatxn>c, andyn<cfor alln∈N,

and such that limxn=limyn=c. Since f is differentiable atcwe know
0≥ lim
n→∞
f(xn)−f(c)
xn−c = f
0_{(c) =} _{lim}
n→∞
f(yn)− f(c)
yn−c ≥0.

For a differentiable function, a point where f0_{(c) =}_{0 is called a}_{critical point}_{. When} _{f} _{is not}
differentiable at some points, it is common to also saycis a critical point if f0_{(c)}_{does not exist.}
The theorem says that a relative minimum or maximum at an interior point of an interval must be a
critical point. As you remember from calculus, finding minima and maxima of a function can be
done by finding all the critical points together with the endpoints of the interval and simply checking
at which of these points is the function biggest or smallest.

### 4.2.2

### Rolle’s theorem

Suppose a function has the same value at both endpoints of an interval. Intuitively it ought to attain a minimum or a maximum in the interior of the interval, then at such a minimum or a maximum, the derivative should be zero. See for the geometric idea. This is the content of the so-called Rolle’s theorem .

c

a b

Figure 4.4:Point where tangent line is horizontal, that is f0(c) =0.

Theorem 4.2.3(Rolle). Let f: [a,b]_{→}Rbe continuous function differentiable on(a,b)such that

f(a) = f(b). Then there exists a c∈(a,b)such that f0(c) =0.

Proof. As f is continuous on[a,b]it attains an absolute minimum and an absolute maximum in

[a,b]. We wish to apply and so we need a minimum or maximum at somec_{∈}(a,b).

WriteK:= f(a) = f(b). If there exists anxsuch that f(x)>K, then the absolute maximum is

bigger thanK and hence occurs atc∈(a,b), and therefore we get f0(c) =0. On the other hand if

there exists anxsuch that f(x)<K, then the absolute minimum occurs at somec∈(a,b)and we

have that f0_{(c) =}_{0. If there is no}_{x}_{such that} _{f}_{(x)}_{>}_{K}_{or} _{f}_{(x)}_{<}_{K}_{, then we have that} _{f}_{(x) =}_{K}_{for}
allxand then f0_{(x) =}_{0 for all}_{x}_{∈}_{[a}_{,}_{b]}_{, so any}_{c}_{∈}_{(a}_{,}_{b)}_{works.}

It is absolutely necessary for the derivative to exist for all x_{∈}(a,b). For example take the

function f(x) =_{|}x_{|}on[_{−}1,1]. Clearly f(_{−}1) = f(1), but there is no point where f0(c) =0.

### 4.2.3

### Mean value theorem

We extend to functions that attain different values at the endpoints.

Theorem 4.2.4(Mean value theorem). Let f: [a,b]→Rbe a continuous function differentiable on

(a,b). Then there exists a point c_{∈}(a,b)such that

f(b)_{−}f(a) = f0_{(c)(b}_{−}_{a)}_{.}

For a geometric interpretation of the mean value theorem, see . The idea is that the value f(b)−f(a)

b−a is the slope of the line between the points a,f(a)

and b,f(b)

. Thencis the
point such that f0_{(c) =} f(b)−f(a)

b−a , that is, the tangent line at the point c,f(c)

has the same slope as the line between a,f(a)

and b,f(b)

. The theorem follows from , by subtracting
from f the affine linear function with the derivative f(b_{b})−_{−}_{a}f(a) with the same values ataandbas f.
That is, we subtract the function whose graph is the straight line a,f(a)

and b,f(b)

. Then we are looking for a point where this new function has derivative zero.

c (a,f(a))

(b,f(b))

Figure 4.5:Graphical interpretation of the mean value theorem.

Proof. Define the functiong: [a,b]→Rby

g(x):= f(x)−f(b)− f(b)_{b}−f(a)

−a (x−b).

The function gis differentiable on(a,b), continuous on [a,b], such thatg(a) =0 and g(b) =0.

Thus there exists ac_{∈}(a,b)such thatg0(c) =0.

0=g0(c) = f0(c)− f(b)_{b}−f(a)
−a
Or in other words f0_{(c)(b}_{−}_{a) =} _{f}_{(b)}_{−}_{f}_{(a)}_{.}

The proof generalizes. By consideringg(x):= f(x)_{−}f(b)_{−}_{ϕ}f(_{(}_{b}b_{)})−_{−}_{ϕ}f(_{(}a_{a})_{)} ϕ(x)−ϕ(b)one can

Theorem 4.2.5(Cauchy’s mean value theorem). Let f: [a,b]→Randϕ: [a,b]→_{R}be continuous

functions differentiable on(a,b). Then there exists a point c_{∈}(a,b)such that

f(b)_{−}f(a)

ϕ0(c) = f0(c) ϕ(b)−ϕ(a).

The mean value theorem has the distinction of being one of the few theorems commonly cited in court. That is, when police measure the speed of cars by aircraft, or via cameras reading license plates, they measure the time the car takes to go between two points. The mean value theorem then says that the car must have somewhere attained the speed you get by dividing the difference in distance by the difference in time.

### 4.2.4

### Applications

We now solve our very first differential equation.

Proposition 4.2.6. Let I be an interval and let f: I_{→}_{R} be a differentiable function such that
f0_{(x) =}_{0}_{for all x}_{∈}_{I. Then f is constant.}

Proof. Take arbitraryx,y_{∈}Iwithx<y. Then f restricted to[x,y]satisfies the hypotheses of the

. Therefore, there is ac_{∈}(x,y)such that

f(y)−f(x) = f0_{(c)(y}_{−}_{x)}_{.}

as f0_{(c) =}_{0, we have} _{f}_{(y) =} _{f}_{(x)}_{. Therefore, the function is constant.}

Now that we know what it means for the function to stay constant, let us look at increasing and
decreasing functions. We say f: I _{→}_{R}is increasing(resp. strictly increasing) ifx<yimplies

f(x)_{≤} f(y)(resp. f(x)< f(y)). We definedecreasingandstrictly decreasingin the same way by

switching the inequalities for f.

Proposition 4.2.7. Let I be an interval and let f: I_{→}_{R}be a differentiable function.
(i) f is increasing if and only if f0_{(x)}_{≥}_{0}_{for all x}_{∈}_{I.}

(ii) f is decreasing if and only if f0_{(x)}_{≤}_{0}_{for all x}_{∈}_{I.}

Proof. Let us prove the first item. Suppose f is increasing, then for allx,c_{∈}Iwithx_{6}=cwe have
f(x)_{−}f(c)

x−c ≥0.
Taking a limit asxgoes tocwe see that f0_{(c)}_{≥}_{0.}

For the other direction, suppose f0_{(x)}_{≥}_{0 for all}_{x}_{∈}_{I}_{. Take any}_{x}_{,}_{y}_{∈}_{I}_{where}_{x}_{<}_{y}_{. By the}
there is somec_{∈}(x,y)such that

f(y)_{−}f(x) = f0_{(c)(y}_{−}_{x)}_{.}

As f0_{(c)}_{≥}_{0, and}_{y}_{−}_{x}_{>}_{0, then} _{f}_{(y)}_{−}_{f}_{(x)}_{≥}_{0 or} _{f}_{(x)}_{≤} _{f}_{(y)}_{and so} _{f} _{is increasing.}
We leave the decreasing part to the reader as exercise.

A similar but weaker statement is true for strictly increasing and decreasing functions.
Proposition 4.2.8. Let I be an interval and let f: I_{→}_{R}be a differentiable function.

(i) If f0_{(x)}_{>}_{0}_{for all x}_{∈}_{I, then f is strictly increasing.}
(ii) If f0_{(x)}_{<}_{0}_{for all x}_{∈}_{I, then f is strictly decreasing.}

The proof of is left as an exercise. Then follows from by considering−f instead.
The converse of this proposition is not true. For example, f(x):=x3 is a strictly increasing
function, but f0_{(}_{0}_{) =}_{0.}

Another application of the is the following result about location of extrema,
sometimes called the first derivative test. The theorem is stated for an absolute minimum and
maximum. To apply it to find relative minima and maxima, restrict f to an interval(c_{−}δ,c+δ).

Proposition 4.2.9. Let f: (a,b)→Rbe continuous. Let c∈(a,b)and suppose f is differentiable

on(a,c)and(c,b).

(i) If f0_{(x)}_{≤}_{0}_{for x}_{∈}_{(a}_{,}_{c)}_{and f}0_{(x)}_{≥}_{0}_{for x}_{∈}_{(c}_{,}_{b), then f has an absolute minimum at c.}
(ii) If f0_{(x)}_{≥}_{0}_{for x}_{∈}_{(a}_{,}_{c)}_{and f}0_{(x)}_{≤}_{0}_{for x}_{∈}_{(c}_{,}_{b), then f has an absolute maximum at c.}
Proof. We prove the first item leaving the second to the reader. Takex_{∈}(a,c)and_{{}y_{n}}a sequence

such thatx<yn<cand limyn=c. By the preceding proposition, f is decreasing on(a,c) so
f(x)_{≥} f(yn). As f is continuous atc, we take the limit to get f(x)≥ f(c)for allx∈(a,c).

Similarly, takex_{∈}(c,b)and_{{}y_{n}}a sequence such thatc<yn<xand limyn=c. The function
is increasing on (c,b)so f(x)_{≥} f(yn). By continuity of f we get f(x)≥ f(c) for allx∈(c,b).
Thus f(x)≥ f(c)for allx∈(a,b).

The converse of the proposition does not hold. See below.

Another often used application of the mean value theorem you have possibly seen in calculus is the following result on differentiability at the end points of an interval. The proof is . Proposition 4.2.10.

(i) Suppose f: [a,b)_{→}Ris continuous, differentiable in(a,b), andlimx→a f0(x) =L. Then f
is differentiable at a and f0_{(a) =}_{L.}

(ii) Suppose f: (a,b]_{→}Ris continuous, differentiable in(a,b), andlimx→b f0(x) =L. Then f
is differentiable at b and f0_{(b) =}_{L.}

In fact, using the extension result , you do not need to assume that f is defined at the end point. See .

### 4.2.5

### Continuity of derivatives and the intermediate value theorem

Derivatives of functions satisfy an intermediate value property.

Theorem 4.2.11 (Darboux). Let f: [a,b]_{→} R be differentiable. Suppose y∈R is such that

The proof follows by subtracting f and a linear function with derivativey. The new function g reduces the problem to the casey=0, where g0(a)>0>g0(b). That is, gis increasing at a

and decreasing atb, so it must attain a maximum inside(a,b), where the derivative is zero. See

.
a
g′_{(a)}_{>}_{0}
c
g′_{(c) =}_{0}
b
g′_{(b)}_{<}_{0}

Figure 4.6:Idea of the proof of Darboux theorem.

Proof. Suppose f0_{(a)}_{<}_{y}_{<} _{f}0_{(b)}_{. Define}

g(x):=yx_{−}f(x).

The functiongis continuous on[a,b], and sogattains a maximum at somec_{∈}[a,b].

The functiongis also differentiable on[a,b]. Computeg0(x) =y− f0_{(x)}_{. Thus}_{g}0_{(a)}_{>}_{0. As}
the derivative is the limit of difference quotients and is positive, there must be some difference
quotient that is positive. That is, there must exist anx>asuch that

g(x)−g(a)
x_{−}a >0,

or g(x)>g(a). Thus gcannot possibly have a maximum ata. Similarly, asg0(b)<0, we find

anx<b(a differentx) such that g(x_{x})−_{−}g_{b}(b) <0 or thatg(x)>g(b), thusgcannot possibly have a

maximum atb. Therefore,c∈(a,b), and applies: Asgattains a maximum atcwe

findg0_{(c) =}_{0 and so} _{f}0_{(c) =}_{y}_{.}

Similarly, if f0_{(a)}_{>}_{y}_{>} _{f}0_{(b)}_{, consider}_{g(x)}_{:}_{=} _{f}_{(x)}_{−}_{yx}_{.}

We have seen already that there exist discontinuous functions that have the intermediate value property. While it is hard to imagine at first, there also exist functions that are differentiable everywhere and the derivative is not continuous.

Example 4.2.12: Let f: _{R}_{→}_{R}be the function defined by
f(x):=

(

xsin(1_{/}_{x)}2

ifx6=0,

0 ifx=0.

We claim that f is differentiable everywhere, but f0_{:} _{R}_{→} _{R} _{is not continuous at the origin.}
Furthermore, f has a minimum at 0, but the derivative changes sign infinitely often near the origin.

Figure 4.7: A function with a discontinuous derivative. The function f is on the left and f0is on the

right. Notice that f(x)_{≤}x2_{on the left graph.}

Proof: It is immediate from the definition that f has an absolute minimum at 0: we know
f(x)_{≥}0 for allxand f(0) =0.

The function f is differentiable forx_{6}=0, and the derivative is 2sin(1_{/}_{x)} _{x}_{sin}_{(}1_{/}_{x)}_{−}_{cos}_{(}1_{/}_{x)}

.
As an exercise show that forxn= _{(8}_{n}_{+1)}4 _{π} we have lim f0(xn) =−1, and foryn= _{(8}_{n}_{+3)}4 _{π} we have
lim f0_{(yn) =}_{1. Hence if} _{f}0_{exists at 0, then it cannot be continuous.}

Let us show that f0_{exists at 0. We claim that the derivative is zero. In other words}
f(x)−f(0)
x−0 −0

goes to zero asxgoes to zero. Forx6=0 we have

f(x)_{−}f(0)
x_{−}0 −0
=
x2_{sin}2_{(}_{1}_{/}_{x)}
x
=xsin2(1/x)
≤ |x|.

And, of course, as xtends to zero, then |x| tends to zero and hence f(x)−f(0) x−0 −0 goes to zero.

Therefore, f is differentiable at 0 and the derivative at 0 is 0. A key point in the above calculation is that|f(x)| ≤x2, see also Exercises and .

It is sometimes useful to assume the derivative of a differentiable function is continuous. If
f: I_{→}_{R}is differentiable and the derivative f0_{is continuous on}_{I}_{, then we say} _{f} _{is}_{continuously}
differentiable. It is common to writeC1_{(I)}_{for the set of continuously differentiable functions on}_{I}_{.}

### 4.2.6

### Exercises

Exercise4.2.1: Finish the proof of . Exercise4.2.2: Finish the proof of .

Exercise4.2.3: Suppose f:R→Ris a differentiable function such that f0is a bounded function. Prove f is

Exercise4.2.4: Suppose f:[a,b]→Ris differentiable and c∈[a,b]. Then show there exists a sequence

{xn}converging to c, xn6=c for all n, such that

f0_{(}_{c}_{) =} _{lim}

n→∞f
0_{(}_{x}

n).

Do note this doesnotimply that f0_{is continuous (why?).}

Exercise4.2.5: Suppose f:R→Ris a function such that|f(x)−f(y)| ≤ |x−y|2for all x and y. Show that

f(x) =C for some constant C. Hint: Show that f is differentiable at all points and compute the derivative.

Exercise4.2.6: Finish the proof of . That is, suppose I is an interval and f:I →Ris a

differentiable function. If f0_{(}_{x}_{)}_{>}_{0}_{for all x}_{∈}_{I, show that f is strictly increasing.}

Exercise 4.2.7: Suppose f:(a,b)_{→}Ris a differentiable function such that f0(x)6=0for all x∈(a,b).

Suppose there exists a point c∈(a,b)such that f0(c)>0. Prove f0(x)>0for all x∈(a,b).

Exercise4.2.8: Suppose f:(a,b)→Rand g:(a,b)→Rare differentiable functions such that f0(x) =g0(x)

for all x∈(a,b), then show that there exists a constant C such that f(x) =g(x) +C.

Exercise4.2.9: Prove the following version of L’Hôpital’s rule. Suppose f:(a,b)_{→}Rand g:(a,b)→R

are differentiable functions. Suppose that at c∈(a,b), f(c) =0, g(c) =0, g0(x)6=0when x6=c, and that

the limit of f0_{(}_{x}_{)}_{/}_{g}_{0}_{(}_{x}_{)}_{as x goes to c exists. Show that}

lim
x→c
f(x)
g(x) =limx→c
f0_{(}_{x}_{)}
g0_{(}_{x}_{)}.
Compare to .

Exercise 4.2.10: Let f: (a,b)_{→}R be an unbounded differentiable function. Show f0: (a,b)→ R is

unbounded.

Exercise4.2.11: Prove the theorem Rolle actually proved in 1691: If f is a polynomial, f0(a) = f0(b) =0

for somea<b, and there is noc_{∈}(a,b)such that f0(c) =0, then there is at most one root of f in(a,b), that

is at most onex∈(a,b)such that f(x) =0. In other words, between any two consecutive roots of f0_{is at}

most one root of f . Hint: Suppose there are two roots and see what happens.

Exercise4.2.12: Suppose a,b_{∈}Rand f:R→Ris differentiable, f0(x) =a for all x, and f(0) =b. Find f

and prove that it is the unique differentiable function with this property.

Exercise4.2.13:

a) Prove .

b) Suppose f:(a,b)→Ris continuous, and suppose f is differentiable everywhere except at c∈(a,b)and

limx→cf0(x) =L. Prove that f is differentiable at c and f0(c) =L.

Exercise4.2.14: Suppose f:(0,1)_{→}Ris differentiable and f0is bounded.

a) Show that there exists a continuous function g:[0,1)_{→}Rsuch that f(x) =g(x)for all x6=0.

Hint: and .

b) Find an example where the g is not differentiable at x=0.

Hint: Consider something based onsin(lnx), and assume you know basic properties ofsinandlnfrom

calculus.

c) Instead of assuming that f0_{is bounded, assume that}_{lim}_{x}

→0f0(x) =L. Prove that not only does g exist
but it is differentiable at0and g0_{(}_{0}_{) =}_{L.}