Chapter V · Limits of functions of a continuous variable. Continuous and discontinuous functions

Continuous functions are bounded and attain their bounds

§§103–105 40 min

On a closed interval a continuous function is bounded and takes its greatest and least values; three proofs, the oscillation of a function in an interval, and why each hypothesis is needed.

Why this matters

Does a function have a largest value? For xx on [0,1][0, 1] the answer is yes; for xx on [0,1)[0, 1) it is no, even though the values come as close to 11 as we like. In §§103–105 Hardy proves that a function continuous on a closed interval is bounded and attains its upper and lower bounds. This is the theorem behind every “find the maximum” problem, behind Rolle’s theorem and the mean value theorem in Chapter VI, and (with the oscillation introduced here) behind the existence of the integral in Chapter VII.

The idea

For any function defined on [a,b][a, b], its values form a set of numbers, and we can ask for that set’s upper bound MM (the least number that no value exceeds) and lower bound mm, as in §80 for sequences. Two things can go wrong.

  • The values may be unbounded, as for 1/x1/x on (0,1](0, 1]: no MM exists at all.
  • MM may exist but not be attained: x−[x]x - [x] on [0,1][0, 1] comes arbitrarily close to 11 (just left of x=1x = 1) but is never equal to 11, since 1−[1]=01 - [1] = 0.

Hardy’s theorems say that neither can happen to a continuous function on a closed interval. The difference M−mM - m, the oscillation of ϕ\phi on the interval, will measure how much ϕ\phi varies there.

Explore Bounds and oscillation in a window

Try this. Drag the two purple handles (or use the sliders) to choose an interval [c,d][c, d], and read off M(c,d)M(c, d), m(c,d)m(c, d) and the oscillation. Do it first for the continuous function. Then choose x−[x]x - [x] and make the window contain the integer 11 or 22. Then choose sin⁡(1/x)\sin(1/x) and make the window contain 00.

ϕ(x)=sin⁡2x+0.3x\phi(x) = \sin 2x + 0.3x on [0,4][0, 4]
xy
  • y = φ(x)
  • the interval [c, d] (drag its ends)
  • from m(c, d) up to M(c, d)
  • a bound that is not attained
On [0.8,2.2][0.8, 2.2]: M=1.247M = 1.247, m=−0.2916m = -0.2916, oscillation O=M−m=1.538O = M - m = 1.538. Both bounds are attained (at the green dots).
What to notice

For the continuous function both bounds are always attained, at the green dots. For x−[x]x - [x], as soon as the window contains an integer kk to the right of cc, the upper bound becomes 11 and is not attained: the hollow orange dot marks the place it is approached. For sin⁡(1/x)\sin(1/x), every window containing 00, however small, has M=1M = 1, m=−1m = -1 and oscillation 22: continuity fails at 00 in a way no shrinking can cure.

Precise statements

Definition Bounds of a function Hardy: §103

Let ϕ\phi be defined on [a,b][a, b]. It is bounded above if there is a KK with ϕ(x)≤K\phi(x) \le K for all xx in [a,b][a, b]. Then it has an upper bound MM: no value of ϕ\phi exceeds MM, but every number less than MM is exceeded by some value. Bounded below and the lower bound mm are defined in the same way, and ϕ\phi is bounded if it is bounded above and below.

Theorem Continuous functions are bounded Hardy: Theorem 1, §103

If ϕ\phi is continuous throughout [a,b][a, b], then it is bounded on [a,b][a, b].

Theorem Continuous functions attain their bounds Hardy: Theorem 2, §103

If ϕ\phi is continuous throughout [a,b][a, b], with upper and lower bounds MM and mm, then there are points ξ\xi and ξ′\xi' in [a,b][a, b] with ϕ(ξ)=M\phi(\xi) = M and ϕ(ξ′)=m\phi(\xi') = m.

Together with the intermediate value theorem, this says that the image of [a,b][a, b] under a continuous ϕ\phi is exactly the closed interval [m,M][m, M].

To compare intervals, Hardy writes the bounds of ϕ\phi on [a,b][a, b] as M(a,b)M(a, b) and m(a,b)m(a, b).

Definition Oscillation in an interval Hardy: §104

For ϕ\phi bounded on [a,b][a, b], the oscillation of ϕ\phi in [a,b][a, b] is

O(a,b)=M(a,b)−m(a,b).O(a, b) = M(a, b) - m(a, b).
Theorem Properties of MM, mm and OO Hardy: §104 (1)–(3)

Let a≤c≤ba \le c \le b.

  1. M(a,b)M(a, b) is the greater of M(a,c)M(a, c) and M(c,b)M(c, b), and m(a,b)m(a, b) is the lesser of m(a,c)m(a, c) and m(c,b)m(c, b).
  2. M(a,b)M(a, b) increases and m(a,b)m(a, b) decreases as bb increases; so O(a,b)O(a, b) increases with bb.
  3. O(a,b)≤O(a,c)+O(c,b)O(a, b) \le O(a, c) + O(c, b).

Proofs

Hardy proves Theorem 1 with a section, just as he proved the intermediate value theorem: look for the first point where “bounded so far” fails, and show there is none.

Proof Continuous functions are bounded
Strategy

Put ξ\xi in LL if ϕ\phi is bounded on [a,ξ][a, \xi], and in RR otherwise. We show that RR is empty. If not, (L,R)(L, R) is a section with a number β\beta; but continuity at β\beta makes ϕ\phi bounded on both sides of β\beta, which pushes β\beta further right. Contradiction.

LL contains points to the right of aa

By continuity at aa (from the right), there is an interval [a,a+h][a, a + h] on which ϕ(a)−1<ϕ(x)<ϕ(a)+1\phi(a) - 1 < \phi(x) < \phi(a) + 1. So ϕ\phi is bounded on [a,ξ][a, \xi] for every ξ≤a+h\xi \le a + h.

Suppose RR is not empty

If ϕ\phi is bounded on [a,ξ][a, \xi] it is bounded on [a,ξ′][a, \xi'] for ξ′<ξ\xi' < \xi. So every member of LL is less than every member of RR, and (L,R)(L, R) is a section with some number β\beta, a<β≤ba < \beta \le b.

Continuity at β\beta gives boundedness near β\beta

There is h>0h > 0 with ∣ϕ(x)−ϕ(β)∣<1|\phi(x) - \phi(\beta)| < 1 on [β−h,β+h][\beta - h, \beta + h] (only [β−h,β][\beta - h, \beta] if β=b\beta = b). We may take h<β−ah < \beta - a.

Contradiction

β−h\beta - h is in LL, so ϕ\phi is bounded on [a,β−h][a, \beta - h]; it is also bounded on [β−h,β+h][\beta - h, \beta + h]; hence on [a,β+h][a, \beta + h]. So β+h\beta + h is in LL, although it is to the right of β\beta and should be in RR. (If β=b\beta = b, the same argument shows ϕ\phi is bounded on [a,b][a, b], so b∈Lb \in L and RR is empty after all.) Hence RR is empty and ϕ\phi is bounded on [a,b][a, b].

Hardy’s proof of Theorem 2 is short and indirect: it turns “does not attain MM” into “is unbounded”, and applies Theorem 1.

Proof Continuous functions attain their bounds
Strategy

If ϕ\phi never equals MM, then M−ϕ(x)M - \phi(x) is a positive continuous function whose values come arbitrarily close to 00, so its reciprocal is continuous but unbounded on [a,b][a, b]. That contradicts Theorem 1.

M−ϕ(x)M - \phi(x) gets arbitrarily small

By the definition of MM, for every ε>0\varepsilon > 0 there is an xx in [a,b][a, b] with ϕ(x)>M−ε\phi(x) > M - \varepsilon, that is 0≤M−ϕ(x)<ε0 \le M - \phi(x) < \varepsilon.

Suppose ϕ(x)≠M\phi(x) \ne M for every xx

Then M−ϕ(x)>0M - \phi(x) > 0 everywhere on [a,b][a, b], and ψ(x)=1/{M−ϕ(x)}\psi(x) = 1/\{M - \phi(x)\} is continuous on [a,b][a, b] (a quotient of continuous functions whose denominator never vanishes).

ψ\psi is unbounded

At the points of the first step, ψ(x)>1/ε\psi(x) > 1/\varepsilon. As ε\varepsilon is arbitrary, ψ\psi has no upper bound, contradicting Theorem 1 applied to ψ\psi.

Conclude

So ϕ(ξ)=M\phi(\xi) = M for some ξ\xi. Applying this to −ϕ-\phi, whose upper bound is −m-m, gives a point where ϕ=m\phi = m.

Hardy calls this proof indirect and, “in view of the great importance of the theorem”, gives two more in §105. One uses a section again: let β\beta be the boundary between the points ξ\xi with M(a,ξ)<MM(a, \xi) < M and those with M(a,ξ)=MM(a, \xi) = M. Then every interval round β\beta has upper bound MM, so ϕ\phi takes values as close to MM as we please near β\beta, and continuity gives ϕ(β)=M\phi(\beta) = M. The other is repeated bisection, and it shows clearly where continuity is used.

Explore Bisecting towards the maximum

Try this. Press “Halve” and watch which half is kept: the one whose own upper bound is still MM. Jump to step 20 and read off TT and ϕ(T)\phi(T). Then switch to x−[x]x - [x] on [0.2,1.7][0.2, 1.7] and do the same.

Hunting for the upper bound M=2.189M = 2.189 of ϕ(x)=sin⁡2x+0.3x\phi(x) = \sin 2x + 0.3x on [0,4][0, 4]
xy
  • y = φ(x)
  • the upper bound M
  • current interval: its upper bound is still M
Step 0: [0, 4][0,\ 4]. At the midpoint, ϕ=−0.1568\phi = -0.1568.
What to notice

For the continuous function the intervals close on the maximum point and ϕ(T)=M\phi(T) = M. For x−[x]x - [x] the construction runs exactly the same way, every interval has upper bound 11, and the intervals close on T=1T = 1; but ϕ(1)=0\phi(1) = 0. The bisection only finds a point near which ϕ\phi comes close to MM. Continuity at that point is what turns “close to MM nearby” into “equal to MM here”.

Proof Property (3): O(a,b)≤O(a,c)+O(c,b)O(a, b) \le O(a, c) + O(c, b)
Strategy

Use property (1) to write M(a,b)M(a, b) and m(a,b)m(a, b) in terms of the two halves, and use the one point cc that the halves share to link them.

Name the four bounds

Let M1≥M2M_1 \ge M_2 be M(a,c)M(a, c) and M(c,b)M(c, b) in some order, and m1≤m2m_1 \le m_2 be m(a,c)m(a, c) and m(c,b)m(c, b). By (1), M(a,b)=M1M(a, b) = M_1 and m(a,b)=m1m(a, b) = m_1.

The shared point gives M2≥m2M_2 \ge m_2

cc belongs to both intervals, so ϕ(c)≤M2\phi(c) \le M_2 (it is at most both upper bounds) and ϕ(c)≥m2\phi(c) \ge m_2 (at least both lower bounds). Hence M2≥m2M_2 \ge m_2.

Add

O(a,b)=M1−m1≤(M1−m1)+(M2−m2)=O(a,c)+O(c,b)O(a, b) = M_1 - m_1 \le (M_1 - m_1) + (M_2 - m_2) = O(a, c) + O(c, b), since the two oscillations on the right are M(a,c)−m(a,c)M(a, c) - m(a, c) and M(c,b)−m(c,b)M(c, b) - m(c, b), whose sum equals M1+M2−m1−m2M_1 + M_2 - m_1 - m_2.

Worked examples and exercises

Exercise ●○○ Hardy: Examples XXXVIII, 1–2

Let ϕ(x)=1/x\phi(x) = 1/x for x≠0x \ne 0 and ϕ(0)=0\phi(0) = 0. Show that ϕ\phi has neither an upper nor a lower bound on [−1,1][-1, 1]. If instead ϕ(x)=1/x2\phi(x) = 1/x^2 for x≠0x \ne 0 and ϕ(0)=0\phi(0) = 0, show that the lower bound on [−1,1][-1, 1] is 00 (attained) and there is no upper bound. Which hypothesis of the theorems fails?

Hint
Look at ϕ(1/n)\phi(1/n) and ϕ(−1/n)\phi(-1/n).

Solution

1/x1/x. ϕ(1/n)=n\phi(1/n) = n and ϕ(−1/n)=−n\phi(-1/n) = -n for every positive integer nn, so no KK bounds ϕ\phi above or below.

1/x21/x^2. Every value is ≥0\ge 0 and ϕ(0)=0\phi(0) = 0, so the lower bound is 00 and is attained. But ϕ(1/n)=n2\phi(1/n) = n^2 is unbounded.

In both cases ϕ\phi is defined everywhere on the closed interval [−1,1][-1, 1] but is discontinuous at 00 (an infinity), so Theorem 1 does not apply.

Exercise Closedness is needed ●○○ Hardy: §103

Give a function continuous on the open interval (0,1)(0, 1) that is unbounded there, and one that is bounded but attains neither bound. Why do the proofs above fail?

Hint
Try 1/x1/x, and then xx itself.

Solution

1/x1/x is continuous on (0,1)(0, 1) and unbounded. xx is continuous and bounded on (0,1)(0, 1), with bounds 00 and 11, attained nowhere in the open interval.

In the proof of Theorem 1 the first step needs continuity at the end point aa to start the class LL, and the section argument needs continuity at β\beta even when β=b\beta = b. On (0,1)(0, 1) there is no point 00 or 11 to be continuous at; the “bad” point has been removed from the interval. That is why the theorems are always stated for a closed interval [a,b][a, b].

Exercise ●○○ Hardy: Examples XXXVIII, 4

Show that x−[x]x - [x] has lower bound 00 and upper bound 11 on [0,1][0, 1], that it equals 00 at x=0x = 0 and x=1x = 1, but that it never equals 11.

Hint
On [0,1)[0, 1) the function is xx. What is it at 11?

Solution

On [0,1)[0, 1), x−[x]=xx - [x] = x, and at 11 it is 1−1=01 - 1 = 0. So its values are exactly [0,1)[0, 1). No value exceeds 11, and any number 1−ε1 - \varepsilon is exceeded (by the value at x=1−12εx = 1 - \tfrac12\varepsilon), so the upper bound is 11; it is not a value. The lower bound 00 is attained at 00 and at 11. The function is discontinuous at 11, so this does not contradict Theorem 2.

Exercise ●●● Hardy: Examples XXXVIII, 5

Let ϕ(x)=0\phi(x) = 0 for irrational xx, and ϕ(p/q)=q\phi(p/q) = q when p/qp/q is a fraction in lowest terms with q>0q > 0. Show that on any interval [a,b][a, b] with a<ba < b, ϕ\phi has lower bound 00 and no upper bound.

Hint
For a fixed NN, how many fractions with denominator at most NN lie in [a,b][a, b]?

Solution

Every value is ≥0\ge 0 and irrational points give 00, so the lower bound is 00 (attained). Fix NN. A fraction p/qp/q in [a,b][a, b] with q≤Nq \le N has qa≤p≤qbqa \le p \le qb, so for each qq there are at most q(b−a)+1q(b - a) + 1 choices of pp; hence only finitely many fractions in [a,b][a, b] have denominator at most NN. But [a,b][a, b] contains infinitely many rationals, so it contains one, in lowest terms, with q>Nq > N, where ϕ=q>N\phi = q > N. As NN is arbitrary, ϕ\phi is unbounded above on [a,b][a, b], however short the interval. (This ϕ\phi is discontinuous everywhere.)

Check yourself

Check yourself Choose one

Which function is guaranteed by Theorem 2 to attain a greatest value?

Why

Theorem 2 needs continuity on a closed interval. sin⁡(x2)+x3\sin(x^2) + x^3 is continuous everywhere and [−2,5][-2, 5] is closed. 1/x1/x on (0,1](0, 1] is unbounded (the interval is not closed at 00); xx on (0,1)(0, 1) attains neither bound; x−[x]x - [x] is discontinuous at 11 and 22 and never reaches its upper bound 11.

Check yourself Enter a number

What is the oscillation of x2x^2 in the interval [−1,2][-1, 2]?

Why

On [−1,2][-1, 2], x2x^2 has least value 00 (at x=0x = 0) and greatest value 44 (at x=2x = 2). O=4−0=4O = 4 - 0 = 4. Note that the least value is not at an end point.

Check yourself True or false?

If ϕ\phi is bounded on [a,b][a, b], then ϕ\phi attains its upper bound somewhere in [a,b][a, b].

Why

False: x−[x]x - [x] on [0,1][0, 1] is bounded and never reaches its upper bound 11. Boundedness gives MM; continuity is what makes MM a value.

Check yourself Choose one

For ϕ(x)=x\phi(x) = x on [0,2][0, 2] with c=1c = 1, compare O(0,2)O(0, 2) with O(0,1)+O(1,2)O(0, 1) + O(1, 2).

Why

O(0,2)=2O(0, 2) = 2 and O(0,1)+O(1,2)=1+1=2O(0, 1) + O(1, 2) = 1 + 1 = 2: equality. For a function that goes up and comes back down, such as x(2−x)x(2 - x) on [0,2][0, 2], the inequality is strict: 1<1+11 < 1 + 1. Property (3) never allows O(0,2)O(0, 2) to be the larger.

Hardy’s language

The proof just given is indirect, and it may be well, in view of the great importance of the theorem, to indicate alternative lines of proof.

— G. H. Hardy, §103

Summary

Summary
  • A function continuous on a closed interval [a,b][a, b] is bounded (Theorem 1) and takes its upper and lower bounds as values (Theorem 2).
  • Both hypotheses are needed: 1/x1/x on (0,1](0, 1] is unbounded, x−[x]x - [x] on [0,1][0, 1] never reaches 11.
  • Proofs: a section (“bounded so far” cannot stop), an indirect argument via 1/{M−ϕ}1/\{M - \phi\}, and bisection towards a point where ϕ\phi comes close to MM, which continuity turns into ϕ=M\phi = M.
  • The oscillation O(a,b)=M(a,b)−m(a,b)O(a, b) = M(a, b) - m(a, b) grows with the interval and satisfies O(a,b)≤O(a,c)+O(c,b)O(a, b) \le O(a, c) + O(c, b).