Remember

Recall from Calculus 1 that if has a local maximum/minimum at a point , and if exists, then .

MatPlotLib Graph

Python
Output

Calculus 1: local extrema correspond to horizontal tangent lines

But what about multivariable functions in the 3D plane?

Desmos


Extrema in 3D

Suppose a local extremum occurs at point P on the surface

This means that P must simultaneously be an extremum on every trace curve passing through P

MatPlotLib Graph

Python
Output

In Other Words:

The directional derivative at P must equal zero in every possible direction, as the tangent plane must be horizontal!

For all , resulting in:

What this means:

This says that if is a local maximum or minimum, and if the first order partial derivative exists, then the gradient vector at must equal zero.

  • is a local maximum
    • this means that for all in some neighborhood of

At , for all in some neighborhood of


Remarks

  1. This does not say if , then corresponds to a local extremum. However, it does suggest that we can find the local extrema by looking for where
  2. More specifically, "" means , ie. AND .
  3. The points where are called Critical Points. So, just like in Calculus 1, the local extrema “candidates” occur at Critical Points

Problems

Example

Find the local extrema of

Solution

To approach this problem, we need to start by finding the Critical Points:

Observe that , and by completing the square, we get that , resulting in:

Because and are always non-negative, for all . Therefore, is a local minimum


Saddle Points

Saddle points are points where the gradient is zero, but the point is neither a maximum nor a minimum.

Python
Output

Saddle Points present a unique challenge in optimization, as they are neither maxima nor minima. They are points where the gradient is zero, but the point is neither a maximum nor a minimum.


Second Derivative Test

Hessian Matrix

The Hessian Matrix is a square matrix of second-order partial derivatives of a scalar-valued function.

We need to know the eigenvalues of the Hessian Matrix to determine the nature of the critical point.

Now that we know this, we can move on tho the Second Partial Derivative Test.

Second Partial Derivative Test

Suppose the second order partial derivative are continuous, and that is a Critical Point.

  1. If and , then is a local minimum.

  2. If the Hessain Matrix is positive definite, then the point is a local minimum.

  3. If the Hessina Matrix is negative definite, then the point is a local maximum.

    • This becomes a saddle point if the determinant is negative.
  4. If the determinant is zero, the test is inconclusive.