Units

# Unit 4: Local Extrema and Saddle Points

## The Concept

We use the **first derivative test** and **second derivative test** to locate and distinguish between local minima, local maxima and saddle points for a function [latex]z = f(x,y)[/latex].

**First derivative test**

For functions of a single variable, [latex]y = f(x)[/latex], **critical points **in 2D are defined as the values of the function in which the derivative [latex]\frac{df}{dx}[/latex] equals zero or which does not exist. When dealing with functions of two variables, [latex]z = f(x,y)[/latex], the concept of critical points in 3D remains virtually identical, save for the fact that we must now deal with partial derivatives. Thus, for functions of two variables, [latex]z = f(x,y)[/latex], in order to find the critical points [latex](x_0, y_0)[/latex], we need to solve a system of two equations: [latex]\frac{\partial f}{\partial x}=0[/latex] and [latex]\frac{\partial f}{\partial y}=0[/latex].

**Second derivative test**

Similarly, the most important quantity in the second derivative test is **the Jacobian matrix**, denoted as ‘[latex]J[/latex]’. It is the matrix of all its second-order partial derivatives, i.e.,

[latex]J=\begin{pmatrix} \frac{\partial^2 f}{\partial x^2} & \frac{\partial^2 f}{\partial x \partial y} \\ \frac{\partial^2 f}{\partial y \partial x} & \frac{\partial^2 f}{\partial y^2} \end{pmatrix}=\begin{pmatrix} f_{xx} & f_{xy} \\ f_{yx}& f_{yy} \end{pmatrix}[/latex].

Note that [latex]f_{xy}=f_{yx}[/latex]. We plug in the critical points from the first derivative into the Jacobian and calculate **the determinant of the Jacobian matrix**, denoted as ‘[latex]D[/latex]’, i.e.,

[latex]D=\begin{vmatrix} f_{xx}(x_0, y_0) & f_{xy}(x_0, y_0) \\ f_{yx}(x_0, y_0)& f_{yy}(x_0, y_0) \end{vmatrix}=f_{xx}(x_0, y_0) f_{yy}(x_0, y_0) - ( f_{xy}(x_0, y_0) )^2[/latex]

Then we use the following rules to conduct the second derivative test:

- If [latex]D>0[/latex] and [latex]f_{xx}(x_0, y_0)>0[/latex], then [latex]f[/latex] has a
**local minimum**at [latex](x_0, y_0)[/latex]. - If [latex]D>0[/latex] and [latex]f_{xx}(x_0, y_0)<0[/latex], then [latex]f[/latex] has a
**local maximum**at [latex](x_0, y_0)[/latex]. - If [latex]D<0[/latex], then [latex]f[/latex] has a
**saddle point**at [latex](x_0, y_0)[/latex]. - If [latex]D=0[/latex], then the test is inconclusive.

## The Plot

Now, you should engage with the 3D plot below to understand local maximum, local minimum and saddle points^{[1]}. Follow the steps below to apply changes to the plot and observe the effects:

- Input a function of two variables into the [latex]f(x,y)[/latex] input function section.
- Move the point on the plane around and the Jacobian determinant will automatically be calculated for you. The equation for each is provided, where the determinant of the jacobian represents the D value from the formula above.
- Once you hover over a local maximum, local minimum or a saddle point, a text will appear notifying you of the answer.

## Self-Checking Questions

Check your understanding by solving the following questions^{[2]}:

Use the first and second derivative tests to identify any critical points and determine whether each critical point is a maximum, minimum, saddle point or none of these.

- [latex]f(x,y) = -x^3+4xy-2y^2+1[/latex]
- [latex]f(x,y) = 2xye^{-x2-y2}[/latex]

Use the graph to find the answers to these questions.