In short

The standard derivative tests for maxima and minima assume the function is differentiable everywhere. When a function has corners, cusps, or is restricted to a closed interval, those tests miss important extrema. In such cases, you must also check endpoints and points of non-differentiability. The Extreme Value Theorem guarantees that a continuous function on a closed interval always attains both its global maximum and global minimum.

Take f(x) = |x| on the interval [-2, 3]. Where is the minimum?

Your instinct says: set f'(x) = 0 and solve. But f'(x) = -1 for x < 0 and f'(x) = 1 for x > 0. The derivative is never zero. Does that mean the function has no minimum?

Look at the graph. The function reaches its lowest value at x = 0, where f(0) = 0. That is clearly a minimum — lower than every nearby point. But the derivative at x = 0 does not exist. The function has a sharp corner there, and the standard test f'(c) = 0 never catches it.

This is the first lesson: extrema can occur at points where the derivative does not exist. The standard first derivative test finds extrema only among critical points where f'(c) = 0. But there are other places to look.

Three places where extrema can hide

For a function f defined on some domain, extrema can occur at exactly three types of points:

  1. Stationary points: where f'(c) = 0 — the usual critical points with horizontal tangent lines.
  2. Points of non-differentiability: where f'(c) does not exist — corners, cusps, and vertical tangents.
  3. Endpoints: if the domain is a closed interval [a, b], the endpoints a and b must be checked separately.

The first derivative test only covers type 1. This article is about types 2 and 3.

Non-differentiable functions

Corners

The simplest case is a corner — a point where the graph makes a sharp turn. At a corner, the left-hand and right-hand derivatives exist but are different, so the derivative itself does not exist.

The function $f(x) = |x|$ has a corner at $x = 0$. The slope jumps from $-1$ to $+1$. The derivative does not exist at the corner, but the function clearly has a minimum there.

For f(x) = |x|, the point x = 0 is a local (and global) minimum. The function decreases as you approach from the left (slope -1) and increases as you leave to the right (slope +1). The sign change in the derivative — from negative to positive — is exactly the condition the first derivative test looks for at a minimum. The only difference is that the transition happens through a jump rather than through zero.

Cusps

A cusp is a sharper version of a corner. At a cusp, both one-sided derivatives exist but one goes to +\infty and the other to -\infty (or both go to +\infty or both to -\infty).

Take f(x) = x^{2/3}. The derivative is f'(x) = \frac{2}{3}x^{-1/3} = \frac{2}{3\sqrt[3]{x}}.

As x \to 0^+, f'(x) \to +\infty. As x \to 0^-, f'(x) \to -\infty. The tangent line is becoming vertical from both sides. At x = 0, the derivative does not exist — the function has a cusp.

The function $f(x) = x^{2/3}$ has a cusp at the origin. The curve comes to a sharp point — sharper than a corner, with the tangent becoming vertical. The minimum is at the cusp.

The cusp at x = 0 is clearly a minimum: x^{2/3} \geq 0 for all real x, and f(0) = 0. But the derivative is undefined there, so the test f'(c) = 0 would never find it.

How to handle non-differentiable points

The approach is straightforward:

  1. Compute f'(x) wherever it exists.
  2. Find all points where f' is zero (stationary points) and all points where f' does not exist (corners, cusps, vertical tangents).
  3. Evaluate f at every such point.
  4. Use the sign of f' on each side of these points to classify them as local maxima, local minima, or neither.

The sign-change test works exactly the same way at a corner or cusp as at a stationary point: if f' changes from negative to positive, you have a local minimum; if from positive to negative, a local maximum.

Endpoints of intervals

When a function is defined on a closed interval [a, b], the endpoints require special attention.

Consider f(x) = x^2 on [-1, 3]. The derivative is f'(x) = 2x, which is zero only at x = 0. The first derivative test says x = 0 is a local minimum (slope goes from negative to positive). So f(0) = 0 is the minimum.

But what about the maximum? f'(x) = 2x is positive for all x > 0, so the function is increasing on (0, 3]. It keeps climbing to the right. The highest value is at the right endpoint: f(3) = 9.

The parabola $y = x^2$ restricted to $[-1, 3]$. The global minimum is at $x = 0$ (the vertex), but the global maximum is at the endpoint $x = 3$, where $f(3) = 9$. No derivative test would find this maximum — it occurs at a boundary, not at a stationary point.

The endpoint x = 3 gives the global maximum, but the derivative there is f'(3) = 6 \neq 0. There is nothing special about the derivative at an endpoint maximum — the function simply runs out of domain before it can start decreasing. Endpoints are not found by solving f'(x) = 0; they must be checked separately.

Endpoint behaviour

At a left endpoint x = a:

At a right endpoint x = b:

Global vs local extrema

This is the distinction that matters most in applications. A local extremum is a point that is higher (or lower) than all nearby points. A global (or absolute) extremum is the highest (or lowest) point over the entire domain.

Every global extremum is automatically a local extremum. But a local extremum is not necessarily global — a function can have many local hills and valleys, and only the tallest hill is the global maximum.

A cubic on a domain. It has a local minimum and a local maximum. Depending on the domain, the global maximum might be at the local maximum or at an endpoint. You must compare all candidates to find the global extrema.

The closed interval method

On a closed interval [a, b], finding the global maximum and minimum is a finite procedure:

Step 1. Find all critical points of f in (a, b) — both where f'(x) = 0 and where f'(x) does not exist.

Step 2. Evaluate f at every critical point and at both endpoints a and b.

Step 3. The largest value is the global maximum. The smallest is the global minimum.

That is the entire algorithm. No sign-change analysis needed — just compute the function value at every candidate and compare.

Why this works: the Extreme Value Theorem

Extreme Value Theorem

If f is continuous on a closed interval [a, b], then f attains its global maximum and global minimum on [a, b]. That is, there exist points c, d \in [a, b] such that f(c) \leq f(x) \leq f(d) for all x \in [a, b].

Both conditions — continuity and closed interval — are essential.

The Extreme Value Theorem says that if both conditions hold, the global extrema are guaranteed to exist. And since a continuous function on a closed interval can only achieve extrema at critical points or endpoints, the closed interval method finds them all.

Worked examples

Example 1: Global extrema of $f(x) = 2x^3 - 3x^2 - 12x + 5$ on $[-2, 4]$

Step 1. Find critical points.

f'(x) = 6x^2 - 6x - 12 = 6(x^2 - x - 2) = 6(x-2)(x+1)

Setting f'(x) = 0: x = 2 and x = -1. Both lie in (-2, 4), so both are candidates.

Why: the derivative is a polynomial, so it exists everywhere. The only critical points are where f'(x) = 0.

Step 2. Evaluate f at the critical points and endpoints.

f(-2) = 2(-8) - 3(4) - 12(-2) + 5 = -16 - 12 + 24 + 5 = 1
f(-1) = 2(-1) - 3(1) - 12(-1) + 5 = -2 - 3 + 12 + 5 = 12
f(2) = 2(8) - 3(4) - 12(2) + 5 = 16 - 12 - 24 + 5 = -15
f(4) = 2(64) - 3(16) - 12(4) + 5 = 128 - 48 - 48 + 5 = 37

Why: the closed interval method requires comparing the function value at every candidate. No sign-change analysis needed — just arithmetic.

Step 3. Compare all values.

Point f value Type
x = -2 (endpoint) 1
x = -1 (critical) 12 local max
x = 2 (critical) -15 local min
x = 4 (endpoint) 37

Why: the largest value tells you the global maximum; the smallest tells you the global minimum.

Step 4. Read off the answer.

Why: the global extrema are simply the extreme values from the comparison table.

Result: The global maximum is 37 at x = 4 (an endpoint). The global minimum is -15 at x = 2 (a critical point).

The cubic $y = 2x^3 - 3x^2 - 12x + 5$ on $[-2, 4]$. The local maximum at $x = -1$ gives $f = 12$, which is not the global maximum — the function climbs much higher by the time it reaches the endpoint $x = 4$. The global maximum ($37$) is at an endpoint, and the global minimum ($-15$) is at an interior critical point.

The key takeaway: the global maximum turned out to be at an endpoint, not at a critical point. If you had only checked where f'(x) = 0, you would have missed it entirely.

Example 2: Extrema of $f(x) = |2x - 3|$ on $[0, 4]$

This function has a corner, so the standard derivative test misses the key point.

Step 1. Rewrite the function in piecewise form.

f(x) = \begin{cases} 3 - 2x & \text{if } x \leq \frac{3}{2} \\ 2x - 3 & \text{if } x \geq \frac{3}{2} \end{cases}

Why: the absolute value creates two linear pieces. The expression inside, 2x - 3, is zero at x = 3/2, which is where the corner occurs.

Step 2. Find critical points.

For x < 3/2: f'(x) = -2. For x > 3/2: f'(x) = 2. The derivative is never zero, but it is undefined at x = 3/2 (the left and right derivatives are -2 and +2, which disagree). So x = 3/2 is a critical point.

Why: at a corner, the derivative does not exist. This is a critical point just as much as a point where f'(x) = 0.

Step 3. Evaluate f at the critical point and endpoints.

f(0) = |0 - 3| = 3
f(3/2) = |3 - 3| = 0
f(4) = |8 - 3| = 5

Why: three candidates, three function values — compare and conclude.

Step 4. Compare.

Why: the smallest value is the global minimum, the largest is the global maximum.

Result: The global minimum is 0 at x = 3/2 (the corner). The global maximum is 5 at x = 4 (an endpoint).

The V-shaped graph of $f(x) = |2x - 3|$ on $[0, 4]$. The minimum is at the corner ($x = 3/2$, where the function touches zero), and the maximum is at the right endpoint ($x = 4$, where the function reaches $5$). Neither extremum is found by the equation $f'(x) = 0$ — one is at a non-differentiable point, the other at a boundary.

Neither of these extrema is a stationary point. One is a corner, the other is an endpoint. The closed interval method catches both because it does not rely on f'(x) = 0 alone — it checks every type of candidate.

Common confusions

Going deeper

If you came here to learn about endpoints and non-differentiable extrema, you have it — you can stop here. What follows is the proof of the Extreme Value Theorem and some additional subtleties.

Why the Extreme Value Theorem is true (sketch)

The full proof uses the completeness of the real numbers — a deep property that distinguishes the reals from the rationals. Here is the key idea.

Let f be continuous on [a, b]. The set of all values \{f(x) : x \in [a, b]\} is bounded above (this uses the Boundedness Theorem, which says continuous functions on closed intervals are bounded). So this set has a least upper bound M — the supremum.

Now you need to show that some c \in [a, b] actually achieves f(c) = M. The argument: there is a sequence x_1, x_2, x_3, \ldots in [a, b] such that f(x_n) \to M. Since [a, b] is closed and bounded, the Bolzano-Weierstrass theorem guarantees a convergent subsequence x_{n_k} \to c for some c \in [a, b]. By continuity, f(c) = \lim f(x_{n_k}) = M. So the maximum is attained.

The same argument works for the minimum.

Darboux's theorem: a constraint on derivatives

There is a surprising fact about derivatives that constrains how they can behave.

Darboux's theorem states: if f is differentiable on [a, b], then f' satisfies the intermediate value property. That is, if f'(a) < k < f'(b) (or vice versa), then there exists some c \in (a, b) with f'(c) = k.

This means a derivative cannot jump — it must pass through every intermediate value, just like a continuous function. A derivative can be discontinuous (and there exist differentiable functions whose derivatives are discontinuous), but it cannot have a jump discontinuity.

The relevance here: at a corner of a continuous function, the left and right derivatives are different, and there is no derivative at the corner itself. Darboux's theorem does not apply because the function is not differentiable at the corner. This is why corners can produce extrema — the derivative "jumps" past zero without ever equalling zero.

Functions on open intervals

On an open interval (a, b) or on all of \mathbb{R}, a continuous function need not have a global maximum or minimum. But it can have local extrema. The first derivative test and second derivative test work for local extrema without any change. The only thing you lose is the guarantee that global extrema exist.

If a function on an open interval does have a global extremum, it must occur at a critical point (where f'(c) = 0 or f'(c) does not exist). There are no endpoints to check. So on open domains, the equation f'(x) = 0 combined with checking non-differentiable points is the complete strategy for finding all possible extrema.

Where this leads next