Why a Complete Search Matters
An absolute-extrema search can go wrong even when every derivative is calculated correctly. A boundary edge may be skipped, a corner may be left out, or a solution of the critical-point equations may not belong to the region. Even after finding all relevant points, comparing their function values incorrectly can reverse the conclusion.
The reliable method is to make a complete list of feasible candidates, evaluate the objective at each one, and compare those values. The method also has conditions: continuity guarantees that absolute extrema exist on a compact region, while differentiability is needed to use interior derivative equations as a complete test for interior extrema.
What Makes a Candidate Search Complete?
For a closed and bounded region \(R\subset\mathbb{R}^2\), continuity of \(f\) on \(R\) guarantees that \(f\) attains both an absolute maximum and an absolute minimum there. This existence result does not, by itself, identify where those extrema occur. The derivative tests below narrow the search, provided their hypotheses are respected.
Suppose the boundary consists of finitely many smooth pieces, such as line segments or parametrized arcs. A complete search must account for:
- every feasible interior point where \(f\) is differentiable and \(\nabla f=\mathbf{0}\);
- interior points where \(f\) is not differentiable, unless differentiability throughout the interior has been assumed;
- interior stationary points of the restriction of \(f\) to each smooth boundary piece;
- every boundary endpoint, corner, or junction where the boundary pieces meet; and
- any other boundary points where the restricted function is not differentiable.
A solution of an equation is a candidate only if it lies in the region or on the boundary piece being searched. Conversely, checking one boundary piece does not check the rest of the boundary.
Why the Derivative Tests Work
The interior test follows from the one-variable Fermat theorem: if a differentiable function of one variable has a local maximum or minimum at an interior point of its domain, its derivative there is zero. At an interior extremum \(p=(a,b)\), restrict \(f\) first to the horizontal line through \(p\) and then to the vertical line through \(p\). Both restrictions have an extremum at the corresponding interior parameter value. Therefore both partial derivatives vanish.
This implication requires differentiability at the interior extremum. If \(f\) is not differentiable there, the derivative equations cannot be used to rule the point out.
For a boundary piece parametrized by \(\boldsymbol{\gamma}(t)=(x(t),y(t))\), define the one-variable restriction \(h(t)=f(\boldsymbol{\gamma}(t))\). At an extremum occurring in the interior of the parameter interval, if \(h\) is differentiable, Fermat's theorem gives \(h'(t)=0\). This identifies possible extrema along that piece. The piece's endpoints are not covered by this test: they must be checked separately.
To see why this list covers the possibilities, take a point where an absolute extremum is attained. It is either in the interior or on the boundary. In the interior, differentiability and the two coordinate-line tests give \(\nabla f=\mathbf{0}\); without differentiability, that conclusion is unavailable. On the boundary, the point is either inside one of its smooth pieces, where the one-variable test applies if the restriction is differentiable, or is an endpoint, junction, or point where that test does not apply. Thus omitting any of these cases can invalidate the search.
Worked Example: A Missed Boundary Edge
Worked Example: A Missed Boundary Edge
Find the absolute extrema of \(f(x,y)=x^2+y^2-2x-2y\) on the rectangle \(R=[0,2]\times[0,1]\). This example shows why checking some edges is not enough.
In the interior, the derivative equations are \(f_x=2x-2=0\) and \(f_y=2y-2=0\), which give \((x,y)=(1,1)\). This point is not in the interior because \(y=1\); it lies on the top edge. Do not count it as an interior critical point.
Check each edge by restricting \(f\) to it. On the bottom edge \(y=0\),
The derivative is \(2x-2\), so the edge's interior stationary point is \(x=1\), where \(f(1,0)=-1\). The endpoints have values \(f(0,0)=0\) and \(f(2,0)=0\).
On the top edge \(y=1\),
The derivative \(2x-2\) vanishes at \(x=1\), giving \(f(1,1)=-2\). The endpoints have values \(f(0,1)=-1\) and \(f(2,1)=-1\).
On the left edge \(x=0\), \(f(0,y)=y^2-2y=(y-1)^2-1\). Its derivative \(2y-2\) vanishes at the endpoint \(y=1\), and the endpoint values are \(f(0,0)=0\) and \(f(0,1)=-1\). On the right edge \(x=2\), \(f(2,y)=y^2-2y=(y-1)^2-1\); its derivative also vanishes at the endpoint \(y=1\), and the endpoint values are \(f(2,0)=0\) and \(f(2,1)=-1\).
Comparing the candidates gives an absolute minimum of \(-2\) at \((1,1)\) and an absolute maximum of \(0\) at \((0,0)\) and \((2,0)\). Substitution checks the minimum: \(f(1,1)=1+1-2-2=-2\). If the top edge is skipped, the minimum \(-2\) is missed and the reported minimum would be wrong.
Worked Example: Corners Are Candidates
Worked Example: Corners Are Candidates
Find the absolute extrema of \(f(x,y)=2x+y\) on the triangle \(T=\{(x,y):x\geq 0,\ y\geq 0,\ x+y\leq 1\}\). Because \(T\) is closed and bounded and \(f\) is continuous, both extrema exist.
The interior derivative equations have no solution: \(f_x=2\) and \(f_y=1\), so the gradient is never zero. Check the three edges. On \(y=0\), \(f(x,0)=2x\) for \(0\leq x\leq1\), with derivative \(2\) and endpoint values \(0\) and \(2\). On \(x=0\), \(f(0,y)=y\) for \(0\leq y\leq1\), with derivative \(1\) and endpoint values \(0\) and \(1\).
On the sloping edge \(y=1-x\), where \(0\leq x\leq1\),
Its derivative is \(1\), and its endpoint values are \(f(0,1)=1\) and \(f(1,0)=2\). The three vertices therefore have values \(f(0,0)=0\), \(f(0,1)=1\), and \(f(1,0)=2\). The minimum is \(0\) at \((0,0)\), and the maximum is \(2\) at \((1,0)\). Substitution gives \(f(0,0)=0\) and \(f(1,0)=2\), as reported.
No edge derivative vanishes in the interior of its interval. An approach that records only stationary points on edges would therefore produce no edge candidates at all. The endpoints cannot be discarded simply because they are corners.
Worked Example: Reject Inadmissible Critical Points
Worked Example: Reject Inadmissible Critical Points
Find the absolute extrema of \(f(x,y)=(x-2)^2+(y-2)^2\) on the square \(S=[0,1]\times[0,1]\). The gradient equations give \((x,y)=(2,2)\), but this point lies outside \(S\), so it is not a candidate for extrema on \(S\).
Check the edges. On \(x=0\), \(f(0,y)=4+(y-2)^2\), whose derivative is \(2(y-2)\), nonzero for \(0\leq y\leq1\). On \(x=1\), \(f(1,y)=1+(y-2)^2\), with the same derivative and no stationary point on the edge. On \(y=0\), \(f(x,0)=(x-2)^2+4\), with derivative \(2(x-2)\), nonzero throughout the interval. On \(y=1\), \(f(x,1)=(x-2)^2+1\), also with derivative \(2(x-2)\), nonzero there.
Thus the candidates are the four corners. Their values are \(f(0,0)=4+4=8\), \(f(1,0)=1+4=5\), \(f(0,1)=4+1=5\), and \(f(1,1)=1+1=2\). The absolute maximum is \(8\) at \((0,0)\); the absolute minimum is \(2\) at \((1,1)\). Direct substitution confirms both values. Including the inadmissible point would introduce the value \(f(2,2)=0\), but that value has no bearing on the extrema over \(S\).
Worked Example: Compare Function Values Carefully
Worked Example: Compare Function Values Carefully
Find the absolute extrema of \(f(x,y)=x^2-y\) on the square \(Q=[0,1]\times[0,1]\). The interior equations have no solution because \(f_y=-1\) everywhere. On the bottom edge \(y=0\), \(f(x,0)=x^2\), with derivative \(2x\); the stationary point \(x=0\) is an endpoint, and the endpoint values are \(0\) and \(1\). On the top edge \(y=1\), \(f(x,1)=x^2-1\), with derivative \(2x\); its endpoint values are \(-1\) and \(0\).
On the left edge \(x=0\), \(f(0,y)=-y\), which has endpoint values \(0\) and \(-1\). On the right edge \(x=1\), \(f(1,y)=1-y\), which has endpoint values \(1\) and \(0\). The corner values, found by direct substitution, are
The absolute minimum is \(-1\) at \((0,1)\), and the absolute maximum is \(1\) at \((1,0)\). For example, at the minimum, \(f(0,1)=0^2-1=-1\). A sign error that turns \(x^2-y\) into \(x^2+y\) would incorrectly give \(1\) at that corner. Comparing only coordinates, rather than evaluating \(f\), is not a valid way to rank candidates.
A Practical Audit Before You Finish
Before reporting absolute extrema, check the search itself as well as the arithmetic. Ask whether \(R\) is closed and bounded and \(f\) is continuous, so the extrema are guaranteed to exist. Then make sure every part of the boundary has been checked and every corner, endpoint, or junction has been included. Confirm that each proposed point satisfies the region's constraints. Finally, evaluate \(f\) at every candidate and compare those function values directly.
Check Your Understanding
Use these questions to test whether a candidate search is complete.
- Why does continuity on a closed and bounded region guarantee that absolute extrema exist, but not tell you where they occur?
- What additional points must be considered if \(f\) is not differentiable throughout the interior?
- Why must the endpoints of a boundary edge be checked even when the edge restriction has no stationary point?
- What makes a solution of the gradient equations inadmissible in a search over a specified region?
- For \(f(x,y)=x^2-y\) at \((0,1)\), what is the function value, and what sign error could change it?