---
title: Extreme and Intermediate Value Theorems
module: Limits and Continuity
moduleNumber: 4
lessonNumber: 3
order: 403
summary: >
  On a closed bounded interval a continuous function attains an absolute maximum
  and minimum (the extreme value theorem, compactness preserved by continuity)
  and takes every value between its endpoint values (the intermediate value
  theorem, connectedness preserved). Both proofs run through Bolzano–Weierstrass
  and bisection, and yield root-finding, existence of k-th roots, and
  fixed-point theorems.
topics: [Limits and Continuity]
sources:
  - book: Lebl
    ref: "Ch. 3 — Continuous Functions; §3.3 Extreme and intermediate value theorems"
  - book: Rosenlicht
    ref: "Ch. 4 — Continuous functions"
draft: false
---

Continuity at a point is a local condition. On a closed bounded interval it
yields two global theorems that ordinary calculus uses without proof: a
continuous function on $[a,b]$ attains a highest and a lowest value, and it takes
every height between its endpoint values. Both rest on the same property of
$[a,b]$ (it is [compact](/real-analysis/metric-spaces/compactness): closed and
bounded at once), and both are proved from
[Bolzano–Weierstrass](/real-analysis/sequences-series/limsup-bolzano-weierstrass).

## Boundedness

> **Lemma (Boundedness).** A continuous function $f : [a,b] \to \mathbb{R}$ is
> bounded.[^lebl-bdd]

> **Proof.** Argue by contrapositive. If $f$ is unbounded, choose $x_n \in [a,b]$
> with $|f(x_n)| \ge n$. The sequence $\{x_n\}$ lies in $[a,b]$, so it is
> bounded, and by Bolzano–Weierstrass it has a subsequence $x_{n_i} \to x$ with
> $x \in [a,b]$ (the limit stays in the interval because $[a,b]$ is closed). But
> $|f(x_{n_i})| \ge n_i \to \infty$, so $\{f(x_{n_i})\}$ cannot converge,
> contradicting continuity at $x$, which would force $f(x_{n_i}) \to f(x)$.

One proof template recurs below: **build a sequence with a wanted property, then
use Bolzano–Weierstrass to make it converge**, with closedness returning the
limit to the interval.

## The extreme value theorem

> **Theorem (Extreme value theorem).** A continuous function $f : [a,b] \to
> \mathbb{R}$ attains an absolute minimum and an absolute maximum on $[a,b]$:
> there exist $c, d \in [a,b]$ with $f(d) \le f(x) \le f(c)$ for all $x \in
> [a,b]$.[^lebl-evt]

> **Proof.** By the lemma the image $f([a,b])$ is a bounded set, so it has a
> supremum $M = \sup f([a,b])$ and infimum. Choose $y_n \in [a,b]$ with
> $f(y_n) \to M$. The $y_n$ need not converge, but by Bolzano–Weierstrass a
> subsequence $y_{m_i} \to c \in [a,b]$ does. Continuity and the fact that a
> subsequence shares the sequence's limit give
> $$
> M = \lim_{n\to\infty} f(y_n) = \lim_{i\to\infty} f(y_{m_i}) = f\!\left(\lim_{i\to\infty} y_{m_i}\right) = f(c),
> $$
> so the supremum is achieved at $c$. The same argument at the infimum gives $d$.

$$
% caption: On a closed bounded interval a continuous graph reaches a highest
% point at c and a lowest at d; both x-locations lie inside the interval.
\begin{tikzpicture}[scale=1.0, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black, ->] (-0.3,0) -- (7.0,0) node[anchor=north] {$x$};
\draw[black, ->] (0,-0.3) -- (0,4.2) node[anchor=east] {$y$};
% interval marks
\draw[black, thick] (0.6,0) -- (0.6,-0.12); \node[anchor=north] at (0.6,-0.1) {$a$};
\draw[black, thick] (6.2,0) -- (6.2,-0.12); \node[anchor=north] at (6.2,-0.1) {$b$};
% curve with interior max and min
\draw[acc, very thick]
  (0.6,2.2) .. controls (1.6,3.9) and (2.4,3.9) .. (3.0,3.5)
  .. controls (3.9,3.0) and (4.0,0.9) .. (4.8,0.8)
  .. controls (5.4,0.75) and (5.8,1.6) .. (6.2,1.9);
% max point
\fill[acc] (2.05,3.9) circle (1.8pt);
\draw[black, dashed] (2.05,3.9) -- (2.05,0); \node[anchor=north] at (2.05,-0.02) {$c$};
\draw[black, dashed] (2.05,3.9) -- (0,3.9); \node[acc, anchor=east] at (-0.05,3.9) {max};
% min point
\fill[acc] (4.72,0.79) circle (1.8pt);
\draw[black, dashed] (4.72,0.79) -- (4.72,0); \node[anchor=north] at (4.72,-0.02) {$d$};
\draw[black, dashed] (4.72,0.79) -- (0,0.79); \node[acc, anchor=east] at (-0.05,0.79) {min};
\end{tikzpicture}
$$

> **Worked example (extremes located).** $f(x) = x^2 + 1$ on $[-1, 2]$ achieves
> its minimum at $x = 0$, where $f(0) = 1$, and its maximum at $x = 2$, where
> $f(2) = 5$: for all $x$, $x^2 \ge 0$ gives $f(x) \ge 1 = f(0)$, and on
> $[-1,2]$, $|x| \le 2$ gives $f(x) \le 4 + 1 = f(2)$. The domain matters as
> much as the formula: on $[-10, 10]$ the same $f$ has maximum $101$ at $\pm
> 10$, and on the open $(0, 2)$ it attains neither a maximum nor a minimum,
> since $1$ and $5$ are approached but never reached.

Each hypothesis is necessary; dropping any one makes the conclusion fail.

| Failure | Example | What breaks |
| --- | --- | --- |
| Interval unbounded | $f(x) = x$ on $\mathbb{R}$ | no Bolzano–Weierstrass; no max or min |
| Interval not closed | $f(x) = 1/x$ on $(0,1)$ | limit of subsequence escapes the domain |
| $f$ not continuous | $f(x) = 1/x$ ($x>0$), $f(0)=0$ on $[0,1]$ | continuity fails at $0$; no max |

Stated topologically, the theorem is one line: the
[continuous image of a compact set is compact](/real-analysis/metric-spaces/compactness),
hence closed and bounded, hence contains its own supremum and infimum.

## The intermediate value theorem

The second theorem says a continuous function skips no values between its endpoint
heights. The proof rests on a bisection lemma that doubles as a numerical
algorithm.

> **Lemma (Sign-change root).** If $f : [a,b] \to \mathbb{R}$ is continuous with
> $f(a) < 0 < f(b)$, then $f(c) = 0$ for some $c \in (a,b)$.[^lebl-ivt]

> **Proof.** Build nested intervals $[a_n, b_n]$ by bisection. Start with
> $[a_1,b_1] = [a,b]$. Given $[a_n, b_n]$, evaluate $f$ at the midpoint
> $m_n = \tfrac{a_n + b_n}{2}$: if $f(m_n) \ge 0$ keep the left half
> $[a_n, m_n]$; otherwise keep the right half $[m_n, b_n]$. Each step preserves
> $f(a_n) < 0 \le f(b_n)$ and halves the width: $b_n - a_n = 2^{1-n}(b - a) \to
> 0$. The sequences $\{a_n\}$ and $\{b_n\}$ are monotone and bounded, so both
> converge, to a common limit $c$ by the width bound. Taking limits in
> $f(a_n) < 0$ and $f(b_n) \ge 0$ through continuity gives $f(c) \le 0$ and
> $f(c) \ge 0$, so $f(c) = 0$.

$$
% caption: Bisection brackets a root: at each step the half whose endpoints still
% straddle zero is kept, and the nested brackets shrink to the crossing point c.
\begin{tikzpicture}[scale=1.0, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\definecolor{wrn}{HTML}{B0672F}
% number line stack
\foreach \lv/\lft/\rgt/\lab in {0/0.4/7.4/1, 1/0.4/3.9/2, 2/2.15/3.9/3, 3/2.15/3.02/4} {
  \pgfmathsetmacro\yy{2.4 - \lv*0.7}
  \draw[black, thick] (\lft,\yy) -- (\rgt,\yy);
  \draw[acc, thick] (\lft,\yy+0.12) -- (\lft,\yy-0.12);
  \draw[acc, thick] (\rgt,\yy+0.12) -- (\rgt,\yy-0.12);
  \node[acc, anchor=south, font=\footnotesize] at (\lft,\yy+0.12) {$a_\lab$};
  \node[acc, anchor=south, font=\footnotesize] at (\rgt,\yy+0.12) {$b_\lab$};
}
% root marker
\draw[wrn, thick, dashed] (2.9,2.7) -- (2.9,0.0);
\fill[wrn] (2.9,0.3) circle (1.7pt);
\node[wrn, anchor=north] at (2.9,-0.05) {$c$};
\node[black, anchor=west, font=\footnotesize] at (4.4,1.4) {width halves each step};
\end{tikzpicture}
$$

> **Theorem (Intermediate value theorem).** Let $f : [a,b] \to \mathbb{R}$ be
> continuous and let $y$ lie strictly between $f(a)$ and $f(b)$. Then $f(c) = y$
> for some $c \in (a,b)$.[^lebl-ivt]

> **Proof.** Apply the lemma to $g(x) = f(x) - y$ (or $y - f(x)$, depending on
> the direction of the inequality): $g$ changes sign on $[a,b]$, so it has a root
> $c$, at which $f(c) = y$.

$$
% caption: For any target height y between the endpoint values, the graph must
% cross the level line y = target, giving a point c with f(c) = y.
\begin{tikzpicture}[scale=1.0, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\definecolor{wrn}{HTML}{B0672F}
\draw[black, ->] (-0.3,0) -- (7.0,0) node[anchor=north] {$x$};
\draw[black, ->] (0,-0.3) -- (0,4.2) node[anchor=east] {$y$};
\draw[black, thick] (0.6,0.05) -- (0.6,-0.12); \node[anchor=north] at (0.6,-0.1) {$a$};
\draw[black, thick] (6.2,0.05) -- (6.2,-0.12); \node[anchor=north] at (6.2,-0.1) {$b$};
% endpoint dots
\fill[acc] (0.6,0.9) circle (1.6pt); \node[acc, anchor=east] at (0.5,0.9) {$f(a)$};
\fill[acc] (6.2,3.5) circle (1.6pt); \node[acc, anchor=west] at (6.3,3.5) {$f(b)$};
% target level
\draw[wrn, thick] (0,2.3) -- (6.6,2.3); \node[wrn, anchor=east] at (-0.05,2.3) {$y$};
% curve crossing
\draw[acc, very thick] (0.6,0.9) .. controls (2.0,3.4) and (2.6,0.9) .. (3.6,1.9)
  .. controls (4.6,2.9) and (5.2,2.0) .. (6.2,3.5);
\fill[wrn] (3.05,2.3) circle (1.8pt); \node[wrn, anchor=north west] at (3.1,2.25) {$c$};
\draw[black, dashed] (3.05,2.3) -- (3.05,0);
\end{tikzpicture}
$$

Stated topologically, IVT is that the
[continuous image of a connected set is connected](/real-analysis/metric-spaces/connectedness):
$f([a,b])$ is an interval, and an interval containing $f(a)$ and $f(b)$ contains
everything between. Sharpening the boundedness lemma and IVT together yields that
the direct image $f([a,b])$ is itself a closed bounded interval (or a single
point).

## Applications

### Bisection as an algorithm

The proof of the sign-change lemma is a root-finder. It converges for **any**
continuous function, needs only sign evaluations, and reaches any target
precision in finitely many steps.

```algorithm
caption: $\textsc{Bisect}(f, a, b, \tau)$ — bracket a root of a continuous $f$ with $f(a)\,f(b) < 0$
while $b - a > \tau$ do
  $m \gets (a + b) / 2$
  if $f(m) = 0$ then
    return $m$
  else if $f(a) \cdot f(m) < 0$ then
    $b \gets m$          // root lies in the left half
  else
    $a \gets m$          // root lies in the right half
  end if
end while
return $(a + b) / 2$
```

> **Worked example (bisection).** For $f(x) = x^3 - 2x^2 + x - 1$, we have
> $f(1) = -1 < 0$ and $f(2) = 1 > 0$, so a root sits in $(1,2)$. Bisecting:
> $f(1.5) \approx -0.625$ keeps $(1.5, 2)$; $f(1.75) \approx -0.016$ keeps
> $(1.75, 2)$; $f(1.875) \approx 0.44$ keeps $(1.75, 1.875)$. The root is near
> $1.7549$.

Faster methods exist, Newton's among them, but bisection's guarantee is
unconditional once a sign change is found.

### Existence proofs

- **Odd-degree polynomials have a real root.** A monic odd-degree polynomial $g$
  satisfies $g(x) \to \infty$ as $x \to \infty$ and $g(x) \to -\infty$ as $x \to
  -\infty$, so $g$ is positive at some large $M$ and negative at some large
  $-K$; IVT gives a root in $(-K, M)$.
- **$k$-th roots exist.** For $y > 0$ and $k \in \mathbb{N}$, the polynomial
  $f(x) = x^k - y$ is negative at $0$ and positive far enough right, so IVT gives
  an $x > 0$ with $x^k = y$.
- **Fixed points.** Any continuous $f : [0,1] \to [0,1]$ has a fixed point: apply
  IVT to $g(x) = f(x) - x$, which is $\ge 0$ at $0$ and $\le 0$ at $1$.

$$
% caption: An odd-degree monic polynomial runs from below the axis at large
% negative inputs to above it at large positive inputs, so it must cross zero
% somewhere between: a guaranteed real root.
\begin{tikzpicture}[scale=1.0, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\definecolor{wrn}{HTML}{B0672F}
\draw[black, ->] (-3.4,0) -- (3.4,0) node[anchor=north west] {$x$};
\draw[black, ->] (0,-2.4) -- (0,2.6) node[anchor=south east] {$y$};
\draw[acc, very thick] plot[domain=-1.75:1.75, samples=80] (\x, {0.42*(\x*\x*\x - 1.6*\x)});
\fill[wrn] (-1.265,0) circle (1.7pt);
\fill[wrn] (0,0) circle (1.7pt);
\fill[wrn] (1.265,0) circle (1.7pt);
\node[wrn, anchor=north west, font=\footnotesize] at (1.3,-0.05) {a root};
\node[black, anchor=north east, font=\footnotesize] at (-1.9,-1.4) {below at left};
\node[black, anchor=south west, font=\footnotesize] at (1.7,1.3) {above at right};
\end{tikzpicture}
$$

Two of these existence facts are worth spelling out as concrete computations.

> **Worked example ($\sqrt{2}$ from IVT).** The polynomial $f(x) = x^2 - 2$ is
> continuous, with $f(1) = -1 < 0$ and $f(2) = 2 > 0$. IVT gives $c \in (1,2)$
> with $c^2 - 2 = 0$, so $\sqrt{2}$ exists as a real number. The same argument
> on $f(x) = x^k - y$ produces the $k$-th root of any $y > 0$, recovering these
> irrationals from continuity and the
> [completeness axiom](/real-analysis/foundations/ordered-fields-completeness)
> with no explicit construction.

> **Worked example (a fixed point of $\cos$).** The cosine maps $[0,1]$ into
> $[\cos 1, 1] \subseteq [0,1]$, so it is a continuous self-map. Set
> $g(x) = \cos x - x$. Then $g(0) = 1 > 0$ and $g(1) = \cos 1 - 1 \approx -0.46
> < 0$, so IVT gives $c \in (0,1)$ with $\cos c = c$. Numerically $c \approx
> 0.739$, the value to which repeated cosines of any starting number converge.

$$
% caption: A continuous self-map of an interval must meet the diagonal y = x:
% the graph starts on or above it and ends on or below it, so it crosses, and
% the crossing is a fixed point.
\begin{tikzpicture}[scale=2.3, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\definecolor{wrn}{HTML}{B0672F}
\draw[black, ->] (-0.08,0) -- (1.25,0) node[anchor=north] {$x$};
\draw[black, ->] (0,-0.08) -- (0,1.25) node[anchor=east] {$y$};
\draw[black, thick] (0,0) -- (1.1,1.1);
\node[black, anchor=west, font=\footnotesize] at (1.14,1.1) {$y = x$};
\draw[acc, very thick] plot[domain=0:1, samples=60] (\x, {cos(\x r)});
\node[acc, anchor=north east, font=\footnotesize] at (0.55,0.78) {$y = \cos x$};
\fill[wrn] (0.739,0.739) circle (0.7pt);
\draw[wrn, dashed] (0.739,0.739) -- (0.739,0);
\node[wrn, anchor=north, font=\footnotesize] at (0.739,-0.02) {$c$};
\node[wrn, anchor=west, font=\footnotesize] at (0.78,0.72) {crossing};
\end{tikzpicture}
$$

The intermediate value property does not, by itself, imply continuity: $\sin(1/x)$
extended by $0$ at the origin has the IVT property while being discontinuous
there. A stronger condition, a single $\delta$ that works uniformly across the
whole interval, is what a continuous function on $[a,b]$ automatically satisfies:
[uniform continuity](/real-analysis/continuity/uniform-continuity).

[^lebl-bdd]: **Lebl**, _Basic Analysis I_, §3.3 — Lemma 3.3.1 (a continuous function on a closed bounded interval is bounded).
[^lebl-evt]: **Lebl**, _Basic Analysis I_, §3.3 — Theorem 3.3.2 (minimum–maximum / extreme value theorem) and the examples showing the hypotheses are needed.
[^lebl-ivt]: **Lebl**, _Basic Analysis I_, §3.3 — Lemma 3.3.7, Theorem 3.3.8 (Bolzano's intermediate value theorem), Proposition 3.3.10, and Corollary 3.3.13.
