datarekha

Optimization on a Closed Interval

To find the global max and min of a continuous function on a closed interval, compare every critical point against both endpoints — the endpoints are the part everyone forgets.

7 min read Intermediate GATE DA Lesson 44 of 122

What you'll learn

  • The Extreme Value Theorem guarantees a continuous function on a closed interval `[a, b]` attains a global max and min
  • The candidates are the interior critical points PLUS the two endpoints `a` and `b`
  • Evaluate `f` at every candidate, then pick the largest and smallest values
  • The global extremum can sit at an endpoint — never skip evaluating `a` and `b`

Before you start

Last lesson ended with a warning: a local minimum is only the bottom of one valley, and the true global best might lie elsewhere — even at the very edge of the domain. So suppose you have dutifully found every peak and valley in the interior of an interval. Are you done? Not yet. The exam almost always wants the single highest and lowest value f takes anywhere on [a, b], and that winner can easily sit at one of the endpoints. A local peak in the middle of the room is not automatically the tallest point in the room.

There is a clean theorem that keeps the search short. If f is continuous on a closed interval [a, b], the Extreme Value Theorem promises that f actually attains a global max and a global min somewhere on it. And those winners can live in only two kinds of place: at an interior critical point, or at an endpoint. That is a short, finite list of suspects — exactly what GATE wants you to check.

This “search the interior and the boundary” habit is precisely what you do when tuning a hyperparameter over a fixed range — a learning rate in [0.001, 0.1], say. The best value is sometimes inside the range, but just as often it is pinned to one end, and you would never know without checking both.

The closed-interval method

To find the global max and min of a continuous f on [a, b]:

1.  Find the critical points inside (a, b):  solve f'(x) = 0
    (and note any x in (a, b) where f' is undefined).
2.  List the candidates:  those interior critical points  +  the endpoints a and b.
3.  Evaluate f at EVERY candidate.
4.  Largest value = global maximum.   Smallest value = global minimum.

Notice what is not here: no second-derivative test. You are not classifying any point as a peak or trough — you are only comparing their heights. The whole method is “evaluate and compare,” and the endpoints are full candidates in that comparison, not afterthoughts.

local maxglobal maxabinterior critical points alone are not enough
The interior peak is only a local max — the global max sits at the endpoint b. Always evaluate a and b too.

The figure makes the lesson’s whole point visible. The interior peak is only a local maximum, while the curve quietly climbs higher at the right endpoint b — where the slope is nowhere near flat. On a closed interval those endpoint heights are candidates in their own right, and the global winner is often one of them, exactly as the worked example below confirms.

How GATE asks this

Look for a NAT or MSQ that says “find the global maximum (or minimum) value of f on [a, b],” or an MSQ probing why you must check endpoints or when the Extreme Value Theorem applies. The reliable trap is a solver who forgets the endpoints and reports an interior local extremum as the global answer. GATE DA 2025 used exactly this shape — a polynomial on a closed interval where one endpoint held the true extreme.

Worked example — based on a real GATE DA 2025 question

Find the global maximum and global minimum of f(x) = x³ − 3x on the closed interval [−2, 2].

Step 1 — interior critical points. Same derivative as the last two lessons:

f'(x) = 3x² − 3 = 0   →   x = −1  and  x = +1     (both lie inside (−2, 2))

Step 2-3 — evaluate f at all four candidates (two critical points, two endpoints):

candidate     type              f(x) = x³ − 3x
──────────────────────────────────────────────────────
x = −2        endpoint          (−2)³ − 3(−2) = −8 + 6 = −2
x = −1        critical point    (−1)³ − 3(−1) = −1 + 3 =  2
x = +1        critical point    (1)³  − 3(1)  =  1 − 3 = −2
x = +2        endpoint          (2)³  − 3(2)  =  8 − 6 =  2

Step 4 — compare. The largest value is 2; the smallest is −2:

global maximum = 2   (attained at x = −1 and at x = 2)
global minimum = −2  (attained at x = 1 and at x = −2)

Notice that the global maximum ties between an interior critical point (x = −1) and an endpoint (x = 2), and the global minimum ties between x = 1 and the endpoint x = −2. Had you skipped the endpoints, you would have missed half of where the extremes actually occur — and on a different interval, the endpoint could have been the sole winner, as the practice below shows.

A question to carry forward

The closed-interval method is reliable, but look at the labour it demands: list every candidate, evaluate, and compare. Worse, a wiggly function can carry many local minima, and the method gives no assurance that a deeper one is not hiding between the ones you found — you simply have to check them all. Yet some functions are so well-shaped that this anxiety vanishes: a single bowl, one bottom, no false valleys to fear. Here is the thread onward: is there a class of functions where any local minimum is automatically the global minimum — so an optimiser can stop the instant it finds a flat spot, confident it has found the best point of all? That property is the quiet hero behind why machine learning works at all.

In one breath

  • On a closed, bounded interval [a, b], a continuous f is guaranteed a global max and min by the Extreme Value Theorem.
  • Closed-interval method: find interior critical points (f'=0 or undefined), add the endpoints a, b, evaluate f at all, then take the largest and smallest. No second-derivative test — just evaluate and compare.
  • The global extremum can sit at an endpoint, where f' is generally non-zero — forgetting a and b is the classic lost mark (GATE DA 2025).
  • x³ − 3x on [−2, 2]: global max 2 (at x = −1 and x = 2), global min −2 (at x = 1 and x = −2).
  • EVT needs continuity + a closed interval: on (0, 1) or with a jump, a global extremum can simply not exist.

Practice

Quick check

0/5
Q1Recall: why must you evaluate f at the endpoints a and b when optimizing on [a, b]? Which statements are correct? (select all that apply)select all that apply
Q2Recall: for which functions/intervals does the Extreme Value Theorem GUARANTEE a global max and min exist? (select all that apply)select all that apply
Q3Trace: find the GLOBAL MINIMUM value of f(x) = x² − 4x + 1 on the closed interval [0, 3].numerical answer — type a number
Q4Apply: find the GLOBAL MAXIMUM value of f(x) = x³ − 3x on the closed interval [−2, 2].numerical answer — type a number
Q5Create: find the GLOBAL MAXIMUM value of f(x) = x³ − 3x on the SHIFTED interval [0, 3], and note where it occurs. (Watch the endpoints.)numerical answer — type a number

Sign in to track your progress

Completed lessons, your XP, level, and streak save to your account — it's free and takes a few seconds.

Practice this in an interview

All questions

Related lessons

Explore further

Skip to content