The Candidates Test

The test

The reason is short. Since ff is continuous on a closed interval, the Extreme Value Theorem guarantees that an absolute maximum exists. Suppose it occurs at a point cc inside (a,b)(a, b). Then f(c)≥f(x)f(c) \ge f(x) for every xx near cc, so ff has a relative maximum at cc. By Fermat's theorem, cc is a critical point. So the maximum is at a critical point or at an endpoint, and the same argument works for the minimum.
The candidates for f on [a, b]: the endpoints a and b and the critical points c₁ and c₂. The absolute maximum is at b, and the absolute minimum is at c₂ (amber).
The test never asks which critical points are relative extrema. A critical point where ff has no extremum, or a relative maximum lower than an endpoint, loses the comparison, as c1c_1 does above.
Both hypotheses are needed. If ff isn't continuous on [a,b][a, b], or the interval isn't closed, there may be no absolute maximum at all. Then the largest of a few computed values proves nothing. An absolute maximum is a value of ff, so state the value and the xx where it occurs.

A polynomial

Where f′ doesn't exist

A critical point is a point of the domain where f′=0f' = 0 or where f′f' doesn't exist. Both kinds go on the list.

A trigonometric function

Critical points outside the interval

Only critical points inside (a,b)(a, b) are candidates. A critical point outside the interval says nothing about the values of ff on [a,b][a, b]. When none lies inside, the extrema are at the endpoints.

From a table

The test needs only the values of ff at the candidates. When those come from a table, sign information about f′f' locates the critical points. It can also show that a missing value isn't an extremum.