Maxima and Minima of Functions of Two Variables

Relative Extrema, Saddle Points, Second Derivative Test, and Detailed Solutions

Locate relative maxima, minima, and saddle points of functions of two variables. Several examples with detailed solutions are presented. 3-Dimensional graphs of functions are shown to confirm the existence of these points. More on Optimization Problems with Functions of Two Variables is available on this website.

In what follows, \( C \) represents the constant of integration where applicable.

Theorem: Second Derivative Test for Functions of Two Variables

Let \( f \) be a function of two variables with continuous second-order partial derivatives \( f_{xx} \), \( f_{yy} \), and \( f_{xy} \) at a critical point \( (a, b) \). Let:

\[ D = f_{xx}(a, b) f_{yy}(a, b) - f_{xy}^2(a, b) \]

Examples with Detailed Solutions

Click on each example to view its detailed step-by-step solution.

Example 1

Determine the critical points and locate any relative minima, maxima, and saddle points of function \( f \) defined by:

\[ f(x, y) = 2x^2 + 2xy + 2y^2 - 6x \]
Show Solution to Example 1

Find the first partial derivatives \( f_x \) and \( f_y \):

\[ f_x(x, y) = 4x + 2y - 6 \] \[ f_y(x, y) = 2x + 4y \]

The critical points satisfy the equations \( f_x(x, y) = 0 \) and \( f_y(x, y) = 0 \) simultaneously:

\[ 4x + 2y - 6 = 0 \] \[ 2x + 4y = 0 \implies x = -2y \]

Substitute \( x = -2y \) into the first equation:

\[ 4(-2y) + 2y - 6 = 0 \implies -6y = 6 \implies y = -1 \]

Then \( x = -2(-1) = 2 \). The system has one critical point at \( (2, -1) \).

Find the second-order partial derivatives:

\[ f_{xx}(x, y) = 4, \quad f_{yy}(x, y) = 4, \quad f_{xy}(x, y) = 2 \]

Evaluate \( D \) at \( (2, -1) \):

\[ D = f_{xx}(2, -1) f_{yy}(2, -1) - f_{xy}^2(2, -1) = (4)(4) - 2^2 = 16 - 4 = 12 \]

Since \( D = 12 > 0 \) and \( f_{xx}(2, -1) = 4 > 0 \), function \( f \) has a local minimum at \( (2, -1) \).

The 3D graph confirms a local minimum at \( (2, -1, f(2, -1)) = (2, -1, -6) \).

critical points example 1, local minimum
Figure 1. Local minimum at (2,-1,-6)

Example 2

Determine the critical points and locate any relative minima, maxima, and saddle points of function \( f \) defined by:

\[ f(x, y) = 2x^2 - 4xy + y^4 + 2 \]
Show Solution to Example 2

Find the first partial derivatives \( f_x \) and \( f_y \):

\[ f_x(x, y) = 4x - 4y \] \[ f_y(x, y) = -4x + 4y^3 \]

Solve \( f_x(x, y) = 0 \) and \( f_y(x, y) = 0 \) simultaneously:

\[ 4x - 4y = 0 \implies x = y \]

Substitute \( x = y \) into \( -4x + 4y^3 = 0 \):

\[ -4y + 4y^3 = 0 \implies 4y(y^2 - 1) = 0 \implies y = 0, \; y = 1, \; y = -1 \]

Using \( x = y \), the critical points are:

\[ (0, 0), \; (1, 1), \; (-1, -1) \]

Find the second-order partial derivatives:

\[ f_{xx}(x, y) = 4, \quad f_{yy}(x, y) = 12y^2, \quad f_{xy}(x, y) = -4 \]

Evaluate \( D \) and \( f_{xx} \) at each critical point:

Critical Point \( (a, b) \) \( (0, 0) \) \( (1, 1) \) \( (-1, -1) \)
\( f_{xx}(a, b) \) 4 4 4
\( f_{yy}(a, b) \) 0 12 12
\( f_{xy}(a, b) \) -4 -4 -4
\( D \) -16 32 32
Conclusion Saddle Point Relative Minimum Relative Minimum
critical points example 2, 2 local minima and one saddle point
Figure 2. Two local minima and one saddle point

Example 3

Determine the critical points and locate any relative minima, maxima, and saddle points of function \( f \) defined by:

\[ f(x, y) = -x^4 - y^4 + 4xy \]
Show Solution to Example 3

Find the first partial derivatives \( f_x \) and \( f_y \):

\[ f_x(x, y) = -4x^3 + 4y \] \[ f_y(x, y) = -4y^3 + 4x \]

Solve \( f_x = 0 \) and \( f_y = 0 \):

\[ -4x^3 + 4y = 0 \implies y = x^3 \]

Substitute \( y = x^3 \) into the second equation:

\[ -4(x^3)^3 + 4x = 0 \implies -4x^9 + 4x = 0 \implies -4x(x^8 - 1) = 0 \implies x(x^4 - 1)(x^4 + 1) = 0 \]

Real solutions for \( x \) are \( x = 0, 1, -1 \). Using \( y = x^3 \), the critical points are:

\[ (0, 0), \; (1, 1), \; (-1, -1) \]

Second-order partial derivatives:

\[ f_{xx}(x, y) = -12x^2, \quad f_{yy}(x, y) = -12y^2, \quad f_{xy}(x, y) = 4 \]
Critical Point \( (a, b) \) \( (0, 0) \) \( (1, 1) \) \( (-1, -1) \)
\( f_{xx}(a, b) \) 0 -12 -12
\( f_{yy}(a, b) \) 0 -12 -12
\( f_{xy}(a, b) \) 4 4 4
\( D \) -16 128 128
Conclusion Saddle Point Relative Maximum Relative Maximum
critical points example 3, 2 local maxima and one saddle point
Figure 3. Two local maxima and one saddle point

Exercises

Determine the critical points of the functions below and find whether each point corresponds to a relative minimum, maximum, or saddle point. Click each exercise to check your answers.

Exercise 1

\( f(x, y) = x^2 + 3y^2 - 2xy - 8x \)

Show Answer

Critical point at \( (6, 2) \). Since \( f_{xx} = 2 > 0 \) and \( D = 2(6) - (-2)^2 = 8 > 0 \), there is a relative minimum at \( (6, 2) \).

Exercise 2

\( f(x, y) = x^3 - 12x + y^3 + 3y^2 - 9y \)

Show Answer

Critical points are \( (2, 1), (2, -3), (-2, 1), (-2, -3) \):

  • Relative minimum at \( (2, 1) \) (\( D = 144 > 0, f_{xx} = 12 > 0 \))
  • Relative maximum at \( (-2, -3) \) (\( D = 144 > 0, f_{xx} = -12 < 0 \))
  • Saddle points at \( (2, -3) \) and \( (-2, 1) \) (\( D = -144 < 0 \))

More Links on Partial Derivatives and Multivariable Functions