maths2u
Tier
⌕ Search ⌘K
Theorem

Fermat's interior extremum theorem

T-139Home MU-102Threads change
Statement

Let \( D \subseteq \mathbb{R} \), let \( f \colon D \to \mathbb{R} \), and let \( c \) be an interior point of \( D \) (there is \( \delta_{0} \gt 0 \) with \( (c - \delta_{0}, c + \delta_{0}) \subseteq D \)). Suppose that \( f \) has a local extremum at \( c \) — that is, there is \( \delta_{1} \gt 0 \) such that either \( f(x) \le f(c) \) for all \( x \in D \) with \( |x - c| \lt \delta_{1} \) (local maximum) or \( f(x) \ge f(c) \) for all such \( x \) (local minimum) — and that \( f \) is differentiable at \( c \). Then \[ f'(c) = 0. \] No continuity, differentiability or even boundedness of \( f \) is assumed at any point other than \( c \), and the extremum need only be local, not global.

Why it matters

This is the single theorem that converts optimisation into equation-solving. “Find where \( f \) is largest” is a statement about infinitely many comparisons; \( f'(c) = 0 \) is one equation in one unknown. Every candidate method in calculus — closed-interval testing, the first and second derivative tests, curve sketching, least squares, maximum likelihood, the equilibrium conditions of physics and economics — is downstream of it. It is a necessary condition and nothing more, and the discipline of remembering that is most of what separates a correct optimisation argument from a plausible-looking one.

It is also the differential half of the machinery of one-variable analysis. Weierstrass's extreme value theorem says a continuous function on a compact interval attains its extrema; Fermat's theorem says that an attained extremum which is interior forces the derivative to vanish. Chain the two and you get Rolle's theorem; shear Rolle by a linear function and you get the mean value theorem; iterate that and you get Taylor's theorem with Lagrange remainder, the interpolation error formula, and the convergence estimates of numerical analysis. The generalisations run all the way up: \( \nabla f(c) = \mathbf{0} \) in several variables, the vanishing first variation in the calculus of variations, \( 0 \in \partial f(c) \) for convex functions, and the stationarity half of the Karush–Kuhn–Tucker conditions.

Hypotheses
\( c \) is an interior point of the domain.This is the hypothesis the theorem is named for, and it is the one that fails most often in practice. Take \( f(x) = x \) on \( D = [0,1] \). The global maximum is attained at \( c = 1 \), the function is differentiable there in the one-sided sense with \( f'(1) = 1 \), and \( 1 \neq 0 \). The point \( c \) must have room on both sides inside \( D \), because the proof plays a left-hand estimate against a right-hand one.
\( f \) is differentiable at \( c \).Only at \( c \). Drop it and the conclusion is meaningless as well as false: \( f(x) = |x| \) has a strict global minimum at \( c = 0 \), yet the difference quotient has limits \( -1 \) from the left and \( +1 \) from the right, so \( f'(0) \) does not exist. The two one-sided estimates the proof produces are both correct here; what fails is that they have no common value to be squeezed to.
The extremum is genuine, if only locally.Without an inequality \( f(x) \le f(c) \) (or \( \ge \)) holding on some neighbourhood there is nothing to differentiate against. A point where \( f \) merely “flattens out” on one side, such as \( c = 0 \) for \( f(x) = x^{3} \), is not covered by the hypothesis — and the fact that \( f'(0) = 0 \) there anyway is a coincidence, not an instance of the theorem.
The codomain is \( \mathbb{R} \), an ordered field.“Maximum” presupposes an order. For \( \mathbf{f} \colon \mathbb{R} \to \mathbb{R}^{2} \), \( \mathbf{f}(t) = (\cos t, \sin t) \), the norm \( \lVert \mathbf{f}(t) \rVert = 1 \) is constant, so every point is both a maximum and a minimum of the norm, yet \( \lVert \mathbf{f}'(t) \rVert = 1 \) for all \( t \). The surviving statement is orthogonality, \( \mathbf{f}(c) \cdot \mathbf{f}'(c) = 0 \), not vanishing.
Nothing else is assumed — and that is a feature.Continuity of \( f \) away from \( c \) is never used. Let \( f(x) = x^{2} \) for rational \( x \) and \( f(x) = 2x^{2} \) for irrational \( x \). Then \( f \) is discontinuous at every \( x \neq 0 \), but \( 0 \le f(x) \le 2x^{2} \) forces \( |f(x) - f(0)|/|x - 0| \le 2|x| \to 0 \), so \( f'(0) = 0 \) exists; \( c = 0 \) is a strict global minimum and the theorem applies verbatim. Contrast this with Rolle's theorem or the mean value theorem, which need continuity on a whole interval.
Proof

The whole argument is a squeeze on the difference quotient. Approaching \( c \) from the right, a maximum makes the quotient non-positive; approaching from the left, the same maximum makes it non-negative; differentiability says both one-sided limits are the same number. The only real ingredients are the order-limit theorem (weak inequalities survive limits) and the antisymmetry of \( \le \).

1
Assume without loss of generality that \( c \) is a local maximum. If instead it is a local minimum, apply everything below to \( g := -f \).
\( g \) is differentiable at \( c \) with \( g'(c) = -f'(c) \) (linearity of the derivative), \( c \) is still interior, and \( f(x) \ge f(c) \) is equivalent to \( g(x) \le g(c) \). A conclusion \( g'(c) = 0 \) gives \( f'(c) = 0 \). A
2
Put \( \delta := \min\{\delta_{0}, \delta_{1}\} \gt 0 \). Then \[ (c - \delta, c + \delta) \subseteq D \qquad \text{and} \qquad f(x) \le f(c) \ \text{ for all } x \in (c - \delta, c + \delta). \]
Intersecting the interiority neighbourhood with the local-maximum neighbourhood; the minimum of two positive numbers is positive. Both hypotheses are consumed here, and from now on only this one line is used. A
3
For \( 0 \lt |x - c| \lt \delta \) define the difference quotient \[ Q(x) := \frac{f(x) - f(c)}{x - c}, \qquad \text{with numerator } f(x) - f(c) \le 0 . \]
\( Q \) is defined on the punctured neighbourhood because \( (c-\delta, c+\delta) \subseteq D \); the sign of the numerator is exactly Step 2. Differentiability at \( c \) says precisely that \( \lim_{x \to c} Q(x) \) exists and equals \( f'(c) \). A
4
For \( x \in (c, c + \delta) \) we have \( x - c \gt 0 \), so dividing a non-positive number by a positive one gives \[ Q(x) = \frac{f(x) - f(c)}{x - c} \le 0 . \]
Order arithmetic in \( \mathbb{R} \): if \( u \le 0 \) and \( v \gt 0 \) then \( u/v \le 0 \). No limit has been taken yet — this is a pointwise inequality on the right half-neighbourhood. A
5
For \( x \in (c - \delta, c) \) we have \( x - c \lt 0 \), so dividing the same non-positive numerator by a negative number reverses the sign: \[ Q(x) = \frac{f(x) - f(c)}{x - c} \ge 0 . \]
Order arithmetic again: \( u \le 0 \) and \( v \lt 0 \) give \( u/v \ge 0 \). This is the step that makes interiority indispensable — at an endpoint this half-neighbourhood is empty and the inequality is never obtained. B
6
Since \( f'(c) = \lim_{x \to c} Q(x) \) exists, both one-sided limits exist and equal it. From Step 4, \[ f'(c) = \lim_{x \to c^{+}} Q(x) \le 0 . \]
Order-limit theorem: if \( Q(x) \le 0 \) on a punctured right neighbourhood and \( Q(x) \to L \) as \( x \to c^{+} \), then \( L \le 0 \). Proof: if \( L \gt 0 \), take \( \varepsilon = L/2 \) in the definition of the limit to get \( x \) with \( Q(x) \gt L - L/2 = L/2 \gt 0 \), contradicting \( Q(x) \le 0 \). Note that a two-sided limit restricts to each side, which is where differentiability (not one-sided differentiability) is used. C
7
From Step 5, by the mirror-image argument, \[ f'(c) = \lim_{x \to c^{-}} Q(x) \ge 0 . \]
Same order-limit theorem with the inequalities reversed (or apply Step 6 to \( x \mapsto f(2c - x) \), whose derivative at \( c \) is \( -f'(c) \)). C
8
\[ 0 \le f'(c) \le 0 \quad \Longrightarrow \quad f'(c) = 0 . \qquad \blacksquare \]
Antisymmetry of \( \le \) on \( \mathbb{R} \). With Step 1 this covers the minimum case too, so the theorem holds in all cases. A
9
Sharper local form (the contrapositive, quantified). If \( f'(c) \gt 0 \) then there is \( \eta \gt 0 \) with \[ f(x) \gt f(c) \ \text{ for } x \in (c, c + \eta), \qquad f(x) \lt f(c) \ \text{ for } x \in (c - \eta, c). \]
Take \( \varepsilon = f'(c)/2 \) in the limit definition: for \( 0 \lt |x - c| \lt \eta \) we get \( Q(x) \gt f'(c)/2 \gt 0 \), and multiplying by \( x - c \) (positive on the right, negative on the left) gives the two displayed inequalities. So a point with non-zero derivative is strictly beaten on one side and strictly beats the other — it can be neither a local maximum nor a local minimum. This is the same theorem with the existence quantifier made explicit, and it is the form used in proofs about monotonicity. C
Result
\[ c \in \operatorname{int}(D), \;\; f \text{ has a local extremum at } c, \;\; f'(c) \text{ exists} \;\; \Longrightarrow \;\; f'(c) = 0 \]

Reading. At an interior high point or low point, a graph that has a tangent line has a horizontal tangent line. Any non-zero slope is a promise that you can do better by stepping one way and worse by stepping the other, so you were not at an extremum at all.

Scope. Real-valued functions of one real variable, at an interior point of the domain, with the derivative existing at that one point. The implication runs one way only: \( f'(c) = 0 \) does not imply an extremum. Endpoints, points of non-differentiability and boundary points of any kind are outside the theorem and must be handled separately. Points where \( f'(c) = 0 \) are called critical or stationary; the theorem says every interior differentiable extremiser is critical, not the converse.

Corollaries & converses
  • The candidate method (closed-interval test). If \( f \) is continuous on \( [a,b] \), its global extrema exist by the extreme value theorem and are attained only at (i) the endpoints \( a, b \), (ii) interior points where \( f' \) fails to exist, or (iii) interior points where \( f' = 0 \). Fermat's theorem is what eliminates every other point; comparing finitely many values then settles the problem completely.
  • Rolle's theorem. If \( f \) is continuous on \( [a,b] \), differentiable on \( (a,b) \) and \( f(a) = f(b) \), then the extreme value theorem attains a maximum and a minimum; equal endpoint values force at least one of them to be interior unless \( f \) is constant, and Fermat's theorem finishes. Rolle is exactly Weierstrass composed with Fermat.
  • One-sided form at an endpoint. If \( c = a \) is the left endpoint of \( [a,b] \), \( f \) has a maximum at \( a \) and the right derivative \( f'_{+}(a) \) exists, then \( f'_{+}(a) \le 0 \) (Step 4 alone). For a minimum at \( a \), \( f'_{+}(a) \ge 0 \); the signs reverse at the right endpoint. Half the proof survives, and gives an inequality instead of an equation — the one-variable ancestor of the KKT sign conditions.
  • Interior stationarity in several variables. If \( f \colon U \to \mathbb{R} \) with \( U \subseteq \mathbb{R}^{n} \) open has a local extremum at \( \mathbf{c} \) and is differentiable there, then \( \nabla f(\mathbf{c}) = \mathbf{0} \). Proof: apply the one-variable theorem to \( t \mapsto f(\mathbf{c} + t\mathbf{e}_{i}) \) for each \( i \), which has a local extremum at \( t = 0 \).
  • Convex functions: the condition becomes sufficient. If \( f \) is convex on an interval and \( f'(c) = 0 \) at an interior \( c \), then \( c \) is a global minimum, since convexity gives \( f(x) \ge f(c) + f'(c)(x - c) = f(c) \). Convexity is precisely the hypothesis that upgrades Fermat's necessary condition to a sufficient one.
  • Converse is FALSE. \( f(x) = x^{3} \) has \( f'(0) = 0 \) but is strictly increasing, so \( 0 \) is neither a local maximum nor a local minimum. Vanishing derivative produces candidates, never conclusions.
Fails without
  • Interiority dropped (extremum at a boundary point): \( f(x) = x \) on \( [0,1] \) attains its global maximum at \( c = 1 \) with \( f'_{-}(1) = 1 \neq 0 \), and its global minimum at \( c = 0 \) with \( f'_{+}(0) = 1 \neq 0 \). Both extrema are real, both derivatives exist one-sidedly, and the conclusion holds at neither point. This is the most common source of wrong answers in applied optimisation: the optimum sits on the boundary of the feasible set and no equation detects it.
  • Differentiability at \( c \) dropped: \( f(x) = |x| \) on \( (-1,1) \) has a strict global minimum at the interior point \( c = 0 \), but \( \lim_{h \to 0^{-}} \frac{|h|}{h} = -1 \) and \( \lim_{h \to 0^{+}} \frac{|h|}{h} = +1 \), so \( f'(0) \) does not exist and there is no number to set to zero. Sharper: \( f(x) = -|x|^{1/2} \) has an interior global maximum at \( 0 \) where the difference quotient diverges, to \( -\infty \) as \( x \to 0^{+} \) and to \( +\infty \) as \( x \to 0^{-} \). Corners, cusps and vertical tangents are invisible to the equation \( f' = 0 \) and must be added to the candidate list by hand.
  • The point is in \( D \) but not interior to it (non-interval domain): take \( D = [0,1] \cup \{2\} \) and \( f(x) = x \). The point \( c = 2 \) is a global maximum of \( f \) on \( D \), yet \( c \) is an isolated point of \( D \): no difference quotient can even be formed, because \( c \) is not a limit point of the domain. “Interior” is not decoration; it is the guarantee that both one-sided approaches exist.
  • Order structure of the codomain dropped: for \( \mathbf{f}(t) = (\cos t, \sin t) \) mapping \( \mathbb{R} \to \mathbb{R}^{2} \), every \( t \) maximises \( \lVert \mathbf{f} \rVert \), yet \( \mathbf{f}'(t) = (-\sin t, \cos t) \) is never the zero vector. The correct vector statement is that \( \mathbf{f}(c) \cdot \mathbf{f}'(c) = 0 \) at a stationary point of \( \lVert \mathbf{f} \rVert^{2} \), which is an orthogonality condition, not a vanishing one.
Common errors
  • “\( f'(c) = 0 \), so \( c \) is a maximum or a minimum.” The implication runs the other way. \( f(x) = x^{3} \) at \( c = 0 \) is the standard refutation; in several variables the saddle \( f(x,y) = x^{2} - y^{2} \) at the origin is the same error with more room.
  • “Set \( f'(x) = 0 \), solve, done.” The solution set of \( f' = 0 \) is a list of candidates. Deciding which of them is a maximum needs a second argument: the closed-interval comparison, a sign chart for \( f' \), the second derivative test, or convexity.
  • Forgetting the endpoints. On \( [a,b] \) the theorem says nothing at \( a \) or \( b \), so the values \( f(a) \) and \( f(b) \) must always be compared explicitly. A strictly monotone function need have no stationary point at all: \( f(x) = 3x + 1 \) on \( [0,1] \) takes both its extreme values at the endpoints and has \( f'(x) = 3 \) everywhere.
  • Forgetting the non-differentiable points. \( f(x) = |x^{2} - 1| \) on \( [-2,2] \) has minima at \( x = \pm 1 \), where \( f \) is not differentiable; solving \( f'(x) = 0 \) alone returns only \( x = 0 \), which is a local maximum.
  • Assuming an extremum exists. Fermat is conditional: if there is an interior extremum then the derivative vanishes. On a non-compact domain there may be no extremum at all — \( f(x) = x \) on \( (0,1) \) — so existence must come from the extreme value theorem, from coercivity (\( f \to +\infty \) at both ends), or from convexity before candidates mean anything.
  • Requiring more regularity than the theorem needs. Fermat does not need \( f \) continuous on an interval, twice differentiable, or even bounded away from \( c \). Only differentiability at the single point \( c \) is used; imposing extra hypotheses is harmless in practice but obscures which fact is doing the work.
  • Confusing “critical point” with “stationary point” when \( f' \) fails to exist. Most texts call \( c \) critical if \( f'(c) = 0 \) or \( f'(c) \) does not exist, and stationary only in the first case. Fermat's theorem says interior extrema are critical; it does not say they are stationary.
Discussion

Pierre de Fermat's method of maxima and minima predates the calculus of Newton and Leibniz by some decades. His technique of adequality compares \( f(x) \) with \( f(x + e) \), treats the two as “approximately equal”, cancels, divides through by \( e \), and then suppresses the terms that still contain \( e \). Applied to \( f(x) = x(b - x) \) it returns \( x = b/2 \) immediately. The step of dividing by \( e \) and then setting \( e = 0 \) drew exactly the objection later aimed at the infinitesimals of Newton and Leibniz, and it took the nineteenth-century limit concept — Cauchy and Weierstrass — to turn the method into the theorem proved above. What survives of Fermat's version is the essential insight: at an extremum the first-order change vanishes, so the leading term of the local expansion is quadratic, not linear.

The theorem's logical shape is worth internalising, because students routinely use it in the wrong direction. It is a necessary condition, and its practical value is subtractive: it deletes from consideration every interior differentiable point that is not stationary, usually leaving a finite candidate set. Existence must be imported from elsewhere — typically the extreme value theorem on a compact domain, or a coercivity argument that confines the search to a compact subset. Sufficiency must be imported too, from a sign change of \( f' \), from \( f''(c) \gt 0 \), or from convexity. A complete optimisation argument therefore has three separable parts: existence, candidate generation (Fermat), and classification. Skipping any of them produces the classic failure of “solving \( f'=0 \)” on a problem whose optimum is at a boundary or a corner.

Every serious generalisation keeps the same proof and changes the derivative. In \( \mathbb{R}^{n} \) one restricts to lines through \( \mathbf{c} \) and obtains \( \nabla f(\mathbf{c}) = \mathbf{0} \). In a normed space with a Fréchet derivative one obtains \( Df(c) = 0 \) as a bounded linear functional; taking \( f \) to be an action functional on a space of curves and differentiating along variations that vanish at the endpoints turns that statement into the Euler–Lagrange equation, which is why the calculus of variations is sometimes described as Fermat's theorem in infinite dimensions. When the domain has a boundary or is cut out by constraints, the equality \( f'(c) = 0 \) weakens to the one-sided inequalities of the third corollary, and those inequalities, combined with multipliers, are the Karush–Kuhn–Tucker conditions. For convex but non-smooth \( f \) the derivative is replaced by the subdifferential and the condition reads \( 0 \in \partial f(c) \), which is again necessary and, by convexity, sufficient.

Two subtleties deserve a working analyst's attention. First, stationarity is far weaker than the pictures suggest: \( f(x) = x^{4}\bigl(2 + \sin(1/x)\bigr) \) with \( f(0) = 0 \) satisfies \( 0 \le f(x) \le 3x^{4} \), so \( f'(0) = 0 \) and \( 0 \) is a strict global minimum, yet \( f' \) changes sign infinitely often in every neighbourhood of \( 0 \), so no “first derivative test” based on monotonicity on one side can be applied. Second, the theorem carries a numerical warning. Near a non-degenerate minimum, \( f(c + h) - f(c) \approx \tfrac{1}{2} f''(c) h^{2} \), so a perturbation of size \( h \) changes \( f \) only at order \( h^{2} \). In IEEE double precision, where machine epsilon is \( \varepsilon_{\mathrm{mach}} = 2^{-52} \approx 2.2 \times 10^{-16} \), values of \( f \) are indistinguishable once \( h^{2} \) falls below that relative level, so a minimiser located by comparing function values can be pinned down only to a relative accuracy of roughly \( \sqrt{\varepsilon_{\mathrm{mach}}} \approx 1.5 \times 10^{-8} \). The flatness that makes the extremum an extremum is exactly what makes its location ill-conditioned — and it is why optimisers that can evaluate \( f' \) directly, and solve \( f' = 0 \), are preferred to those that only compare values of \( f \).

Common misconceptions. Fermat's theorem does not assert that an extremum exists, does not locate it, does not claim uniqueness of the stationary point, and says nothing at endpoints or at points where the derivative fails to exist. It is not a statement about global behaviour: a local maximum found by the theorem may be far below the global maximum. And “\( f'(c) = 0 \)” is a statement about the tangent line only — the graph may cross its own tangent there, as \( x^{3} \) does at the origin.

Worked examples

Example 1 (minimum-material can). A closed cylindrical can is to hold a volume \( V = 355\ \mathrm{cm}^{3} \) (the standard drink can). Find the radius and height that minimise the total surface area of sheet metal, and the area used. Justify both the existence of a minimum and the fact that the critical point is it.

1
With radius \( r \gt 0 \) and height \( h \gt 0 \), \[ V = \pi r^{2} h \quad\Longrightarrow\quad h = \frac{V}{\pi r^{2}}, \qquad S = 2\pi r^{2} + 2\pi r h = 2\pi r^{2} + \frac{2V}{r}, \] so \( S \colon (0,\infty) \to \mathbb{R} \) is a function of \( r \) alone.
The volume constraint is used to eliminate \( h \), reducing a two-variable constrained problem to a one-variable unconstrained one. Symbols only — no numbers yet. A
2
\( S(r) \to \infty \) as \( r \to 0^{+} \) (from \( 2V/r \)) and as \( r \to \infty \) (from \( 2\pi r^{2} \)). Fix any \( r_{0} \) and choose \( 0 \lt \alpha \lt r_{0} \lt \beta \) with \( S \gt S(r_{0}) \) outside \( [\alpha, \beta] \); \( S \) is continuous on the compact interval \( [\alpha, \beta] \), so it attains a minimum there, and that value is the global minimum on \( (0,\infty) \).
Existence first, by coercivity plus the extreme value theorem. Without this, a stationary point would prove nothing. The minimiser lies in the open interval \( (\alpha, \beta) \), hence is an interior point of the domain. B
3
\( S \) is differentiable on \( (0,\infty) \), so by Fermat's interior extremum theorem the minimiser \( r_{\ast} \) satisfies \[ S'(r) = 4\pi r - \frac{2V}{r^{2}} = 0 \quad\Longrightarrow\quad 4\pi r^{3} = 2V \quad\Longrightarrow\quad r_{\ast} = \left( \frac{V}{2\pi} \right)^{1/3}. \]
The theorem applies because the minimiser is interior and \( S \) is differentiable there; multiplying through by \( r^{2} \neq 0 \) clears the denominator. The equation has exactly one positive root, so the candidate list has one entry. B
4
\[ S''(r) = 4\pi + \frac{4V}{r^{3}} \gt 0 \quad \text{for all } r \gt 0, \] so \( S \) is strictly convex on \( (0,\infty) \) and the unique stationary point is the global minimum.
Classification. Convexity converts the necessary condition into a sufficient one, and rules out the possibility that \( r_{\ast} \) is a maximum or an inflection. A
5
Also \[ h_{\ast} = \frac{V}{\pi r_{\ast}^{2}} = \frac{2\pi r_{\ast}^{3}}{\pi r_{\ast}^{2}} = 2 r_{\ast}, \qquad S_{\min} = 2\pi r_{\ast}^{2} + \frac{2V}{r_{\ast}} = 2\pi r_{\ast}^{2} + 4\pi r_{\ast}^{2} = 6\pi r_{\ast}^{2}, \] using \( V = 2\pi r_{\ast}^{3} \) from Step 3.
Back-substitution in symbols. The optimal can is exactly as tall as it is wide (\( h = 2r \)), a shape-only conclusion that does not depend on \( V \). A
6
Numbers last, with \( V = 355\ \mathrm{cm}^{3} \): \[ r_{\ast} = \left( \frac{355}{2\pi} \right)^{1/3}\ \mathrm{cm} = (56.50)^{1/3}\ \mathrm{cm} = 3.837\ \mathrm{cm}, \] \[ h_{\ast} = 2 r_{\ast} = 7.674\ \mathrm{cm}, \qquad S_{\min} = 6\pi (3.837)^{2}\ \mathrm{cm}^{2} = 277.5\ \mathrm{cm}^{2}. \]
Arithmetic to four significant figures. Dimensions check: \( V/(2\pi) \) has units \( \mathrm{cm}^{3} \), its cube root \( \mathrm{cm} \); \( 6\pi r^{2} \) is an area in \( \mathrm{cm}^{2} \). A
\[ r_{\ast} = \left(\frac{V}{2\pi}\right)^{1/3} = 3.837\ \mathrm{cm}, \qquad h_{\ast} = 2r_{\ast} = 7.674\ \mathrm{cm}, \qquad S_{\min} = 6\pi r_{\ast}^{2} = 277.5\ \mathrm{cm}^{2} \]

Reading. The cheapest closed cylinder of a given volume has height equal to its diameter. Fermat's theorem supplied the equation \( 4\pi r^{3} = 2V \); the extreme value theorem supplied the right to believe a minimum existed; convexity supplied the right to call the solution the answer.

Scope. Real cans are not this shape — the model ignores the double seam, the thicker end pieces, and the fact that stacking and grip constrain the aspect ratio — so the discrepancy with a real \( 355\ \mathrm{cm}^{3} \) can (roughly \( r = 3.3\ \mathrm{cm} \), \( h = 12\ \mathrm{cm} \)) measures the neglected constraints, not an error in the calculus.

Example 2 (launch angle, and why endpoints must be checked separately). A projectile leaves the ground with speed \( v_{0} = 25.0\ \mathrm{m\,s^{-1}} \) at angle \( \theta \in [0, \pi/2] \) above the horizontal, over level ground with no air resistance and \( g = 9.81\ \mathrm{m\,s^{-2}} \). Its range is \( R(\theta) = v_{0}^{2}\sin(2\theta)/g \). Find the angle maximising the range and the maximum range.

1
\( R \) is continuous on the compact interval \( [0, \pi/2] \), so by the extreme value theorem it attains a global maximum there.
Existence before candidates. \( R \) is a composition of continuous functions; \( [0,\pi/2] \) is closed and bounded. A
2
The maximiser lies at an endpoint (\( \theta = 0 \) or \( \theta = \pi/2 \)) or at an interior point where \( R'(\theta) = 0 \); \( R \) is differentiable on all of \( (0, \pi/2) \), so there are no non-differentiable candidates.
Fermat's interior extremum theorem: an interior maximiser of a function differentiable there must be stationary, so every other interior point is eliminated. The theorem says nothing at \( 0 \) and \( \pi/2 \), which is why they stay on the list. B
3
\[ R'(\theta) = \frac{2v_{0}^{2}}{g}\cos(2\theta) = 0 \quad\Longleftrightarrow\quad \cos(2\theta) = 0 \quad\Longleftrightarrow\quad 2\theta = \frac{\pi}{2} \quad\Longleftrightarrow\quad \theta = \frac{\pi}{4}, \] the only solution in \( (0, \pi/2) \).
Chain rule on \( \sin(2\theta) \); the factor \( 2v_{0}^{2}/g \) is a positive constant and cannot vanish, so the equation is exactly \( \cos(2\theta) = 0 \), i.e. \( 2\theta \in \{\pi/2, 3\pi/2, \dots\} \), of which only \( 2\theta = \pi/2 \) lies in \( (0,\pi) \). A
4
Compare the three candidates in symbols: \[ R(0) = 0, \qquad R\!\left(\frac{\pi}{4}\right) = \frac{v_{0}^{2}}{g}, \qquad R\!\left(\frac{\pi}{2}\right) = \frac{v_{0}^{2}\sin\pi}{g} = 0 . \]
\( \sin(2\theta) \) equals \( 0, 1, 0 \) at the three candidates. Since \( v_{0}^{2}/g \gt 0 \), the interior candidate wins; by Step 1 the list is exhaustive, so this is the global maximum. A
5
Numbers: \[ \theta_{\ast} = \frac{\pi}{4} = 45.0^{\circ}, \qquad R_{\max} = \frac{(25.0\ \mathrm{m\,s^{-1}})^{2}}{9.81\ \mathrm{m\,s^{-2}}} = \frac{625\ \mathrm{m^{2}\,s^{-2}}}{9.81\ \mathrm{m\,s^{-2}}} = 63.7\ \mathrm{m}. \]
Units cancel to metres, as a range must. Standard gravity is defined as \( g_{n} = 9.80665\ \mathrm{m\,s^{-2}} \); the rounded value \( 9.81 \) used here shifts the answer from \( 63.73\ \mathrm{m} \) to \( 63.71\ \mathrm{m} \), well inside the three significant figures quoted. A
6
Flatness check at the optimum: \[ R(40^{\circ}) = \frac{625 \sin 80^{\circ}}{9.81}\ \mathrm{m} = 62.7\ \mathrm{m}, \] a loss of only \( 1.0\ \mathrm{m} \), about \( 1.5\% \), for a \( 5^{\circ} \) error.
Illustrates the second-order behaviour guaranteed by \( R'(\theta_{\ast}) = 0 \): the first-order term is absent, so errors in \( \theta \) cost only at order \( (\theta - \theta_{\ast})^{2} \). B
\[ \theta_{\ast} = \frac{\pi}{4} = 45.0^{\circ}, \qquad R_{\max} = \frac{v_{0}^{2}}{g} = \frac{(25.0\ \mathrm{m\,s^{-1}})^{2}}{9.81\ \mathrm{m\,s^{-2}}} = 63.7\ \mathrm{m} \]

Reading. Fermat's theorem produced one interior candidate, \( 45^{\circ} \); the endpoints had to be checked by hand and gave zero range, as physical sense demands (fire flat, or straight up, and you go nowhere along the ground). The range near the optimum is flat to first order, so a \( 5^{\circ} \) aiming error costs about \( 1.5\% \) of the distance.

Scope. Level ground, no air resistance, launch and landing at the same height. With drag, or with a target above or below the launch point, the optimal angle is no longer \( 45^{\circ} \) — but the method is unchanged: existence, then Fermat for interior candidates, then endpoints, then comparison.

Problems
  1. (Routine.) For \( f(x) = 2x^{3} - 9x^{2} + 12x + 1 \) on \( \mathbb{R} \), find every point at which Fermat's theorem permits a local extremum, classify each, and give the corresponding values of \( f \).
    Solution

    \( f \) is a polynomial, hence differentiable at every point of \( \mathbb{R} \), and every point of \( \mathbb{R} \) is interior. So by Fermat's interior extremum theorem any local extremum must satisfy \( f'(x) = 0 \). Compute \[ f'(x) = 6x^{2} - 18x + 12 = 6(x^{2} - 3x + 2) = 6(x-1)(x-2), \] so the only candidates are \( x = 1 \) and \( x = 2 \). Classify with the second derivative: \( f''(x) = 12x - 18 \), so \( f''(1) = -6 \lt 0 \) (local maximum) and \( f''(2) = 6 \gt 0 \) (local minimum). Values: \( f(1) = 2 - 9 + 12 + 1 = 6 \) and \( f(2) = 16 - 36 + 24 + 1 = 5 \). Note that neither is global: \( f(x) \to +\infty \) as \( x \to +\infty \) and \( f(x) \to -\infty \) as \( x \to -\infty \), so \( f \) has no global extremum on \( \mathbb{R} \) — a reminder that Fermat gives local information only, and existence of a global optimum needs a compact domain.

  2. (Hypothesis diagnosis.) For each of the following, locate the global maximum and minimum on the stated domain, decide whether Fermat's theorem applies at the extremiser, and name the hypothesis that fails when it does not. (a) \( f(x) = 3x + 1 \) on \( [0, 4] \). (b) \( g(x) = |x - 3| + 2 \) on \( [0, 5] \). (c) \( h(x) = x^{2} \) on \( (0, 1) \).
    Solution

    (a) \( f \) is strictly increasing, so the minimum is \( f(0) = 1 \) at \( x = 0 \) and the maximum is \( f(4) = 13 \) at \( x = 4 \). Both extremisers are endpoints of \( [0,4] \), hence not interior points of the domain: the interiority hypothesis fails, and indeed \( f'(x) = 3 \neq 0 \) everywhere. The one-sided corollary still holds and is consistent: at the left endpoint minimum, \( f'_{+}(0) = 3 \ge 0 \); at the right endpoint maximum, \( f'_{-}(4) = 3 \ge 0 \).

    (b) The minimum is \( g(3) = 2 \) at the interior point \( x = 3 \); the maximum is \( g(0) = 5 \) at the endpoint \( x = 0 \) (compare \( g(5) = 4 \)). At \( x = 3 \) interiority holds but differentiability fails: \( \lim_{h \to 0^{-}} (g(3+h)-g(3))/h = -1 \) while the right-hand limit is \( +1 \). So Fermat does not apply, and correctly so — there is no stationary point anywhere, since \( g'(x) = \pm 1 \) wherever it exists.

    (c) \( \sup h = 1 \) and \( \inf h = 0 \), and neither is attained: for \( x \in (0,1) \), \( 0 \lt x^{2} \lt 1 \) strictly. There is no extremum, so the hypothesis “\( f \) has a local extremum at \( c \)” is never satisfied and there is nothing for the theorem to say. The underlying failure is of the extreme value theorem, not of Fermat: \( (0,1) \) is bounded but not closed, so not compact.

  3. (Applied, with units.) A rectangular open-topped tray is made from a square sheet of card of side \( 60.0\ \mathrm{cm} \) by cutting a square of side \( x \) from each corner and folding up the flaps. Find the value of \( x \) that maximises the volume, and the maximum volume in litres. State where each theorem is used.
    Solution

    The base is a square of side \( 60 - 2x \) and the depth is \( x \), so in symbols \[ V(x) = x(60 - 2x)^{2}\ \mathrm{cm}^{3}, \qquad x \in [0, 30], \] where the closed interval is the largest domain on which the construction makes sense (\( x = 0 \) and \( x = 30 \) give degenerate trays of zero volume). \( V \) is a polynomial, hence continuous on the compact interval \( [0,30] \), so by the extreme value theorem a global maximum is attained. By Fermat's interior extremum theorem, an interior maximiser must satisfy \( V'(x) = 0 \); the endpoints must be checked separately.

    Differentiate with the product rule: \[ V'(x) = (60 - 2x)^{2} + x \cdot 2(60 - 2x)(-2) = (60 - 2x)\bigl[(60 - 2x) - 4x\bigr] = (60 - 2x)(60 - 6x). \] Hence \( V'(x) = 0 \) at \( x = 30 \) (an endpoint, not interior) and \( x = 10 \). The candidate list is \( \{0, 10, 30\} \). Evaluate: \( V(0) = 0 \), \( V(30) = 0 \), and \[ V(10) = 10 \cdot (60 - 20)^{2} = 10 \cdot 40^{2} = 16000\ \mathrm{cm}^{3} = 16.0\ \mathrm{L}. \] Since the list is exhaustive, the maximum volume is \( 16.0\ \mathrm{L} \), attained by cutting corner squares of side \( x = 10.0\ \mathrm{cm} \); the tray is then \( 40.0\ \mathrm{cm} \times 40.0\ \mathrm{cm} \times 10.0\ \mathrm{cm} \). (Check: \( 1\ \mathrm{L} = 1000\ \mathrm{cm}^{3} \).)

  4. (Proof.) Let \( f \colon [a,b] \to \mathbb{R} \) attain its maximum over \( [a,b] \) at the left endpoint \( c = a \), and suppose the one-sided derivative \[ f'_{+}(a) = \lim_{h \to 0^{+}} \frac{f(a + h) - f(a)}{h} \] exists. Prove that \( f'_{+}(a) \le 0 \), and give an example with \( f'_{+}(a) \lt 0 \) strictly, showing the conclusion cannot be strengthened to an equality.
    Solution

    For \( 0 \lt h \lt b - a \) we have \( a + h \in [a,b] \), so the maximum property gives \( f(a+h) \le f(a) \), i.e. \( f(a+h) - f(a) \le 0 \). Dividing by \( h \gt 0 \) preserves the inequality: \[ \frac{f(a+h) - f(a)}{h} \le 0 \qquad \text{for all } h \in (0, b-a). \] The limit as \( h \to 0^{+} \) exists by hypothesis, and weak inequalities survive limits (order-limit theorem: if the limit \( L \) were positive, taking \( \varepsilon = L/2 \) would produce an \( h \) with quotient at least \( L/2 \gt 0 \), a contradiction). Hence \( f'_{+}(a) \le 0 \).

    Strictness can occur: take \( f(x) = -x \) on \( [0,1] \). The maximum over \( [0,1] \) is \( f(0) = 0 \), attained at the left endpoint, and \( f'_{+}(0) = -1 \lt 0 \). So only half of Fermat's argument is available at a boundary point — Step 4 of the proof, not Step 5 — and the equality degrades to a sign condition. This is exactly the pattern that becomes the KKT sign conditions for inequality-constrained optimisation.

  5. (Harder.) Let \( f \colon \mathbb{R} \to \mathbb{R} \) be differentiable, and suppose \( f' \) vanishes at exactly one point \( c_{0} \), at which \( f \) has a local minimum. Prove that \( f(x) \ge f(c_{0}) \) for every \( x \in \mathbb{R} \), i.e. the local minimum is global. (The analogous statement in \( \mathbb{R}^{2} \) is false, so the argument must use the one-dimensional structure.)
    Solution

    Since \( c_{0} \) is a local minimum, choose \( \eta \gt 0 \) with \( f(x) \ge f(c_{0}) \) for all \( x \) with \( |x - c_{0}| \le \eta \). Suppose, for contradiction, that \( f(d) \lt f(c_{0}) \) for some \( d \); by symmetry (replace \( x \) by \( 2c_{0} - x \) if necessary) assume \( d \gt c_{0} \), and shrink \( \eta \) so that \( c_{0} + \eta \lt d \).

    \( f \) is differentiable, hence continuous, on the compact interval \( [c_{0}, d] \), so by the extreme value theorem it attains a maximum there, say at \( p \in [c_{0}, d] \). Since \( c_{0} + \eta \in [c_{0}, d] \), we have \( f(p) \ge f(c_{0} + \eta) \ge f(c_{0}) \gt f(d) \), so \( p \neq d \).

    Suppose \( p = c_{0} \). Then \( f(x) \le f(c_{0}) \) for all \( x \in [c_{0}, d] \), while the local minimum property gives \( f(x) \ge f(c_{0}) \) on \( [c_{0}, c_{0}+\eta] \). Hence \( f \) is constant on \( [c_{0}, c_{0} + \eta] \), so \( f'(x) = 0 \) at every point of the non-degenerate interval \( (c_{0}, c_{0}+\eta) \) — infinitely many zeros of \( f' \), contradicting the hypothesis that \( f' \) vanishes only at \( c_{0} \).

    Therefore \( p \in (c_{0}, d) \), an interior point of \( [c_{0},d] \) and of \( \mathbb{R} \), at which \( f \) has a local maximum and is differentiable. By Fermat's interior extremum theorem \( f'(p) = 0 \), so \( p = c_{0} \) by uniqueness of the zero — contradicting \( p \in (c_{0}, d) \). The assumption was false, so \( f(x) \ge f(c_{0} ) \) for all \( x \).

    Why dimension matters: in \( \mathbb{R}^{2} \) the function \( F(x,y) = x^{2} + y^{2}(1 - x)^{3} \) has a unique critical point at the origin, which is a strict local minimum, yet \( F(4, y) = 16 - 27y^{2} \to -\infty \) as \( y \to \infty \), so the local minimum is not global. The proof above fails there because a plane region cannot be cut into two halves by a single point: the escape to infinity can go around \( c_{0} \) rather than through a compact interval containing it.