**Maintainer:**admin

*1*Locations of roots¶

Say we have a continuous function on a closed, bounded interval. We know at some point it is positive, and at another point, negative. Intuitively we understand it must have some root then - a point at which the function is 0. Intuition isn't enough though - let's prove this:

**Theorem:** Let $I = [a, b]$ be a closed, bounded interval and $f : I \to \mathbb{R}$ be continuous on $I$. If $f(a) < 0 < f(b)$ or $f(b) < 0 < f(a)$, there exists $c \in (a, b)$ such that $f(c) = 0$.

**Proof:** WLOG^{1} assume $f(a) < 0 < f(b)$. Consider $p = \frac{a+b}{2}$, the midpoint of the interval $[a, b]$. If $f(p) = 0$, we're done. Else, either $f(p) > 0$ or $f(p) < 0$. If $f(p) > 0$, consider the interval $[a, p]$. If $f(p) < 0$, consider $[p, b]$. In either case, we end up with a new interval $I_1 = [a_1, b_1]$, with $I_1 \subseteq I$. Once again, we consider the midpoint, $p_1 = \frac{a_1 + b_1}{2}$. If $f(p_1) = 0$, we're done, otherwise, we repeat the process, in general obtaining a new interval $I_n = [a_n, b_n]$ such that $I_n \subseteq I_{n-1}$ while $f(a_n) < 0$ and $f(b_n) > 0$ (assuming our process never ends by finding a midpoint $p_n$ such that $f(p_n) = 0$). We end up with a sequence of nested closed, bounded intervals, so by the Nested Intervals Property (2.5.2) there exists a common point $c$ in each interval.

Based on our method of creating intervals, the interval $I_n$ has length $b_n - a_n = \frac{b - a}{2^{n-1}}$. Thus $\lim b_n - a_n = 0$ (which tells us that point $c$ is unique by Theorem 2.5.3, but we need to prove $f(c) = 0$). As the intervals are nested, the sequence of lower bounds $(a_n)$ is increasing, and the sequence of upper bounds $(b_n)$ is decreasing. They are both bounded, and therefore they both converge by Monotone Convergence Theorem. As a result we can say the following:

$$ 0 = \lim b_n - a_n = \lim b_n - \lim a_n \\ \therefore \lim a_n = \lim b_n = L $$

Since $c \in I_n$, it follows that $L = c$. As $f$ is continuous, $f(a_n) \to f(c)$ and $f(b_n) \to f(c)$. As $f(a_n) < 0$, $f(c) \leq 0$. As $f(b_n) > 0$, $f(c) \geq 0$. Therefore $c = 0$. $\blacksquare$

This method of zeroing in on the root is sort of like binary search.

*2*Bolzano's Intermediate Value Theorem¶

This theorem motivates a more general form - we know that for a continuous function on a closed, bounded interval, if two points in the image have opposite signs, there is necessarily a 0 in the image. What stops us from saying something similar about any point? Bolzano said nothing, and theorem'd it as follows:

**Theorem (IVT):** Let $I = [a, b]$ be a closed and bounded interval and $f : I \to \mathbb{R}$ be a continuous function on $I$. If there exists a $k \in \mathbb{R}$ such that $f(a) < k < f(b)$ or $f(b) < k < f(a)$ then there exists $c \in (a, b)$ such that $f(c) = k$.

**Proof:** If $f(a) < k < f(b)$: Consider $g(x) = f(x) - k$. $g$ is continuous on $I$. $g(a) = f(a) - k < 0$ and $g(b) = f(b) - k > 0$, thus $g(a) < 0 < g(b)$ so by location of roots there exists $c \in (a,b)$ such that $g(c) = 0$, i.e. $f(c) - k = 0$ so $f(c) = k$. If $f(b) < k < f(a)$, the proof follows similarly.

**Corollary:** Let $I = [a, b]$ be a closed and bounded interval and $f : I \to \mathbb{R}$ be a continuous function on $I$. If there exists $k \in \mathbb{R}$ such that $\inf f(I) \leq k \leq \sup f(I)$ then there exists $c \in I$ such that $f(c) = k$

**Proof:** Let $m = \inf f(I)$ and $M = \sup f(I)$. By a previous theorem, $\exists a_1, b_1$ such that $f(a_1) = m$ and $f(b_1) = M$. Apply IVT to $[\inf\{a_1, b_1\}, \sup\{a_1, b_1\}]$.^{2}

What follows from this is the fact that the image of a continuous function on a closed and bounded interval is also closed and bounded.

**Theorem:** Let $I = [a, b]$ be a closed and bounded interval and $f : I \to \mathbb{R}$ be a continuous function on $I$. Then $f(I)$ is a closed bounded interval

**Proof:** Let $m = \inf f(I)$ and $M = \sup f(I)$. Then $f(I) \subseteq [m, M]$. By a previous corollary, if $k \in [m, M]$ then there exists a $c \in I$ such that $f(c) = k$ so $k \in f(I)$ so $[m, M] \subseteq f(I)$ thus $f(I) = [m, M]$.