Search

Search papers and lessons

Extreme Value Theorem

Level 2 · 12 min read

The extreme value theorem: a continuous function on a closed, bounded interval always reaches a largest and a smallest value somewhere in that interval.

On this page

  • Colour = topic mix
  • Discrete math
  • Calculus
  • ReadReady to readNot yet

TL;DR

The extreme value theorem says that if a function is continuous on a closed, bounded interval, then it has a largest value and a smallest value somewhere on that interval. Plainly: there is no way for the function's highest point to escape to infinity, or to sit at a jump that is not included.

The theorem answers a question that comes before any search. It tells you a best case and a worst case exist, so the search is worth doing. It is the first step in many arguments about optimal choices.

Builds on: Continuity, Compact Set · Leads to: Derivative, Constrained Optimization

Where it's used

  • Engineering loads. A beam rests on two supports and carries stress along its length. Stress is a continuous function of position on a closed segment, so the theorem guarantees one worst point exists. Engineers then search for it, and the search is meaningful because the worst point is there to be found.
  • Choosing a price. A seller's profit depends on the price charged. If the price must lie between a legal lower bound and a legal upper bound, and profit changes smoothly with price, the theorem guarantees a best price inside those bounds. The question "what is the best price?" has an answer.
  • Machine learning theory. A training loss that changes smoothly with the model's parameters, searched over a bounded box of parameter values, has a smallest value in that box. Analysts use this guarantee when they prove that a best model exists before they try to train one.
  • Tank temperature. A tank's temperature over a fixed four-hour window, with no sudden jumps, has a hottest and a coldest moment inside that window. The worked examples below follow one such case.

How it works

Take one tiny instance from start to finish: the function f(x)=x2−2xf(x) = x^2 - 2x on the closed interval from 0 to 3.

  1. Start with the function and the interval. The input xx ranges over every number from 0 to 3, including both ends. Writing [0,3][0, 3] means exactly this. The function is a parabola, which has no jumps. Check: the interval has an endpoint at 0 and at 3, so it is closed. It stops at 3, so it is bounded.
  2. Sample the function at whole numbers. f(0)=0f(0) = 0, f(1)=−1f(1) = -1, f(2)=0f(2) = 0, f(3)=3f(3) = 3. The smallest sample so far is −1-1, at x=1x = 1. The largest is 33, at x=3x = 3. Check: f(1)=1−2=−1f(1) = 1 - 2 = -1 and f(3)=9−6=3f(3) = 9 - 6 = 3.
  3. Sample more finely, with steps of one half. The new points are f(0.5)=−0.75f(0.5) = -0.75, f(1.5)=−0.75f(1.5) = -0.75 and f(2.5)=1.25f(2.5) = 1.25. The smallest value is still −1-1 and the largest is still 33. Check: f(0.5)=0.25−1=−0.75f(0.5) = 0.25 - 1 = -0.75 and f(2.5)=6.25−5=1.25f(2.5) = 6.25 - 5 = 1.25.
  4. Keep sampling finer. Each refinement gets the smallest and largest sample values closer to their true targets. Continuity is what makes this work: the function cannot jump between two nearby samples and hide a higher or lower value in the gap. The targets here are −1-1 and 33. Check: no sample ever goes below −1-1 or above 33.
  5. Confirm each target is actually reached. The value −1-1 is reached at x=1x = 1, which lies inside the interval. The value 33 is reached at x=3x = 3, which is the endpoint and is included because the interval is closed. So the function has a smallest value −1-1 and a largest value 33, both attained.
00.511.522.53−2−101234xf(x)
  • f(x) = x^2 - 2x
On [0, 3] the lowest point is the dip at x = 1, and the highest point is the right endpoint at x = 3. Both are reached by the curve.

The math

Definition

Definition: Extreme value theorem

Let ff be continuous on a closed, bounded interval [a,b][a, b], meaning all xx with a≤x≤ba \le x \le b. Then there exist points cc and dd in [a,b][a, b] such that

f(c)≤f(x)≤f(d)for every x in [a,b].f(c) \le f(x) \le f(d) \quad \text{for every } x \text{ in } [a, b].

The point dd is where the largest value is attained, and cc is where the smallest value is attained. Both are guaranteed to lie inside the interval.

Both hypotheses matter. Continuity rules out jumps. Closed and bounded rules out missing endpoints and runaway growth. Drop either one and the conclusion can fail, as the common-mistakes section shows.

Step 1 in symbols: the interval

The domain is [a,b][a, b], so a≤x≤ba \le x \le b. In the example a=0a = 0 and b=3b = 3. The interval contains both endpoints, which is the "closed" part, and it has finite length, which is the "bounded" part. A closed, bounded set of real numbers is called

in one dimension, and the Heine–Borel theorem says this is exactly the same as closed and bounded.

Steps 2 to 4 in symbols: sampling and the best value

Let MM be the least upper bound of the values f(x)f(x) for xx in [a,b][a, b]. This is the smallest number that is at least every value f(x)f(x), and it may be the largest value itself. Choose a sequence of inputs x1,x2,x3,…x_1, x_2, x_3, \ldots in [a,b][a, b] with f(xn)f(x_n) approaching MM. These are the finer and finer samples of Step 4.

A bounded sequence of numbers always contains a sub-sequence that settles toward some number. Here the inputs stay in the bounded interval, so some sub-sequence xnkx_{n_k} settles toward a point cc. Because the interval is closed, that point cc is still inside [a,b][a, b].

Step 5 in symbols: the target is attained

Continuity says that f(xnk)→f(c)f(x_{n_k}) \to f(c) whenever xnk→cx_{n_k} \to c. Since f(xnk)f(x_{n_k}) also approaches MM, we get

f(c)=M.f(c) = M.

So the least upper bound is actually a value of the function, attained at the point cc. The smallest value is found the same way by applying this argument to −f-f.

In the example, the target M=3M = 3 is reached at c=3c = 3, and the closed interval includes that endpoint.

Worked examples

Example
Example 1: a straight line

Let f(x)=2x+1f(x) = 2x + 1 on [0,2][0, 2], a straight line.

  1. Find the value at the left endpoint: f(0)=1f(0) = 1.
  2. Find the value at the right endpoint: f(2)=5f(2) = 5.
  3. The line rises from left to right, so no point between the endpoints is lower than 1 or higher than 5.
  4. The smallest value is 11, at x=0x = 0. The largest is 55, at x=2x = 2.

Interpretation: both the best and worst values sit on the endpoints, and the theorem guarantees they exist. Here the hand calculation finds them directly.

Example
Example 2: the dip in a parabola

Let f(x)=x2−2xf(x) = x^2 - 2x on [0,3][0, 3], as in the walkthrough.

  1. Find the turning point: f′(x)=2x−2f'(x) = 2x - 2 is zero at x=1x = 1.
  2. Compute the turning value: f(1)=1−2=−1f(1) = 1 - 2 = -1. This is a dip, so it is a candidate for the smallest value.
  3. Compute the endpoints: f(0)=0f(0) = 0 and f(3)=9−6=3f(3) = 9 - 6 = 3.
  4. Compare the candidates −1-1, 00 and 33. The smallest is −1-1 at x=1x = 1, and the largest is 33 at x=3x = 3.

Interpretation: the largest value is at an endpoint, not at a turning point. Checking only turning points would have missed it. The theorem says the answer is one of these candidates, and the candidate list is finite.

Example
Example 3: the hottest and coldest moment of a tank

A tank's temperature in degrees Celsius over the next four hours is T(t)=20+3t−t2T(t) = 20 + 3t - t^2 for tt from 0 to 4 hours. The function is smooth, so the theorem applies on [0,4][0, 4].

  1. Find the turning point: T′(t)=3−2tT'(t) = 3 - 2t is zero at t=1.5t = 1.5.
  2. Compute the temperature there: T(1.5)=20+4.5−2.25=22.25T(1.5) = 20 + 4.5 - 2.25 = 22.25. This is the hottest moment inside the window.
  3. Compute the endpoints: T(0)=20T(0) = 20 and T(4)=20+12−16=16T(4) = 20 + 12 - 16 = 16.
  4. The hottest value is 22.2522.25 at t=1.5t = 1.5 hours.

Try it: which moment in [0,4][0, 4] is the coldest, and what is its temperature? Answer: the coldest is at t=4t = 4 hours, where T(4)=16T(4) = 16 degrees Celsius. Compare the endpoints, since T(0)=20T(0) = 20 is higher. The turning point is a maximum, so it cannot be the minimum.

Common mistakes and tradeoffs

Mistake 1: the best value must be at a turning point. It is tempting to think the largest and smallest values always sit where the slope is zero. In fact the endpoints are candidates too, because the interval includes them. In Example 2 the largest value is at the endpoint x=3x = 3. Always compare turning points with endpoints.

Mistake 2: an open interval is just as good. It is tempting to think that (0,1)(0, 1) works the same as [0,1][0, 1]. In fact the function f(x)=xf(x) = x on (0,1)(0, 1) has no largest or smallest value. Its outputs get as close to 0 and 1 as you like, but they never reach them, because the endpoints are excluded. The closed interval is what guarantees the endpoints are included.

Mistake 3: a jump does not matter if the limit exists. It is tempting to think a function with a single bad point is still fine. Take g(x)=xg(x) = x for xx in [0,1)[0, 1) and g(1)=0g(1) = 0. The outputs approach 1 but never reach it, and the value at 1 is only 0. So gg has no largest value, even though it is defined on a closed interval. Continuity at 1 is what would have fixed this.

Mistake 4: unbounded domains are fine. It is tempting to think a function on a whole line is covered. The function f(x)=xf(x) = x on [0,∞)[0, \infty) has no largest value, because it grows without limit. Closed and bounded is the hypothesis that prevents this.

Tradeoffs. Use the theorem when the domain is closed and bounded and the function is continuous, because it guarantees the best and worst values and gives you a finite list of candidates. Do not use it when the domain is open or unbounded, or when the function has jumps. In those cases check limits at the ends of the domain and the behaviour at each jump by hand. The theorem also says nothing about how to find the points, only that they exist. Finding them is the job of Derivative tests and of numerical search, such as gradient descent.

History

In the early nineteenth century mathematicians were using calculus with loose ideas of continuity, and they often assumed that a function on a closed interval must have a highest and lowest point without proof. Bernard Bolzano gave a proof in a manuscript written around 1830, but the work was not published until 1930, so its influence on the field was delayed.

Later in the nineteenth century Karl Weierstrass and his students made the theorem a standard part of analysis. Standard proofs rest on the least upper bound property of the real numbers, the same idea that appears in the sampling steps above. Once the theorem had a clear proof, it became a standard tool, and it is usually taught early in analysis courses because it is the first real guarantee that an optimal value exists.

Recap

  • A continuous function on a closed, bounded interval has a largest and a smallest value on that interval.
  • Continuity prevents jumps that could hide a higher or lower value. Closed and bounded prevents missing endpoints and runaway growth.
  • The best values are attained at points inside the interval, and they are either turning points or endpoints.
  • The theorem guarantees existence, not location. Turning-point tests such as Derivative find the candidates, and Constrained Optimization builds on this to search for best values under conditions.

Check yourself

QuestionState the two conditions on the function and on the interval that the extreme value theorem needs.Show answer

The function must be continuous on the interval. The interval must be closed, meaning it contains its endpoints, and bounded, meaning it has finite length. If either condition fails, the largest or smallest value may not exist, as in the examples of an open interval and of a jump.

QuestionFor f(x)=2x2−8x+1f(x) = 2x^2 - 8x + 1 on [0,5][0, 5], find the smallest value and the largest value, and where each occurs.Show answer

The turning point solves 4x−8=04x - 8 = 0, so x=2x = 2, and f(2)=8−16+1=−7f(2) = 8 - 16 + 1 = -7. The endpoints give f(0)=1f(0) = 1 and f(5)=50−40+1=11f(5) = 50 - 40 + 1 = 11. The smallest value is −7-7 at x=2x = 2, and the largest is 1111 at x=5x = 5. The largest is at an endpoint, not at the turning point.

QuestionWhy does the function f(x)=xf(x) = x on the open interval (0,1)(0, 1) have no largest value, even though it is continuous and bounded?Show answer

The interval excludes its endpoints. The outputs get arbitrarily close to 1 but never equal 1, because the input 1 is not in the interval. A largest value must be an actual output, so none exists. The closed interval [0,1][0, 1] would fix this by including the endpoint 1.

QuestionA continuous function of time is defined on the closed interval from 0 to 10 hours. A manager asks whether there is a moment when the function is at its highest. What do you answer, and what does the theorem not tell you?Show answer

Yes, the function reaches a highest value at some moment in that interval, because it is continuous on a closed, bounded interval. The theorem does not say which moment it is, or how to find it. To locate it you would check turning points and the two endpoints, 0 and 10 hours.

Sources