continuity of functions

26
Continuity of functions Introduction Continuous functions are a good model for the real world in that many processes are very continuous: the change of temperature from point to point, the rate of flow of blood in the arteries and heart, the change in inflation. Many processes can be well approximated by continuous functions. In addition differentiable functions are continuous and continuous functions have some very valuable properties, such as being bounded on closed and bounded intervals. They can be generalized to apply to functions on subsets of R n and more generally give rise to the subject of ”topology” which includes the concepts metric spaces and connectedness. Perhaps the most important class of functions in the whole of mathematics is the class of continuous functions. Intuitively these are those functions that can be drawn on a piece of paper without lifting your pen off the paper, ie: the graphs of these functions appear as a “single piece”. Unfortunately the above description cannot serve as a definition. The first reason for this is that there are continuous functions such as: f (x) := x · sin(1/x) for x = 0 and f (x) := 0 for x = 0 that cannot be drawn. In fact it is not possible to draw the graph of any function, not even f (x) := x. One can, at best, only approximately depict the graph of a function. However there is an even deeper reason why the above description cannot serve as a definition, namely, the functions that we are interested in map from R into R; which is a mathematical construct, built up from set theory. The real line is not an object of “reality” but only an object of abstraction. But even forgetting the above “technical” argument, from a completely pragmatic point of view, the above definition is not very useful. For example, how would one go about showing that the sum of two continuous functions is again continuous? Or for that matter, how would one go about deriving any of the properties that a continuous function may or may not have? With this preliminary discussion out of the way, let us now give the formal “mathematical” definition of continuity which hopefully captures, at the intuitive level, the notion of continuity described above. Definition: Let f : A R be defined on a non-empty open interval A of R and let x 0 A. We say that f is continuous at x 0 if for each ε> 0 there exists a δ> 0 such that |f (x) - f (x 0 )| for all x A with |x - x 0 | . Note: this is equivalent to saying that lim xx 0 f (x)= f (x 0 ). 1

Upload: others

Post on 16-Oct-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Continuity of functions

Continuity of functions

Introduction

Continuous functions are a good model for the real world in that many processes arevery continuous: the change of temperature from point to point, the rate of flow ofblood in the arteries and heart, the change in inflation. Many processes can be wellapproximated by continuous functions. In addition differentiable functions are continuousand continuous functions have some very valuable properties, such as being bounded onclosed and bounded intervals. They can be generalized to apply to functions on subsets ofRn and more generally give rise to the subject of ”topology” which includes the conceptsmetric spaces and connectedness.

Perhaps the most important class of functions in the whole of mathematics is the class ofcontinuous functions. Intuitively these are those functions that can be drawn on a pieceof paper without lifting your pen off the paper, ie: the graphs of these functions appearas a “single piece”.

Unfortunately the above description cannot serve as a definition. The first reason forthis is that there are continuous functions such as: f(x) := x · sin(1/x) for x 6= 0 andf(x) := 0 for x = 0 that cannot be drawn. In fact it is not possible to draw the graphof any function, not even f(x) := x. One can, at best, only approximately depict thegraph of a function. However there is an even deeper reason why the above descriptioncannot serve as a definition, namely, the functions that we are interested in map from Rinto R; which is a mathematical construct, built up from set theory. The real line is notan object of “reality” but only an object of abstraction. But even forgetting the above“technical” argument, from a completely pragmatic point of view, the above definitionis not very useful. For example, how would one go about showing that the sum of twocontinuous functions is again continuous? Or for that matter, how would one go aboutderiving any of the properties that a continuous function may or may not have?

With this preliminary discussion out of the way, let us now give the formal “mathematical”definition of continuity which hopefully captures, at the intuitive level, the notion ofcontinuity described above.

Definition: Let f : A → R be defined on a non-empty open interval A of R and letx0 ∈ A. We say that f is continuous at x0 if for each ε > 0 there exists a δ > 0 such that|f(x)− f(x0)| < ε for all x ∈ A with |x− x0| < δ. Note: this is equivalent to saying thatlim

x→x0

f(x) = f(x0).

1

Page 2: Continuity of functions

Theorem: Let f : A → R be defined on a non-empty open sub interval A of R and letx0 ∈ A. Then f is continuous at x0 in A if, and only if, for every sequence (an : n ∈ N)in A converging to x0, the sequence (f(an) : n ∈ N) converges to f(x0).

Proof: This follows directly from the sequential characterisation of a limit. 2

Definition: A function f : A → R is said to be continuous from the right at x0 ∈A if, limx→x+

0f(x) = f(x0) and is said to be continuous from the left at x0 ∈ A if,

limx→x−0f(x) = f(x0).

Theorem: Let f : A → R be defined on a non-empty open sub interval A of R and letx0 ∈ A. Then f is continuous at x0 if, and only if, f is continuous from the left and fromthe right.

Proof: The proof of this follows from our earlier work on one-sided limits 2

Definitions: Let A be a non-empty open sub interval of R and let f : A → R. We saythat f is continuous on A (or simply continuous) if f is continuous at every point of A.A function f : [a, b] → R is said to be continuous on [a, b] (or simply continuous) if it iscontinuous on (a, b), continuous from the right at a and continuous from the left at b.

Fig 1: Example f(x) = x on [1,2] is continuous on [1,2).

Example: Let f : R → R be defined by, f(x) := x4. Show that f is continuous on R.

Answer: Let x0 ∈ R, then limx→x0

f(x) = limx→x0

x4 = ( limx→x0

x)4 = x40 = f(x0). 2

Exercise: Let f : R → R be defined by, f(x) := 0 if x is rational and f(x) := 1 ifx is irrational. Show that f is not continuous at any point of R. Note: to completethis exercise you need to know every non empty open interval of real numbers containsa rational and an irrational number. In other words the rational and irrational numbersare ”dense” in R.

Example: Use an ε - δ argument to show that the function f : (0,∞) → R defined by,f(x) :=

√x is continuous on (0,∞).

Let 0 < a so a ∈ (0,∞). Given ε > 0 we want |f(x)−√

a| < ε. This true

⇐⇒ |√

x−√

a| < ε

⇐⇒ |x− a|√x +

√a

< ε

2

Page 3: Continuity of functions

But|x− a|√x +

√a

<|x− a|√

a,

so let δε = ε√

a. With this choice, if |x− a| < δε we have |f(x)− f(a)| < ε. To show thiswe need a chain of implications:

Because |x− a| < δε

⇒ |x− a| < e√

a

⇒ |x− a|√x +

√a

<|x− a|√

a< ε

⇒ |f(x)− f(a)| < ε.

Therefore f is continuous at x = a. Since this is true for every a in the open interval(0,∞), f is continuous on (0,∞).

Theorem: Let f : A → R and g : A → R be defined on a non-empty open sub intervalsA of R and let x0 ∈ A. If both f and g are continuous at x0 then;

(i) f + g is continuous at x0;

(ii) c · f is continuous at x0;

(iii) f · g is continuous at x0;

(iv) f ÷ g is continuous at x0, provided g(x0) 6= 0.

Proof: The proof of this follows from our earlier results on limits. 2

Corollary: Let p and q be polynomials. Then the function r : A → R defined by,r(x) := p(x)/q(x) is continuous on A, where A := {x ∈ R : q(x) 6= 0}.Example: It follows from this that functions like f(x) = 1 + x2 and g(x) = 1/(1 + x2)are continuous on R. We can get other continuous functions by restricting their domains:If B ⊂ A and f is continuous on A then f is continuous on B. For example the functiong defined above is continuous if restricted to the open interval (0, 1).

This is a useful idea and can become even more useful if the following lemma is employed:

Theorem: If functions f and g are such that f(x) = g(x) on (a, b) and limx→b− f(x) = Lthen limx→b− g(x) = L

Fig 2: Example g is continuous on [0,2]

3

Page 4: Continuity of functions

Theorem: If f : (a, b) → R is continuous and there is a point c with a < c < b withf(x) > 0 then there is a δ > 0 such that f(x) > 0 for x ∈ (c− δ, c + δ).

Proof: Since f is continuous at c, let ε = f(c)/2 > 0 in the definition. There is a δε > 0such that

−f(c)

2< f(x)− f(c) <

f(c)

2for x ∈ (a, b) with |x− c| < δε. Using the left hand member we get

0 <f(c)

2< f(x)

so f(x) is strictly positive for −δε < x− c < δε ⇐⇒ x ∈ (c− δε, c + δe). 2

Theorem: Let f : A → B and g : B → R be defined on non-empty open subsets A andB of R. If f is continuous at x0 ∈ A and g is continuous at f(x0) then g ◦ f is continuousat x0.

Proof: Let ε be any positive real number. Now since g is continuous at f(x0) there existsa δ′ > 0 such that |g(y)− g(f(x0))| < ε for all y ∈ B with |y − f(x0)| < δ′. Next, we setε′ := δ′ and obtain from the continuity of f at x0 a δ > 0 such that |f(x)−f(x0)| < ε′ = δ′

for all x ∈ A with |x−x0| < δ. Hence, |(g ◦f)(x)− (g ◦f)(x0)| = |g(f(x))− g(f(x0))| < εfor all x ∈ A with |x− x0| < δ. 2

Some theorems on continuous functions

Theorem: Let f : A → R be defined on a non-empty open sub interval A of R and letx0 ∈ A. If f is continuous at x0 then there exists an M > 0 and δ > 0 so that |f(x)| 6 Mfor all x ∈ A with |x− x0| < δ.

Proof: Let ε = 1 so for x in an interval about x0,

|f(x)| = |f(x)− f(x0) + f(x0)|6|f(x)− f(x0)|+ |f(x0)|61 + |f(x0)|,

so we let M = 1 + |f(x0)|. 2

Definition: A function f : [a, b] → R is said to be bounded on [a, b] if there exists anM > 0 such that |f(x)| 6 M for all x ∈ [a, b].

Fig 3: An unbounded continuous function on (0, 1].

4

Page 5: Continuity of functions

Theorem: (Boundedness Theorem) Suppose that a < b and f : [a, b] → R is continuouson [a, b]. Then f is bounded on [a, b].

Proof: Let S := {x ∈ [a, b] : f is bounded on [a, x]}.1. The set S is non-empty since a ∈ S.

2. Also S is bounded above by b. Therefore s := supS exists.

3. We claim that s = b: Indeed, if s < b then we may choose 0 < δ < min{s− a, b− s} sothat f is bounded on (s− δ, s + δ). Now f is bounded on [a, s− δ] and so f is boundedon [a, s + δ/2] ⊆ [a, s− δ] ∪ (s− δ, s + δ); which contradicts that s is an upper bound forS. Hence s = b.

4. Now f is continuous from the left at b and so there exists a 0 < δ such that fis bounded on (b − δ, b]. However f is also bounded on [a, b − δ] and so bounded on[a, b− δ] ∪ (b− δ, b] = [a, b]. 2

Theorem: (Continuous functions on closed intervals attain their bounds) Suppose thata < b and f : [a, b] → R is continuous on [a, b]. Then there exist points x1, x2 ∈ [a, b] suchthat f(x1) = sup{f(x) : x ∈ [a, b]} and f(x2) = inf{f(x) : x ∈ [a, b]}.Proof: We shall only prove that there exists an x1 ∈ [a, b] such that f(x1) = sup{f(x) :x ∈ [a, b]} := M .

1. Let us assume, in order to obtain a contradiction, that no such point x1 ∈ [a, b]exists. Then f(x) < M for all x ∈ [a, b] and so the function g : [a, b] → R defined by,g(x) := 1/(M − f(x)) is continuous.

2. Now by the previous theorem there exists a K > 0 such that g(x) 6 K for all x ∈ [a, b],ie: 1/K 6 M − f(x) or, f(x) 6 M − (1/K) for all x ∈ [a, b].

3. Hence M − (1/K) < M is an upper bound for {f(x) : x ∈ [a, b]}; which is impossiblesince M was defined to have been the “least upper bound” for {f(x) : x ∈ [a, b]}.4. Hence there must be some point x1 ∈ [a, b] such that f(x1) = M . 2

Theorem: (Intermediate Value Theorem) Suppose that a < b and f : [a, b] → R iscontinuous on [a, b]. If f(a) and f(b) have opposite signs then there exists a point x0 in(a, b) such that f(x0) = 0.

Fig 4: The Intermediate Value Theorem

5

Page 6: Continuity of functions

Proof: 1. Suppose that f(a) < 0 < f(b).

2. Let S := {x ∈ [a, b] : f(x) < 0}.

3. The set S is non-empty since a ∈ S.

4. Also S is bounded above by b. Therefore, s := supS 6 b exists.

5. We claim that f(s) := 0. To see this, note that

(i) if f(s) < 0 then there exists a δ > 0 such that f(y) < 0 for all y ∈ (s− δ, s + δ);

(ii) if f(s) > 0 then there exists a δ > 0 such that f(y) > 0 for all y ∈ (s− δ, s + δ).

So in either case we obtain a contradiction.

6. Therefore, it must be the case that f(s) = 0. The proof for the case when f(b) < 0 <f(a) is similar. 2

Theorem: (Bolzano Intermediate Value Theorem) Suppose that a < b and f : [a, b] → Ris continuous on [a, b]. If f(a) < y0 < f(b) (or vice versa) then there exists a pointx0 ∈ (a, b) such that f(x0) = y0.

Proof: Consider the function g : [a, b] → R defined by, g(x) := f(x) − y0. Then g(a)and g(b) have opposite signs and so there exists a point x0 ∈ (a, b) such that g(x0) =f(x0)− y0 = 0. Therefore, f(x0) = y0. 2

Example: Show that there exists an x0 ∈ (0, 1) such that cos(x0) = x0.

Answer: Let f : [0, 1] → R be defined by, f(x) := cos(x) − x. Then f is a continuousfunction on [0, 1] and f(1) < 0 < f(0). Therefore, by the intermediate value theoremthere exists a point x0 ∈ (0, 1) such that f(x0) = 0, ie: cos(x0) = x0. 2

Fig 5: Using the Intermediate value theorem to show a root exists.

Exercise: Suppose that a < b and f : [a, b] → R is continuous on [a, b]. Show thatf([a, b]) is a closed interval of R. Hint: show that f([a, b]) = [m, M ], where m := inf{f(x) :x ∈ [a, b]} and M := sup{f(x) : x ∈ [a, b]}.

6

Page 7: Continuity of functions

Monotone functions

Definition: Let f : A → R be defined on a non-empty open subset A of R. Then wesay that f is increasing (strictly increasing) if f(x1) 6 f(x2) (f(x1) < f(x2)) wheneverx1 < x2. Similarly, we say that f is decreasing (strictly decreasing) if f(x2) 6 f(x1)(f(x2) < f(x1)) whenever x1 < x2.

Fig 6: A generic monotonically increasing function.

Theorem: Suppose that a < b and f : [a, b] → R is increasing on [a, b]. Let x0 ∈ (a, b)then lim

x→x−0

f(x) and limx→x+

0

f(x) exist and limx→x−0

f(x) 6 f(x0) 6 limx→x+

0

f(x).

Proof: We shall show that limx→x−0f(x) 6 f(x0).

1. Let S := {f(x) : a 6 x < x0}.2. Then S is non-empty (since f(a) ∈ S) and bounded above by f(x0). Hence s :=supS 6 f(x0) exists.

3. We claim that limx→x−0f(x) = s. To justify this, let us consider ε, an arbitrary positive

real number. Now s−ε, is not an upper bound for the set S as s is the least upper boundfor S. Hence there exists an element xε ∈ [a, x0) such that s− ε < f(xε).

4. Set δ := x0 − xε > 0 then s− ε < f(xε) 6 f(x) 6 s < s + ε for all x ∈ (x0 − δ, x0), ie:−ε < f(x)− s < ε for all x ∈ (x0 − δ, x0) and so |f(x)− s| < ε for all x ∈ (x0 − δ, x0).

5. The proof that f(x0) 6 limx→x+

0

f(x) is similar. 2

Corollary: Suppose that a < b and f : [a, b] → R is increasing on [a, b]. Let x0 ∈ (a, b)then f is continuous at x0 if, and only if, lim

x→x+0

f(x) = limx→x−0

f(x).

Exercise: Let f : [a, b] → [c, d] be 1-to-1 and onto. Show that the inverse of f , denotedf−1 exists and maps [c, d] onto [a, b].

Example: Suppose that a < b and f : [a, b] → R is increasing on [a, b]. Then f iscontinuous if, and only if, f([a, b]) = [f(a), f(b)]:

1. If f is continuous then, by the Intermediate Value Theorem, for all y ∈ [f(a), f(b)] thereis an x ∈ [a, b] such that f(x) = y. Since f is increasing, if a6x6b then f(a)6f(x)6f(b).These facts show f([a, b]) = [f(a), f(b)].

7

Page 8: Continuity of functions

2. If f is not continuous then, by the theorem above there is an x0 in [a, b] with the limitfrom below of f strictly less than the limit from above. The ”gap” between these twovalues is missing from the range. Hence the range is not equal to [f(a), f(b)] but to someproper subset.

Fig 7: Discontinuous increasing functions are not onto an interval.

Theorem: (Continuous Inverse Theorem) Suppose that a < b and f : [a, b] → R isstrictly increasing and continuous on [a, b]. Then the inverse mapping f−1 exists and isstrictly increasing and continuous on [f(a), f(b)].

Proof:

1. First, by the Intermediate Value Theorem, and the example above, f maps [a, b] onto[f(a), f(b)].

2. Since f is strictly increasing f is 1-to-1. Hence f−1 exists.

3. Moreover, f−1 maps from [f(a), f(b)] onto [a, b].

4. Hence by the previous example, to show that f−1 is strictly increasing and continuouswe need only show that f−1 is strictly increasing. To this end, let y1 and y2 ∈ [f(a), f(b)]with y1 < y2. Then y1 = f(x1) and y2 = f(x2) for some x1, x2 ∈ [a, b]. Now f−1(y1) =x1 < x2 = f−1(y2) for if x2 6 x1 then y2 = f(x2) 6 f(x1) = y1; which contradicts theassumption that y1 < y2. 2

Fig 8: The function f(x) = x2 on [0,2] and its inverse.

8

Page 9: Continuity of functions

Exercises

1. Let f : (0,∞) → R be defined in the following way. If x is irrational then f(x) := 0 andif x is rational then we may write x in the form: m/n with m,n ∈ N and g.c.d.(m, n) = 1and define f(x) := n. Show that f is nowhere continuous on (0,∞).

2. Let f : R → R and g : R → R be continuous functions. Show that if f = g on Q thenf = g, ie: f(x) = g(x) for all x ∈ R.

3. Suppose that f : R → R is continuous on R and satisfies the algebraic relation:f(x + y) = f(x) + f(y) for all x, y ∈ R. Show that f(x) = ax for some a ∈ R and allx ∈ R. Hint: show that f(x) = f(1) · x on Q and then use the result from 2.

4. Suppose that f : R → R is continuous on R and satisfies the algebraic relation:f(x+y) = f(x) ·f(y) for all x, y ∈ R. Show that f(x) = ax for some a ∈ R and all x ∈ R.Hint: show that f(x) = f(1)x on Q and use the result from 2. as well as the fact thatx 7→ ax is continuous on R.

5. Let f : R → R be a continuous function and (an : n ∈ N) be the sequence defined by,an+1 := f(an) for all n ∈ N and a1 ∈ R. Show that if the sequence (an : n ∈ N) convergesto some point a∞ then a∞ = f(a∞). Hint: justify the equation: f( lim

n→∞an) = lim

n→∞f(an).

6. Let f : [0, 2π] → R be a continuous function. Show that if f(0) = f(2π) then thereexists a point x0 ∈ [0, π] such that f(x0) = f(x0 + π). Hint: consider the functiong : [0, π] → R defined by, g(x) := f(x)− f(x + π).

7. Let f : [a, b] → [a, b] be continuous function. Show that there exists a point x0 ∈ [a, b]such that f(x0) = x0. Hint: it may be constructive to consider the function g : [a, b] → Rdefined by, g(x) := f(x)− x.

8. Suppose that a < b and f : [a, b] → R is continuous. If f(x) > 0 for all x ∈ [a, b] showthat there exists an ε > 0 such that f(x) > ε for all x ∈ [a, b].

9. Suppose that a < b and f : [a, b] → R is continuous. If for each x ∈ [a, b] there existsa point y ∈ [a, b] such that |f(y)| 6 1/2|f(x)|. Show that there exists a point x0 ∈ [a, b]such that f(x0) = 0.

10. Let f : [a, b] → R and g : [a, b] → R be continuous functions. Show that if for eachε > 0 there exists a point xε ∈ [a, b] such that |f(xε)−g(xε)| < ε then there exists a pointx0 ∈ [a, b] such that f(x0) = g(x0).

11. Let f : R → R be defined by, f(x) := x3. Show that the inverse of f exists and isstrictly increasing and continuous on R. Hint: it may be helpful to use use the inequality,x2 + xy + y2 > (x2 − 2|xy|+ y2) + |xy| = (|x| − |y|)2 + |x||y|.12. Suppose that a < b and f : [a, b] → R is strictly decreasing and continuous on [a, b].Show that the inverse mapping f−1 exists and is strictly decreasing and continuous on[f(b), f(a)].

13. Let f : R → R be an increasing function. Show that the set D of all point wheref is discontinuous is countable. Hint: since f is increasing f is discontinuous at a pointx0 ∈ R if, and only if, f−(x0) := limx→x−0

f(x) < limx→x+0

f(x) := f+(x0). Now define

9

Page 10: Continuity of functions

the mapping r : D → Q in the following way. For each d ∈ D choose a rational numberrd ∈ (f−(x0), f

+(x)) and define r(d) := rd. Then show that r is 1-to-1.

14. Let {rn : n ∈ N} be an enumeration of the rational numbers and define f : R → Rby, f(x) :=

∑rn<x 1/2n, ie: the sum is taken over all n ∈ N such that rn < x.

(a) Show that f is strictly increasing on R.

(b) Show that f is discontinuous at each point of Q.

(c) Show that f is continuous at each irrational number.

10

Page 11: Continuity of functions

Differentiation

Introduction

Definition: Suppose that a < b and f : (a, b) → R. We say that a real number L is thederivative of f at a point x0 ∈ (a, b) if for each ε > 0 there exists a δε > 0 such that,∣∣∣∣f(x)− f(x0)

x− x0

− L

∣∣∣∣ < ε for all x ∈ (a, b) with 0 < |x− x0| < δε.

In this case we say that f is differentiable at x0 and we write f ′(x0) for L. An equivalent

way of phrasing this is: the derivative of f at x0 is f ′(x0) := limx→x0

f(x)− f(x0)

x− x0

.

Figure 9: Definition of the derivative at x0.

Example: Let f : R → R be defined by, f(x) := x2. Find the derivative of f at x0.

Answer: We claim that f ′(x0) = 2x0. Let ε be an arbitrary positive real number andset δε := ε then,∣∣∣∣f(x)− f(x0)

x− x0

− 2x0

∣∣∣∣ =

∣∣∣∣(x + x0)(x− x0)

x− x0

− 2x0

∣∣∣∣ = |x− x0| < ε

for all x ∈ R with 0 < |x− x0| < δε. Alternatively we could just use the limit laws to get

that limx→x0

f(x)− f(x0)

x− x0

= limx→x0

(x + x0) = 2x0. 2

Theorem: Suppose that a < b and f : (a, b) → R is differentiable at a point x0 ∈ (a, b).Then f is continuous at x0.

11

Page 12: Continuity of functions

Proof: Let x0 ∈ (a, b). Then,

f(x) = f(x0) +f(x)− f(x0)

x− x0

· (x− x0) for all x ∈ (a, b) with x 6= x0.

Hence, limx→x0

f(x) = limx→x0

f(x0) + limx→x0

f(x)− f(x0)

x− x0

· limx→x0

(x− x0) = f(x0). 2

Figure 10: Contrapositive: not continuous implies not differentiable

Corollary: Suppose that a < b and f : (a, b) → R is differentiable on (a, b). Then f iscontinuous on (a, b).

Proof: The proof of this follows directly from the previous theorem. 2

Important: The converse of the previous theorem is false, ie: there exist everywherecontinuous functions that are nowhere differentiable. Apparently the first such examplewas discovered by Bolzano around 1825, but was never published. The first publishedexample was due to Weierstrass in 1875, (see below). The following very bumpy functionis everywhere continuous but nowhere differentiable.

W (x) :=∞∑

n=1

cos(3nx)

2nfor all x ∈ R.

Example: Let f : R → R be defined by,

f(x) :={

x sin(1/x) x 6= 0;0 x = 0.

Show that the function f is continuous but not differentiable at x0 = 0.

Answer: It follows from the sandwich theorem (for functions) that f is continuous at 0.We now show that f is not differentiable at x0 = 0.

limx→0

f(x)− f(x0)

x− x0

= limx→0

f(x)− f(0)

x= lim

x→0sin(1/x); which does not exist.

12

Page 13: Continuity of functions

Hence f is not differentiable at x0 = 0. 2

Figure 11: A continuous non-differentiable function at x = 0.

Exercise: Let f : R → R be defined by,

f(x) =

{x2 sin(1/x) x 6= 0;0 x = 0.

Show that f is differentiable at x0 = 0 and f ′(x0) = 0.

Definition: Suppose that a < b and f : (a, b) → R. We say that a real number L is theright-hand derivative of f at a point x0 ∈ (a, b) if for each ε > 0 there exists a δ > 0 suchthat, ∣∣∣∣f(x)− f(x0)

x− x0

− L

∣∣∣∣ < ε for all x ∈ (a, b) with x0 < x < x0 + δ.

Definition: We say that a real number L is the left-hand derivative of f at x0 if for eachε > 0 there exists a δ > 0 such that,∣∣∣∣f(x)− f(x0)

x− x0

− L

∣∣∣∣ < ε for all x ∈ (a, b) with x0 − δ < x < x0.

We shall denote by f ′+(x0) the right-hand derivative of f at x0 and by f ′−(x0) the left-handderivative of f at x0. Hence in this notation we have that,

f ′+(x0) = limx→x+

0

f(x)− f(x0)

x− x0

and f ′−(x0) = limx→x−0

f(x)− f(x0)

x− x0

.

Theorem: Suppose that a < b and f : (a, b) → R. Then the function f is differentiableat a point x0 ∈ (a, b) if, and only if, both the left-hand and right-hand derivatives of f atx0 exist and f ′−(x0) = f ′+(x0).

Proof: The proof of this result is left as an exercise for the reader. 2

Example: Let f : R → R be defined by, f(x) := |x|. Show that f is not differentiableat x0 = 0.

Answer: It is easy to see that both f ′−(0) and f ′+(0) exist, but that f ′(0) does not since,−1 = f ′−(0) 6= f ′+(0) = 1. 2

13

Page 14: Continuity of functions

Example: Let a function f(x) on [-1,2] be defined in three parts: f(x) = 0 for −16x60,f(x) = 3x2 − 2x3 for 0 < x < 1 and f(x) = 1 for 16x62. Then f is continuous anddifferentiable on [-1,2].

Figure 12: A differentiable function defined piecewise.

Rules for differentiation

The basic rules for differentiation should be familiar to you from first year. However,below we present the details of their proofs.

Theorem: Suppose that a < b and f : (a, b) → R and g : (a, b) → R are differentiableat a point x0 ∈ (a, b) then;

(i) (f + g)′(x0) = f ′(x0) + g′(x0);

(ii) (c · f)′(x0) = c · f ′(x0);

(iii) (f · g)′(x0) = f ′(x0) · g(x0) + f(x0) · g′(x0);

(iv) (f ÷ g)′(x0) = [f ′(x0) · g(x0)− f(x0) · g′(x0)]/g2(x0), provided g(x0) 6= 0.

Proof: Part (i) follows from,

(f + g)′(x0) = limx→x0

[f(x) + g(x)]− [f(x0) + g(x0)]

x− x0

= limx→x0

(f(x)− f(x0)

x− x0

+g(x)− g(x0)

x− x0

)= lim

x→x0

f(x)− f(x0)

x− x0

+ limx→x0

g(x)− g(x0)

x− x0

= f ′(x0) + g′(x0).

Part (ii) is very simple and is left as an exercise for the reader.

Part (iii) follows from,

(f · g)′(x0) = limx→x0

f(x) · g(x)− f(x0) · g(x0)

x− x0

14

Page 15: Continuity of functions

= limx→x0

(f(x)− f(x0)

x− x0

· g(x) + f(x0) ·g(x)− g(x0)

x− x0

)= lim

x→x0

f(x)− f(x0)

x− x0

· limx→x0

g(x) + f(x0) · limx→x0

g(x)− g(x0)

x− x0

= f ′(x0)g(x0) + f(x0)g′(x0).

We shall prove part (iv) by proving that the derivative of 1/g at x = x0 is given by,−g′(x0)/g

2(x0). The result will then follow from part (iii). Now,

(1/g)′(x0) = limx→x0

1/g(x)− 1/g(x0)

x− x0

= limx→x0

(g(x)− g(x0)

x− x0

· −1

g(x)g(x0)

)= lim

x→x0

g(x)− g(x0)

x− x0

· limx→x0

−1

g(x)g(x0)

= − g′(x0)

g2(x0). 2

Theorem: (Chain Rule) Let f : A → B and g : B → R be defined on non-empty opensubsets A and B of R. If f is differentiable at x0 ∈ A and g is differentiable at f(x0) theng ◦ f is differentiable at x0 and (g ◦ f)′(x0) = g′(f(x0)) · f ′(x0).

Proof:

1. Define H : B → R by,

H(y) :=

g(y)− g(f(x0))

y − f(x0)y 6= f(x0);

g′(f(x0)) y = f(x0).

2. Now limy→f(x0)

H(y) = g′(f(x0)) = H(f(x0)) and so H is continuous at f(x0).

3. Moreover, we have that (g ◦f)(x)− (g ◦f)(x0) = H(f(x)) · [f(x)−f(x0)] for all x ∈ A.

4. It follows from 3. that

(g ◦ f)′(x0) = limx→x0

(g ◦ f)(x)− (g ◦ f)(x0)

x− x0

= limx→x0

H(f(x)) · [f(x)− f(x0)]

x− x0

= limx→x0

H(f(x)) · limx→x0

f(x)− f(x0)

x− x0

= g′(f(x0)) · f ′(x0). 2

15

Page 16: Continuity of functions

Figure 13: Situations where we need the function H.

Properties of differentiable functions

Theorem: (Rolle’s Theorem) Suppose that a < b and f : [a, b] → R is continuous on[a, b]. If f(a) = f(b) and f is differentiable on (a, b) then there exists a point x0 ∈ (a, b)such that f ′(x0) = 0.

Figure 14: Rolle’s Theorem

Proof:

1. If f is constant on [a, b] then f ′(x) ≡ 0 on (a, b). Hence we may suppose that f is notconstant on [a, b].

2. Therefore, either (i) max{f(x) : x ∈ [a, b]} > f(a) = f(b) or (ii) min{f(x) : x ∈[a, b]} < f(a) = f(b). We shall only consider case (i) as case (ii) is similar.

3. Choose x0 ∈ (a, b) such that f(x0) = sup{f(x) : x ∈ [a, b]}. Then since f(x) 6 f(x0)for all x ∈ [a, b], (f(x)− f(x0))/(x− x0) 6 0 for all x ∈ [a, b] with x0 < x.

4. Therefore, f ′+(x0) = limx→x+0(f(x)− f(x0))/(x− x0) 6 0.

5. On the other hand, f(x) − f(x0) 6 0 for all x ∈ [a, b] with x < x0 and so (f(x) −f(x0))/(x− x0) > 0 for all x ∈ [a, b] with x < x0.

16

Page 17: Continuity of functions

6. Therefore, f ′−(x0) = limx→x−0(f(x)− f(x0))/(x− x0) > 0.

7. Now since f is differentiable at x0, f ′+(x0) = f ′−(x0) and so

f ′(x0) = f ′+(x0) = f ′−(x0) = 0.

2

Exercise: Let f : [−1, 1] → R be defined by, f(x) := (x + 1)m(x − 1)n. Show thatf ′(x0) = 0, where x0 := (m− n)/(m + n).

Example: Consider the function f : [−1, 1] → R defined by, f(x) := |x|. Show thatf ′(x) never equals 0. Does this contradict Rolle’s theorem?

Answer: First, note that f ′(0) does not exist and f ′(x) = 1 if x > 0 and f ′(x) = −1 ifx < 0. Therefore, f ′(x) never equals 0. However, this does not contradict Rolle’s theorem,because although f is continuous on [−1, 1] and f(−1) = f(1), f is not differentiable on(−1, 1). 2

Figure 15: Continuity on [a,b] is needed for Rolle’s Theorem.

Theorem: (Mean Value Theorem) Suppose that a < b and f : [a, b] → R is continuouson [a, b]. If f is differentiable on (a, b) then there a point x0 ∈ (a, b) such that

f ′(x0) =f(b)− f(a)

b− a.

Figure 16: Mean Value Theorem.

17

Page 18: Continuity of functions

Proof:

1. Let h : [a, b] → R be the equation of the line joining the points (a, f(a)) and (b, f(b)),ie:

h(x) :=f(b)− f(a)

b− a(x− a) + f(a).

2. Now let us consider the function g : [a, b] → R defined by g(x) := f(x)− h(x), ie: g(x)is the difference between f(x) and the line described by h.

3. Then g is continuous on [a, b], differentiable on (a, b) and g(a) = g(b).

4. Therefore by Rolle’s theorem there exists a point x0 ∈ (a, b) such that g′(x0) =

f ′(x0)− h′(x0) = 0, ie: f ′(x0) = h′(x0) =f(b)− f(a)

b− a. 2

Example: Suppose that f : R → R is differentiable. Show that f is increasing if, andonly if, f ′(x) > 0 for all x ∈ R.

Answer: Suppose that f ′(x) > 0 for all x ∈ R.

Let a, b be any real numbers such that a < b; we need to show that f(a) 6 f(b).

First we note that f is continuous on [a, b] and differentiable on (a, b). Therefore, by themean value theorem there exists a point x0 ∈ (a, b) such that

f(b)− f(a) = f ′(x0) · (b− a) > 0.

From this it follows that f(a) 6 f(b).

Conversely, suppose that f is increasing on R. Let x0 be any point in R and let x0 < x.Then f(x) > f(x0), ie: f(x)− f(x0) > 0. Therefore,

f(x)− f(x0)

x− x0

> 0

for all x > x0 and so

f ′(x0) = f ′+(x0) = limx→x+

0

f(x)− f(x0)

x− x0

> 0

. 2

Exercise: Suppose that f : R → R is differentiable. Show that f is strictly increasing if

18

Page 19: Continuity of functions

f ′(x) > 0 for all x ∈ R.

Figure 17: Positive derivative means increasing.

We now show that the derivative of an (everywhere) differentiable function satisfies anintermediate value property similar to that satisfied by continuous functions, despite thefact that f ′ may not be continuous.

Lemma: Suppose that a < b and f : [a, b] → R is differentiable at both a and b. If,

(i) f ′(a) > 0 then there exists a δ > 0 such that f(x) > f(a) for all x ∈ [a, b] witha < x < a + δ;

(ii) f ′(b) < 0 then there exists a δ > 0 such that f(x) > f(b) for all x ∈ [a, b] withb− δ < x < b.

Proof: We shall only consider case (i) as case (ii) is similar. Since f ′(a) > 0 there existsa δ > 0 such that (f(x) − f(a))/(x − a) > 0 for all a < x < a + δ. Therefore, for allx ∈ [a, b] with a < x < a + δ,

f(x)− f(a) =f(x)− f(a)

x− a· (x− a) > 0.

2

Theorem: (Darboux’s Theorem) Suppose that a < b and f : [a, b] → R is differentiableon [a, b]. If f ′(a) > k > f ′(b) (or vice versa) then there exists a point x0 ∈ (a, b) such that

19

Page 20: Continuity of functions

f ′(x0) = k.

Figure 18: Darboux’s Theorem

Proof: 1. Suppose that f ′(a) > k > f ′(b) and consider the function g : [a, b] → R definedby, g(x) := f(x)− kx.

2. Since g is continuous on [a, b], g attains its maximum value at some point x0 ∈ [a, b].

3. Moreover, since g′(a) > 0 and g′(b) < 0 it follows from the previous Lemma thatx0 ∈ (a, b).

4. The result now follows as in Rolle’s theorem by showing that g′(x0) = 0. The prooffor the case f ′(a) < k < f ′(b) is similar. 2

Theorem: (Inverse Mapping Theorem) Suppose that a < b and f : [a, b] → R. Giventhat f ′(x) > 0 for all x ∈ (a, b) then f−1 is differentiable on (f(a), f(b)) and

(f−1)′ = 1/(f ′ ◦ f−1).

Proof: 1. Let y0 ∈ (f(a), f(b)). Since f is strictly increasing there is an x0 ∈ (a, b) withf(x0) = y0. This is so if and only if f−1(y0) = x0.

2. Define a function H : [a, b] → R by,

H(x) :=

x− x0

f(x)− f(x0)x 6= x0;

1

f ′(f−1(y0))x = x0.

20

Page 21: Continuity of functions

Figure 19: Motivation for the definition of H.

3. Then

limx→x0

H(x) = 1/f ′(x0) = H(x0) = H(f−1(y0)) and so H is continuous at x0 = f−1(y0).

4. Moreover from the earlier work on continuity for monotonic functions we know thatf−1 is continuous on [f(a), f(b)]. Therefore,

1/f ′(x0) = H(x0) = H(f−1(y0)) = H

(limy→y0

f−1(y)

)= lim

y→y0

H(f−1(y))

= limy→y0

f−1(y)− f−1(y0)

y − y0

= (f−1)′(y0) 2

Example: f(x) = x2 + 1 on (0, 1) has inverse f−1(y) =√

y − 1 on (1, 2) and

(f−1)′(y) =1

2√

y − 1=

1

2x.

Remark: The hypothesis that f ′(x) > 0 for all x ∈ (a, b) is essential. In fact if f isstrictly increasing and differentiable on (a, b) but f ′(x0) = 0 for some x0 ∈ (a, b) then theinverse, f−1 is not differentiable at f(x0). Indeed, if f−1 were differentiable at f(x0) thenby the chain rule we would have, 1 = (f−1 ◦ f)′(x0) = (f−1)′(f(x0)) · f ′(x0) = 0; whichis impossible. Therefore, f−1 cannot be differentiable at f(x0). The function f(x) := x3

is strictly increasing and differentiable on R however x 7→ 3√

x (the inverse of f) is not

21

Page 22: Continuity of functions

differentiable at f(0) = 0.

Figure 20: Differentiable function with a non differentiable inverse.

Theorem: (Cauchy’s Mean Value Theorem). Suppose that a < b and f : [a, b] → Rand g : [a, b] → R are continuous on [a, b] and differentiable on (a, b). If g′(x) 6= 0 for allx ∈ (a, b) then there exists a point x0 ∈ (a, b) such that

f(b)− f(a)

g(b)− g(a)=

f ′(x0)

g′(x0).

Proof: Consider the auxiliary function h : [a, b] → R defined by the 3× 3 determinant,

h(x) :=

∣∣∣∣∣∣f(x) g(x) 1f(a) g(a) 1f(b) g(b) 1

∣∣∣∣∣∣ .

Now h is continuous on [a, b] and differentiable on (a, b) and h(a) = h(b) = 0 so by Rolle’stheorem there exists a point x0 ∈ (a, b) such that h′(x0) = 0; that is,

∣∣∣∣∣∣f ′(x0) g′(x0) 0f(a) g(a) 1f(b) g(b) 1

∣∣∣∣∣∣ = 0.

ie: f ′(x0) · [g(b) − g(a)] = g′(x0) · [f(b) − f(a)]. Now since g′(x) 6= 0 for all x ∈ (a, b),Rolle’s theorem tells us that g(b)− g(a) 6= 0 and so the result follows. 2

Remark: Cauchy’s mean value theorem has a geometric interpretation. If we considerthe curve defined by the parametric equation α(t) := (f(t), g(t)), t ∈ [a, b]. Then theconclusion of the theorem is that there exists a point (f(x0), g(x0)) on the curve such thatthe slope, g′(x0)/f

′(x0) of the tangent line to the curve at that point is equal to the slope

22

Page 23: Continuity of functions

of the line segment joining the end points of the curve.

Figure 21: Cauchy’s Mean Value Theorem interpreted.

The next theorem has sometimes been said to be the most important in Calculus orAnalysis. We use the notation for higher derivatives, f (0)(x) = f(x), f (1)(x) = f ′(x) and,in general for n ∈ N, f (n+1)(x) = (f (n))′(x). If f (n) is differentiable on an interval, thenf (n+1) exists on the interval.

Theorem: (Taylor’s Theorem) Suppose that a < b and f : [a, b] → R. If f (n) is con-tinuous on [a, b] and differentiable on (a, b) then for each x ∈ (a, b] there exists a pointζ ∈ (a, x) such that f(x) = Pn(x) + Rn(x), where

Pn(x) := f(a) +n∑

k=1

f (k)(a)(x− a)k

k!and Rn(x) := f (n+1)(ζ)

(x− a)n+1

(n + 1)!.

Note: The conclusion of the Mean Value Theorem can be written

f(x) = f(a) + f (1)(ζ)(x− a)1 = P0(x) + R0(x),

so can be regarded as Taylor’s Theorem of order 0.

Proof: 1. Fix x0 ∈ (a, b] and define M ∈ R by,

f(x0) = f(a) +n∑

k=1

f (k)(a)(x0 − a)k

k!+ M · (x0 − a)n+1

(n + 1)!

We need to show that there exists a ζ ∈ (a, x0) such that f (n+1)(ζ) = M .

2. Consider the auxiliary function g : [a, x0] → R defined by,

g(x) := −f(x0) + f(x) +n∑

k=1

f (k)(x)(x0 − x)k

k!+ M · (x0 − x)n+1

(n + 1)!.

3. Now g is continuous on [a, x0] and differentiable on (a, x0) and g(a) = g(x0) = 0.Therefore, by Rolle’s theorem there exists a point ζ ∈ (a, x0) such that g′(ζ) = 0.

23

Page 24: Continuity of functions

4. But

g′(x) = f ′(x) +n∑

k=1

{f (k+1)(x)

(x0 − x)k

k!− f (k)(x)

(x0 − x)k−1

(k − 1)!

}−M · (x0 − x)n

n!

=(x0 − x)n

n!· {f (n+1)(x)−M} for all x ∈ (a, x0).

Therefore, f (n+1)(ζ) = M . This completes the proof. 2

In Taylor’s theorem the polynomial Pn(x) is called the n-th degree Taylor polynomial forf at a and Rn(x) is called the Lagrange remainder.

Suppose that a < b and f : [a, b] → R. If for each fixed x ∈ [a, b],

limn→∞

Rn(x) = 0.

Then for each x ∈ [a, b], the series of powers (a so-called power series),

∞∑n=0

f (n)(a)(x− a)n

n!

converges to f(x).

Functions with this property are common, e.g. ex, sin(x), polynomials, rational functions.They are called real analytic.

Figure 22: Convergence of higher order Taylor polynomials to a real analytic function.

24

Page 25: Continuity of functions

L’Hospital’s Theorems

Recall that if limx→x0

f(x) = L1 and limx→x0

g(x) = L2, then

limx→x0

f(x)

g(x)=

L1

L2

, provided L2 6= 0.

We now look into the case when L1 = L2 = 0 (there’s no point in considering the caseL1 6= 0 and L2 = 0 since the limit will be ±∞).

Theorem: Suppose that a < b and f : [a, b] → R and g : [a, b] → R. If f(x0) = g(x0) = 0,g′(x0) 6= 0 and both f ′(x0) and g′(x0) exist at some point x0 ∈ (a, b), then

limx→x0

f(x)

g(x)=

f ′(x0)

g′(x0).

Proof: The trick in this proof is to multiply and divide by (x− x0).

limx→x0

f(x)

g(x)= lim

x→x0

f(x)− f(x0)

g(x)− g(x0)

= limx→x0

(f(x)− f(x0)

x− x0

)·(

x− x0

g(x)− g(x0)

)= f ′(x0)/g

′(x0). 2

Theorem: Suppose that a < b and f : [a, b] → R and g : [a, b] → R are continuous on[a, b]. Let x0 be any point in (a, b) such that f(x0) = g(x0) = 0 and g′(x) 6= 0 for allx 6= x0. Then,

limx→x0

f(x)

g(x)= lim

x→x0

f ′(x)

g′(x), whenever the limit on the right exists

Proof: By Cauchy’s mean value theorem there exists for each x ∈ (a, b) a point ζx

between x0 and x such that

f(x)

g(x)=

f(x)− f(x0)

g(x)− g(x0)=

f ′(ζx)

g′(ζx).

Then

limx→x0

f(x)

g(x)= lim

x→x0

f(x)− f(x0)

g(x)− g(x0)= lim

x→x0

f ′(x)

g′(x),

because when x tends to x0, ζx tends to x0 . 2

Notes: 1. The previous theorem is also true when limx→x0

f(x) = ±∞ and limx→x0

g(x) = ±∞and may also be extended to the case when x0 is replaced by ±∞.

2. It can also be iterated by replacing f ′ by f ′′ and g′ by g′′ e.t.c for higher orderderivatives. If

f(x0) = f ′(x0) = g(x0) = g′(x0)

and the limit of the ratio of the second derivatives exists then

limx→x0

f(x)

g(x)= lim

x→x0

f ′(x)

g′(x)= lim

x→x0

f ′′(x)

g′′(x).

25

Page 26: Continuity of functions

Exercises

1. Calculate the derivative of the function f : R → R defined by, f(x) := x3.

2. Consider the function f : (0,∞) → R defined by, f(x) := loge(x). Show that theinverse of f exists and is differentiable. Moreover, show that (f−1)′(x) = f−1(x) for allx ∈ R. Note: the function f−1 is usually called the exponential function.

3. Let f : (0,∞) → R be defined by, f(x) := x · loge(1 + 1/x).

(a) Calculate limx→∞ f(x). Hint: Consider the derivative of the function g : (0,∞) → Rdefined by, g(x) := loge(x) at x = 1.

(b) Show that limn→∞

n · loge(1 + 1/n) = 1.

(c) By using the fact that the exponential function, x 7→ ex, is continuous show thatlim

n→∞(1 + 1/n)n = e.

4. Show that the function f : [0, π/2] → R defined by, f(x) := sin(x) has a differentiableinverse. Moreover show that (sin−1)′(x) = 1/

√1− x2.

5. Let f : [a, b] → R be continuous on [a, b] and differentiable on (a, b). Show that f is aconstant function if, and only if, f ′(x) ≡ 0 on (a, b).

6. Let f : R → R differentiable. Show that if f ′ : R → R is increasing on R then f ′ iscontinuous on R. Hint: use the fact that an increasing function is continuous if, and onlyif, it satisfies the intermediate value property, (see the section on continuity).

7. Let f : R → R and let x0 ∈ R. If f ′′ exists and is continuous on R and (i) f ′(x0) = 0;(ii) f ′′(x0) > 0. Show that f has a local minimum at x0. Hint: Consider the 1st orderTaylor’s expansion of f around x0, (with remainder).

8. (Taylor’s Theorem) Suppose that a < b and f : [a, b] → R. If f (n) is continuous on[a, b] and differentiable on (a, b) then for each x0 ∈ (a, b] there exists a point ζ ∈ (a, x0)such that f(x0) = Pn(x0) + Rn(x0), where

Pn(x0) := f(a) +n∑

k=1

f (k)(a)(x0 − a)k

k!and Rn(x0) := f (n+1)(ζ)

(x0 − ζ)n(x0 − a)

n!

Hint: Consider the auxiliary function g : [a, b] → R defined by,

g(x) := −f(x0) + f(x) +n∑

k=1

f (k)(x)(x0 − x)k

k!+ M · (x0 − x).

9. Let I := [a, b] and let f : I → R be differentiable on I. Suppose that f(a) < 0 < f(b)and that there exist m, M such that 0 < m 6 f ′(x) 6 M for all x ∈ I. Let x1 ∈ Ibe arbitrary and define xn+1 := xn − f(xn)/M for all n ∈ N. Show that the sequence(xn : n ∈ N) is well defined and converges to the unique zero r ∈ I of f . Hint: ifφ(x) := x− f(x)/M , show that 0 6 φ′(x) 6 1−m/M < 1 and that φ([a, b]) ⊆ [a, b].

10. Calculate the following limits.

(a) limx→0

tan−1(x)

x; (b) lim

x→0

sin(x)

x; (c) lim

x→0

ex − 1

x; (d) lim

x→0

1− cos(x)

x2.

26