Unconstrained Optimization
We've developed some powerful tools for working with multivariable functions: we can take their partial derivatives, directional derivatives, and understand the relationship between the gradient and their level sets. Our next goal is to put this knowledge to work and learn how to find maximal and minimal values. This is a critical skill in real world applications, where we are looking to maximize efficiency, or minimize cost.
14.1Critical Points and Local Extrema
Definition 14.1 (Local Extrema and Saddle Points). An extremum is a catch-all term for a maximum or a minimum. A local minimum occurs at a point
A saddle point is a point where every neighborhood contains points at which the function is both larger and smaller.
In this section we will mainly be concerned with how to find local maxima and minima. A global maximum or minimum compares a point with the entire domain, not merely nearby points. Global extrema may occur on a boundary, occur where a derivative does not exist, or fail to exist altogether; the following chapter develops the extra candidate checks needed for those problems.
How can we find an equation to specify local extrema? In calculus I we had a nice approach using differentiation: at a local max or min a function is neither increasing nor decreasing so its derivative is zero. The same technique works here, where we consider each partial derivative independently!
Theorem 14.2 (The Gradient at Extrema). At an interior local maximum or minimum where
Definition 14.3 (Critical Points). The critical points of a function are interior points where the gradient is zero or where one or more first partial derivatives do not exist.
Like in Calculus I, we have to be careful as not all critical points are actually maxima or minima. The standard example there is
Example 14.4 (Critical Points of $x^3+y^3+6xy$). Find the critical points of
The gradient is
Setting both components equal to zero gives
Substitution yields the two solutions
These are the only critical points, but we still need second-order information to decide what happens at each one.
14.2Hessian Geometry and the Second-Derivative Test
Solving the system of equations arising from setting the gradient to zero is the analog of the first derivative test. What's the analog of the second derivative test? In Calculus I, this was looking for the "concavity" of the function, which was simply up or down. But we already know in multiple variables things are more complicated: there are hills, bowls and saddles to contend with.
Our tool to see which is the best local description is the quadratic approximation, which is particularly simple at a critical point. The zeroth order term is just a constant (which shifts a graph up or down but doesn't affect its shape), and the linear terms are zero - that's the definition of a critical point! Thus all we are left with are the quadratic terms, which were determined by the Hessian - the matrix of second derivatives.
Definition 14.5 (Quadratic Approximation at a Critical Point). Let
Near the critical point, the quadratic approximation is
Once we have a quadratic approximation to a surface we have an even better understanding of what it looks like near a point. Of course, that requires that we know what quadratic surfaces look like - and hence why we spent time on those earlier this semester! Generic nondegenerate quadratic models come in three types: hills, bowls and saddles.
At a critical point, a positive quadratic expression gives a bowl and a local minimum, a negative quadratic expression gives a hill and a local maximum, and an expression which takes both signs gives a saddle.
To determine whether our function has a maximum, minimum, or saddle at a given critical point, we need a formula involving
Set
If
Theorem 14.6 (Second-Derivative Test). Suppose
Then
is a saddle if⃗ 𝑝 .𝐷 < 0 is a local minimum if⃗ 𝑝 and𝐷 > 0 .𝑓 𝑥 𝑥 ( ⃗ 𝑝 ) > 0 is a local maximum if⃗ 𝑝 and𝐷 > 0 .𝑓 𝑥 𝑥 ( ⃗ 𝑝 ) < 0 If
, the test is inconclusive.𝐷 = 0
Although the completed-square calculation divided by
It is possible to go beyond the quadratic approximation and understand points for which this test is inconclusive, but doing so requires more complicated mathematics.
It is helpful to confirm that this test works in several examples.
Example 14.7 ($x^2+y^2-2x-6y+14$). Find and classify the critical points of
Since
the only critical point is
Because
Example 14.8 ($x^3+y^3+6xy$). We already found the critical points
so
At
Example 14.9 ($2x^3-xy+6xy^2$). Find and classify the critical points of
The first partial derivatives are
Solving
The second derivatives are
Thus
In higher dimensions, the same idea survives even though the two-variable determinant shortcut does not. If the quadratic term is positive in every direction, we have a local minimum; if it is negative in every direction, a local maximum; and if it takes both signs, a saddle.
14.3Critical Points and Contour Geometry
Having precise mathematical tools to understand the critical points of a function allows us to understand much of the local behavior of the function through its contour plot.
At a regular point, the gradient is nonzero and the linear approximation
dominates nearby. The level sets of this linear model are parallel lines, which explains why sufficiently close to a regular point the contours look nearly parallel.
At a nondegenerate critical point, the linear term vanishes and one of three quadratic models controls the local picture:
The first two produce nested contours around a minimum or maximum. The third produces hyperbolas, and at the saddle value its single singular level set crosses itself. Distinct level sets never cross.
We can plot and label critical points on an
The observation behind this method is that nothing singular happens at a regular point: if the first derivative is nonzero, then the function is increasing in some direction, and the level sets nearby locally look like a set of parallel lines! This is a gateway to a huge amount of modern and advanced mathematics called Morse theory.
For sufficiently regular functions with nondegenerate critical points, Morse theory relates changes in level sets to the local models at those critical points. Degenerate critical points and global topology can produce subtler behavior, so the three clean pictures above are local models rather than a complete global classification.
Optional application: Gradient descent. Chapter 13 showed that
where the positive number
This chapter found and classified unconstrained local behavior. The next
chapter adds constraints: the allowable points may lie on a curve or inside a
closed region, so boundaries and corners create new candidates that the
equation