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

Suppose you’ve found the peaks and valleys in the interior of an interval. Are you done? Not yet — the exam usually 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 is not automatically the tallest point in the room.

There’s a clean theorem that makes 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 the interval. And those winners can only live in two places: at an interior critical point, or at an endpoint. That’s a short, finite list of suspects — exactly what GATE wants you to check.

This “check the interior and the boundary” habit is exactly 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, but just as often it’s pinned at one end.

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.

No second-derivative test is needed — you are not classifying the points, just comparing their heights. The whole method is “evaluate and compare.”

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.

Play with this on a cubic. Pick x³ − x and slide the point across the plotted domain. The tangent flattens at the two interior critical points — but watch what happens at the ends of the curve: the function climbs higher (and dips lower) there than at either critical point. On a closed interval those endpoint values are candidates too, and the global winner is often one of them.

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: a candidate forgets the endpoints and reports an interior local extremum as the global answer. GATE DA 2025 used 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 before:

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 is tied between an interior critical point (x = −1) and an endpoint (x = 2), and the global minimum is tied 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.

Quick check

Quick check

0/5
Q1Find the GLOBAL MAXIMUM value of f(x) = x³ − 3x on the closed interval [−2, 2].numerical answer — type a number
Q2Find the GLOBAL MINIMUM value of f(x) = x² − 4x + 1 on the closed interval [0, 3].numerical answer — type a number
Q3Find the GLOBAL MAXIMUM value of f(x) = x³ − 3x on the SHIFTED interval [0, 3]. (Watch the endpoints.)numerical answer — type a number
Q4Why 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
Q5For which functions/intervals does the Extreme Value Theorem GUARANTEE a global max and min exist? (select all that apply)select all that apply

Practice this in an interview

All questions

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.

Explore further

Related lessons

Skip to content