Tutorials › Calculus I › Why Closed-Interval Optimization Has Finite Candidates

Optimization and Newton's Method · Tutorial 866 of 1495

Why Closed-Interval Optimization Has Finite Candidates

See why endpoint and critical-point checks work on closed intervals, and when the resulting candidate list is not actually finite.

Advanced 9 min read

What You'll Learn

  • State the extreme value theorem and identify its continuity and interval requirements
  • Prove that a continuous function on a closed bounded interval attains both absolute extrema
  • Prove Fermat’s theorem for differentiable interior extrema
  • Explain why endpoints and interior critical points contain all possible extrema
  • Distinguish a finite candidate list from a candidate set that may be infinite
  • Recognize why nondifferentiable interior points may also need checking

Why Candidate Checks Need a Theorem

When optimizing a function on a closed interval, checking the endpoints and interior critical points is a familiar strategy. Two theorems explain why this strategy can find an absolute maximum and minimum: continuity on a closed bounded interval guarantees that both extrema are attained, and differentiability forces any interior extremum to have derivative zero.

These facts justify where to look. They do not, by themselves, guarantee that there are only finitely many points to check. That distinction matters: the candidate method gives a finite list only when the relevant endpoints and interior critical points form a finite set.

Setting: Let \(a\le b\), and let \(f:[a,b]\to\mathbb{R}\). An absolute maximum is a value \(f(c)\) such that \(f(x)\le f(c)\) for every \(x\in[a,b]\). An absolute minimum is a value \(f(c)\) such that \(f(x)\ge f(c)\) for every \(x\in[a,b]\). A point \(c\) where either value occurs is an absolute extremum point.

Continuity Guarantees Attainment

A function is continuous on \([a,b]\) if it is continuous at every point of that interval, with continuity at an endpoint understood relative to the interval. The extreme value theorem says that continuity on a closed bounded interval is enough to ensure that an absolute maximum and an absolute minimum exist.

Theorem (Extreme Value Theorem): If \(f:[a,b]\to\mathbb{R}\) is continuous and \(a\le b\), then there are points \(c_{\max},c_{\min}\in[a,b]\) such that $$ f(c_{\min})\le f(x)\le f(c_{\max}) \qquad\text{for every }x\in[a,b]. $$

The word attains is essential. The theorem guarantees that the greatest and least function values actually occur at points in the interval; it does not merely guarantee that the function values have a supremum and infimum.

Why the Extreme Value Theorem Holds

Here is a proof using the Bolzano–Weierstrass theorem: every bounded sequence of real numbers has a convergent subsequence. Since \([a,b]\) is closed, the limit of a convergent sequence in \([a,b]\) also belongs to \([a,b]\).

1
Show the function is bounded.
If \(f\) were unbounded on \([a,b]\), we could choose \(x_n\in[a,b]\) with \(|f(x_n)|>n\) for each \(n\in\mathbb{N}\). The sequence \((x_n)\) is bounded, so it has a subsequence \(x_{n_k}\) converging to some \(c\in[a,b]\). Continuity would imply \(f(x_{n_k})\to f(c)\), a finite real number. But \(|f(x_{n_k})|>n_k\) and \(n_k\to\infty\), a contradiction. Therefore \(f\) is bounded.
2
Approach the supremum.
Because the values of \(f\) are bounded, they have a supremum \(M=\sup\{f(x):x\in[a,b]\}\). By the definition of supremum, for each \(n\in\mathbb{N}\) we can choose \(x_n\in[a,b]\) such that \(M-\frac1n<f(x_n)\le M\).
3
Show the supremum is attained.
A subsequence \(x_{n_k}\) converges to some \(c_{\max}\in[a,b]\). Continuity gives \(f(x_{n_k})\to f(c_{\max})\). The inequalities \(M-\frac1{n_k}<f(x_{n_k})\le M\) show that \(f(x_{n_k})\to M\). Limits are unique, so \(f(c_{\max})=M\). Thus \(f\) attains its absolute maximum.
4
Obtain the minimum.
Apply the same maximum argument to the continuous function \(-f\). It attains a maximum at some \(c_{\min}\in[a,b]\). Thus \(-f(c_{\min})\ge -f(x)\) for every \(x\in[a,b]\), which is equivalent to \(f(c_{\min})\le f(x)\). Therefore \(f\) attains its absolute minimum as well.

Why an Interior Extremum Must Be Stationary

Attainment alone does not tell us where an extremum occurs. For an interior point, differentiability supplies a necessary condition. A point \(c\in(a,b)\) is an interior local maximum if \(f(x)\le f(c)\) for all \(x\) sufficiently close to \(c\); a local minimum is defined with the inequality reversed. An absolute extremum at an interior point is also a local extremum.

Theorem (Fermat’s theorem): Suppose \(f\) is differentiable at an interior point \(c\in(a,b)\). If \(c\) is a local maximum or local minimum of \(f\), then \(f'(c)=0\).

To prove the result, first suppose \(c\) is a local maximum. For all sufficiently small positive \(h\), the local maximum condition gives \(f(c+h)-f(c)\le0\). Dividing by \(h>0\) gives $$ \frac{f(c+h)-f(c)}{h}\le0. $$ For all sufficiently small negative \(h\), the numerator is still nonpositive but the denominator is negative, so $$ \frac{f(c+h)-f(c)}{h}\ge0. $$ Because \(f\) is differentiable at \(c\), both one-sided limits of these difference quotients equal \(f'(c)\). The quotients from positive \(h\) are nonpositive, so their limit is at most zero; those from negative \(h\) are nonnegative, so their limit is at least zero. Hence \(f'(c)\le0\) and \(f'(c)\ge0\), and therefore \(f'(c)=0\). At a local minimum, the inequalities reverse, giving the same conclusion.

This is a necessary condition, not a guarantee: a point with derivative zero need not be an extremum. Also, the theorem applies only at interior points where the function is differentiable. Endpoints and interior points where the derivative does not exist require separate consideration.

How the Results Locate Absolute Extrema

Suppose \(f\) is continuous on \([a,b]\) and differentiable at every point of \((a,b)\). The extreme value theorem guarantees that absolute extrema are attained. If an extremum is at an endpoint, it is among \(a\) and \(b\). If it occurs at an interior point, Fermat’s theorem says the derivative there is zero.

Consequence: Under these assumptions, every absolute extremum occurs at an endpoint or at an interior point \(c\) satisfying \(f'(c)=0\). If \(f\) is not differentiable at some interior points, include those points as candidates too. Comparing the function values at all such candidates identifies the absolute extrema, provided the candidate set has been completely found.

This conclusion explains the logic behind endpoint-and-critical-point checks. It does not say every candidate is an extremum, or that the candidate set is finite. The examples show both limitations.

Worked Example: A Finite Candidate Set

Find the absolute extrema of \(f(x)=x^2-2x\) on \([0,3]\). The function is a polynomial, so it is continuous on \([0,3]\) and differentiable on \((0,3)\). Its derivative is $$ f'(x)=2x-2. $$ A stationary point satisfies \(2x-2=0\), so \(2x=2\) and \(x=1\). The candidate points are therefore \(0,1,3\). Evaluate the function at each: $$ f(0)=0^2-2(0)=0,\qquad f(1)=1^2-2(1)=-1,\qquad f(3)=3^2-2(3)=9-6=3. $$ The least of these values is \(-1\), and the greatest is \(3\). Thus the absolute minimum is \(-1\) at \(x=1\), and the absolute maximum is \(3\) at \(x=3\). To check the candidates, the derivative vanishes at \(1\), and substitution confirms all three listed function values.

Worked Example: A Nondifferentiable Interior Extremum

Consider \(f(x)=|x|\) on \([-1,1]\). This function is continuous on the closed interval, so it attains both absolute extrema. For \(x<0\), \(f(x)=-x\), and for \(x>0\), \(f(x)=x\). The left and right derivatives at \(0\) are \(-1\) and \(1\), respectively, so \(f'(0)\) does not exist. The endpoints and this nondifferentiable interior point must be checked: $$ f(-1)=|-1|=1,\qquad f(0)=|0|=0,\qquad f(1)=|1|=1. $$ For every \(x\in[-1,1]\), \(0\le |x|\le1\). Therefore the absolute minimum is \(0\) at \(x=0\), and the absolute maximum is \(1\) at both endpoints. The interior minimum does not contradict Fermat’s theorem, because the function is not differentiable at \(0\).

Worked Example: A Stationary Point Need Not Be an Extremum

Let \(f(x)=x^3\) on \([-1,2]\). It is continuous on the interval and differentiable in its interior. Its derivative is $$ f'(x)=3x^2. $$ The equation \(3x^2=0\) gives the interior candidate \(x=0\). The full candidate list is \(x=-1,0,2\), and the corresponding values are $$ f(-1)=(-1)^3=-1,\qquad f(0)=0^3=0,\qquad f(2)=2^3=8. $$ Thus the absolute minimum is \(-1\) at \(x=-1\), and the absolute maximum is \(8\) at \(x=2\). The stationary point \(0\) is not a local extremum: if \(x<0\), then \(x^3<0\), while if \(x>0\), then \(x^3>0\). It is included because it satisfies the necessary condition, not because that condition guarantees an extremum. Substitution confirms the candidate values, and differentiating \(x^3\) returns \(3x^2\).

When Are There Finitely Many Candidates?

To conclude that a finite comparison suffices, the candidate set must actually be finite. Continuity on a closed bounded interval guarantees extrema, and Fermat’s theorem restricts differentiable interior extrema to points where the derivative is zero. Neither theorem says that the equation \(f'(x)=0\) has only finitely many solutions.

For example, take the constant function \(f(x)=5\) on \([0,1]\). It is continuous and differentiable, and $$ f'(x)=0\qquad\text{for every }x\in(0,1). $$ Every point of the interval is an absolute maximum and an absolute minimum, and there are infinitely many stationary points. The theorem’s conclusions hold, but there is no finite list of all candidate points.

Important limitation: “Check endpoints and critical points” means that every absolute extremum must be among those candidates (with nondifferentiable interior points included when necessary). It becomes a finite-candidate procedure only when the candidate set is finite. A finite list of candidates can be compared directly; an infinite set needs further analysis.

Common Mistake: Treating a Necessary Condition as a Guarantee

A common error is to infer that every point where \(f'(c)=0\) is a maximum or minimum. For \(f(x)=x^3\), the calculation \(f'(0)=0\) is correct, but the function takes negative values just to the left of \(0\) and positive values just to its right. So \(0\) is not an extremum. Fermat’s theorem runs in one direction: a differentiable interior extremum must have derivative zero; a zero derivative alone does not establish an extremum.

Another error is to assume that the extreme value theorem guarantees finitely many points to check. The constant-function example disproves that claim. The theorem guarantees attainment, while finiteness requires an additional fact about the candidate set.

Why These Results Matter

Optimization requires more than finding a point where the derivative vanishes. One must know that an absolute best value exists and that the search includes every possible location where it could occur. The extreme value theorem supplies existence on a closed bounded interval; Fermat’s theorem identifies the differentiable interior locations that must be considered. Endpoints matter because the interior derivative condition does not apply there, and nondifferentiable points matter because differentiability is part of Fermat’s hypothesis.

Together, these results provide a rigorous basis for candidate checks. They also tell you what to verify before treating such a check as a finite calculation: the function must satisfy the relevant continuity conditions, all types of candidates must be included, and the candidate set must in fact be finite.

Check Your Understanding

Answer these questions using the hypotheses of the theorems, not just their conclusions.

  1. What does the extreme value theorem guarantee for a continuous function on \([a,b]\)?
  2. Why does a differentiable local maximum at an interior point have derivative zero?
  3. Why must a nondifferentiable interior point be considered separately?
  4. Does \(f'(c)=0\) prove that \(c\) is a local extremum? Explain using \(f(x)=x^3\).
  5. Why does the extreme value theorem not imply that there are finitely many candidate points?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon