4.4 Continuous Functions on Compact Intervals

We will now consider functions that are defined and continuous on intervals of the form \([a,b].\) Such intervals are called compact intervals. We assume that the interval consists of more than one point, i. e., \(a < b.\) Under these assumptions we can prove the following result.

Lemma 4.6 • Bolzano’s theorem

Let \(f:[a,b] \to {\mathbb{R}}\) be continuous and let \(f(a) < 0 < f(b)\) or \(f(a) > 0 > f(b).\) Then \(f\) has a zero in \((a,b),\) i. e., there exists an \(x \in (a,b)\) such that \(f(x) = 0.\)

Proof. W. l. o. g. let \(f(a) < 0 < f(b),\) otherwise we consider the function \(-f\) instead of \(f.\) We prove the theorem with the method of nested intervals. By induction we construct intervals \(I_n = [a_n,b_n]\) such that \(I_{n+1} \subseteq I_n\) as well as \[\tag{4.1} b_n - a_n = \frac{1}{2^n}(b-a) \quad \text{and} \quad f(a_n) \le 0 \le f(b_n) \quad \text{for all } n \in {\mathbb{N}}.\]
Induction base: We show the statement for \(n = 0.\) We set \(a_0 = a\) and \(b_0 = b.\) Then we have \(b_0 - a_0 = \frac{1}{2^0}(b-a)\) and \(f(a_0) \le 0 \le f(b_0)\) (we even have the strict inequalities here).
Induction hypothesis: We assume that we have constructed an interval \(I_m\) that fulfills the conditions (4.1) for \(n=m.\)
Induction step: We construct the interval \(I_{m+1}\) with \(I_{m+1} \subseteq I_{m}\) and with (4.1) for \(n = m+1\) as follows. We set \[I_{m+1} = [a_{m+1},b_{m+1}] = \begin{cases} \left[a_m,\frac{a_m+b_m}{2}\right], & \text{if } f\left(\frac{a_m+b_m}{2}\right) \ge 0, \\ \left[\frac{a_m+b_m}{2},b_m\right], & \text{if } f\left(\frac{a_m+b_m}{2}\right) < 0. \end{cases}\] Then \(b_{m+1} - a_{m+1} = \frac{1}{2}(b_m - a_m) = \frac{1}{2^{m+1}}(b - a)\) and \(f(a_{m+1}) \le 0 \le f(b_{m+1}).\)
Because of \(I_{n+1} \subseteq I_n\) for all \(n \in {\mathbb{N}}\) and \(\lim_{n \to \infty}(b_n-a_n) = 0,\) by the nested intervals principle (Theorem 2.15) there exists an \(x \in {\mathbb{R}}\) such that \[\bigcap_{n \in {\mathbb{N}}} I_n = \{x\}\] with \(\lim_{n \to \infty} a_n = \lim_{n \to \infty} b_n = x.\) Since \(f\) is continuous we obtain \[f(x) = f \left( \lim_{n \to \infty} a_n \right) = \lim_{n \to \infty} f(a_n) \le 0 \le \lim_{n \to \infty} f(b_n) = f \left(\lim_{n \to \infty} b_n \right) = f(x).\] This means that \(f(x) = 0.\) Since \(f(a) \neq 0,\) \(f(b) \neq 0,\) and \(x \in I_0\) it follows \(x \in (a,b).\)

Example 4.11

  1. We show that every polynomial function \(p:{\mathbb{R}}\to {\mathbb{R}}\) of odd degree has a zero. It is sufficient to consider the case \[p(x) = x^k + a_{k-1}x^{k-1} + \ldots + a_1x + a_0 \quad \text{for all } x \in {\mathbb{R}},\] where \(k\) is odd. By Example 4.10 ii we have that \[\lim_{x \to -\infty} p(x) = -\infty \quad \text{and} \quad \lim_{x \to \infty} p(x) = \infty.\] Thus there exist \(a,\,b \in {\mathbb{R}}\) with \(p(a) < 0 < p(b).\) Since \(p\) is continuous, also its restriction \[\widetilde{p}: [a,b] \to {\mathbb{R}}, \quad x \mapsto p(x)\] is continuous and by Lemma 4.6 the existence of a root in \((a,b)\) can be concluded.

  2. The assumption in Lemma 4.6 that \(f\) is defined on a compact interval cannot be discarded in general. Consider, e. g., the function \[f: {\mathbb{R}}\setminus\{0\} \to {\mathbb{R}}, \quad x \mapsto \frac{1}{x}.\] Then \(f\) is continuous in \({\mathbb{R}}\setminus \{0\}\) and moreover, \[-1 = f(-1) < 0 < f(1) = 1.\] However, \(f\) has no zero in the interval \((-1,1).\) Bolzano’s theorem is not applicable in this case, since \(f\) is not defined in the entire interval \([-1,1].\)

The reason for having “degraded” Bolzano’s theorem to a lemma lies in the fact that it is a special case of the following theorem.

Theorem 4.7 • Intermediate value theorem

Let \(f:[a,b] \to {\mathbb{R}}\) be continuous and \(f(a) < c < f(b)\) or \(f(a) > c > f(b).\) Then there exists an \(x \in (a,b)\) with \(f(x) = c.\)

Proof. Let w. l. o. g. \(f(a) < c < f(b),\) the other case follows analogously. Define \(g:[a,b] \to {\mathbb{R}},\) \(x \mapsto f(x) - c.\) Then \(g\) is continuous and it holds that \[g(a) = f(a) - c < 0 < f(b) - c = g(b).\] By Bolzano’s theorem (Lemma 4.6), \(g\) has a zero \(x \in (a,b),\) i. e., \(0 = g(x) = f(x) - c.\) Then we have \(f(x) = c,\) so the result follows.

Next we consider extrema of functions. Here we first consider global extrema, local extrema will be considered later in this course. For that, we extend the definition of the supremum of a nonempty set \(M\) in such way that \(\sup M := \infty,\) if \(M\) is unbounded from above.

Definition 4.6 • Supremum, maximum, infimum, minimum of a function

Let \(D \subseteq {\mathbb{R}}\) and \(f:D \to {\mathbb{R}}.\)

  1. The supremum of \(f\) is defined as \[\sup f := \sup_{x \in D} f(x) := \sup f(D) = \sup\{ f(x)\; | \; x \in D\}.\]

  2. The supremum \(\sup f\) is called (global) maximum of \(f\), if \(\sup f \in f(D).\) We write \(\max f\) or \(\max_{x \in D} f(x).\)

In an analogous fashion we define the terms infimum and minimum of \(f\) and we write \(\inf f = \inf_{x \in D} f(x)\) and \(\min f = \min_{x \in D} f(x).\)

Inspecting the above definition it is clear that \(\sup f\) and \(\max f\) are equal to the supremum and maximum of the set \(f(D),\) i. e., the image of \(f.\) In particular, \(\sup f\) is a maximum of \(f,\) if and only if there exists an \(x_0 \in D\) with \(\sup f = f(x_0),\) i. e., the supremum is attained as a function value of \(f.\)

Example 4.12

Consider the function \(f:(0,\infty) \to {\mathbb{R}},\) \(x \mapsto \frac{1}{x}.\) Then it holds that \[\sup f = \infty \quad \text{and} \quad \inf f = 0.\] The function \(f\) does neither have a maximum nor minimum since \(f((0,\infty))\) is unbounded from above and the value \(0\) is not attained as a function value. The situation changes if we restrict \(f\) to a compact interval such as \([1,2].\) For the function \(\widetilde{f}:[1,2] \to {\mathbb{R}},\) \(x \mapsto \frac{1}{x}\) it holds that \[\sup \widetilde{f} = \max \widetilde{f} = 1 \quad \text{and} \quad \inf \widetilde{f} = \min \widetilde{f} = \frac{1}{2}.\]

In the following we will generalize the above observation and formulate it as a theorem. For this, we need the following lemma.

Lemma 4.8

Let \(M \subseteq {\mathbb{R}}\) be a nonempty set. Then there exist sequences \({(x_n)}_{n \in {\mathbb{N}}}\) and \({(y_n)}_{n \in {\mathbb{N}}}\) in \(M\) with \[\lim_{n \to \infty} x_n = \sup M \in {\mathbb{R}}\cup \{\infty\} \quad \text{and} \quad \lim_{n \to \infty} y_n = \inf M \in {\mathbb{R}}\cup \{-\infty\}.\]

Proof. We only prove the statement about the supremum, the other statement can be proved analogously.

We distinguish two cases:
Case 1: The set \(M\) is not bounded from above. In this case, for every \(n \in {\mathbb{N}},\) there exists an \(x_n \in M\) with \(x_n \ge n.\) The sequence \({(x_n)}_{n \in {\mathbb{N}}}\) defined in this way diverges properly towards \(\infty = \sup M.\)
Case 2: The set \(M\) is bounded from above. In this case we have \(s:=\sup M \in {\mathbb{R}}.\) By Theorem 1.2, for every \(n \in {\mathbb{N}}\setminus \{0\}\) there exists an \(x_n \in M\) with \[s - \frac{1}{n} < x_n \le s.\] Then by the sandwich theorem (Theorem 2.7), the sequence \({(x_n)}_{n \in {\mathbb{N}}}\) is convergent with \(\lim_{n \to \infty} x_n = s = \sup M.\)

Theorem 4.9 • Extreme value theorem

Let \(f:[a,b] \to {\mathbb{R}}\) be continuous. Then \(f\) has a maximum and a minimum, i. e., there exist \(x_{\max} \in [a,b]\) and \(x_{\min} \in [a,b]\) such that \[f(x_{\max}) = \max_{x \in [a,b]} f(x) = \sup f \quad \text{and} \quad f(x_{\min}) = \min_{x \in [a,b]} f(x) = \inf f.\]

Proof. We only show the existence of the maximum, the existence of the minimum follows analogously by considering the function \(-f\) instead of \(f.\)

By Lemma 4.8 there exists a sequence \({(y_n)}_{n \in {\mathbb{N}}}\) in \(f([a,b])\) with \[\lim_{n \to \infty} y_n = \sup f \in {\mathbb{R}}\cup \{\infty\}.\] Since \(y_n \in f([a,b])\) for each \(n \in {\mathbb{N}},\) there exists an \(x_n \in [a,b]\) such that \(y_n = f(x_n)\) for each \(n \in {\mathbb{N}}.\) In contrast to \({(y_n)}_{n \in {\mathbb{N}}},\) the sequence \({(x_n)}_{n \in {\mathbb{N}}}\) does not have to be convergent. However, as \({(x_n)}_{n \in {\mathbb{N}}}\) is a sequence in \([a,b],\) it is bounded. Hence, by the Bolzano-Weierstraß theorem (Theorem 2.12) it has a convergent subsequence \(\big( x_{n_k} \big)_{k \in {\mathbb{N}}}.\) Define \(x_{\max} := \lim_{k \to \infty} x_{n_k}.\) Then \(x_{\max} \in [a,b]\) and by the continuity of \(f\) we obtain \[f(x_{\max}) = f \left( \lim_{k \to \infty} x_{n_k} \right) = \lim_{k \to \infty} f\big(x_{n_k}\big) = \lim_{k \to \infty} y_{n_k} = \sup f.\] In particular, we obtain \(\sup f \in {\mathbb{R}}\) and \(\sup f = \max f.\)

Corollary 4.10

Let \(I \subseteq {\mathbb{R}}\) a (possibly infinite) interval and \(f: I \to {\mathbb{R}}\) be continuous. Then for every \(c \in {\mathbb{R}}\) with \(\inf f < c < \sup f\) there exists an \(x \in I\) with \(f(x) = c.\) (We use the convention \(-\infty < a < \infty\) for all \(a \in {\mathbb{R}}.\))

In particular, \(f(I)\) is an interval. If \(I\) is a compact interval, i. e., \(I = [a,b]\) for some real numbers \(a < b,\) then also \(f(I) = [\min f,\max f]\) is a compact interval.

Proof. The result follows from the intermediate value theorem (Theorem 4.7) and the extreme value theorem (Theorem 4.9) (exercise!).

Continuous functions on compact intervals even fulfill a stronger condition than the continuity. For this we need an alternative definition of continuity that characterizes the condition that small changes in the argument only lead to small changes in the function value. This definition is introduced in the next theorem where we also show that it is equivalent to the original one in Definition 4.3.

Theorem 4.11

Let \(D \subseteq {\mathbb{R}},\) \(f:D \to {\mathbb{R}},\) and \(a \in D.\) Then the following statements are equivalent:

  1. sequential continuity: The function \(f\) is continuous in \(a,\) i. e., for every sequence \({(x_n)}_{n \in {\mathbb{N}}}\) in \(D\) we have that \[\lim_{n \to \infty} x_n = a \quad \Longrightarrow \quad \lim_{n \to \infty} f(x_n) = f(a).\]

  2. \(\varepsilon\)-\(\delta\) criterion: For every \(\varepsilon > 0\) there exists a \(\delta > 0\) such that for all \(x \in D\) we have that \[|x-a| < \delta \quad \Longrightarrow \quad |f(x) - f(a)| < \varepsilon.\]

Proof. “i \(\Longrightarrow\) ii”: We show this statement by contraposition, i. e., \(\neg\)ii \(\Longrightarrow\) \(\neg\)i. Assume that ii does not hold. Then there exists an \(\varepsilon > 0\) such that for each \(\delta > 0\) there exists an \(x_\delta \in D\) with \[|x_\delta - a| < \delta, \quad \text{but} \quad |f(x_\delta) - f(a)| \ge \varepsilon.\] For each \(n \in {\mathbb{N}}\setminus \{0\}\) and \(\delta_n := \frac{1}{n}\) we choose such a \(x_{\delta_n} =: x_n.\) Then \({(x_n)}_{n \in {\mathbb{N}}}\) is a sequence in \(D\) and \(\lim_{n \to \infty} x_n = a,\) but \[|f(x_n) - f(a)| \ge \varepsilon \quad \text{for all } n \in {\mathbb{N}}\setminus\{0\}.\] Consequently, \({(f(x_n))}_{n \ge 1}\) does not converge towards \(f(a).\) Hence, \(f\) is not continuous in \(a.\)
“ii \(\Longrightarrow\) i”: Let \({(x_n)}_{n \in {\mathbb{N}}}\) be an arbitrary sequence in \(D\) with \(\lim_{n \to \infty} x_n = a.\) Let \(\varepsilon > 0\) be arbitrary. Then ii implies that there exists a \(\delta > 0\) such that for all \(x \in D\) we get \[|x-a| < \delta \quad \Longrightarrow \quad |f(x) - f(a)| < \varepsilon.\] Since \({(x_n)}_{n \in {\mathbb{N}}}\) converges towards \(a,\) we have \(|x_n-a| < \delta\) for almost all \(n \in {\mathbb{N}}.\) But then also \(|f(x_n) - f(a)| < \varepsilon\) for almost all \(n \in {\mathbb{N}}.\) Since \(\varepsilon > 0\) is chosen arbitrarily, convergence follows, i. e., \(\lim_{n \to \infty} f(x_n) = f(a).\)

As a direct consequence we obtain another important property of continuous functions.

Corollary 4.12

Let \(D \subseteq {\mathbb{R}}\) and assume that \(f:D \to {\mathbb{R}}\) is continuous in \(a \in D.\) Let \(f(a) > 0\) (or \(f(a) < 0,\) resp.). Then there exists a \(\delta > 0\) such that for all \(x \in D\) with \(|x-a| < \delta\) we also have \(f(x) > 0\) (or \(f(x)<0,\) resp.).

Proof. By the \(\varepsilon\)-\(\delta\) criterion for continuity we have that for \(\varepsilon := f(a) > 0\) there exists a \(\delta > 0\) such that for all \(x \in D\) \[|x-a| < \delta \quad \Longrightarrow \quad |f(x)-f(a)| < \varepsilon.\] But then \(f(x) > 0\) for all \(x \in D\) with \(|x-a| < \delta.\)

Home

Contents

Weeks