Recalling that the graph \({z = f(x,y)}\) of a multivariable function \(f\)
is a surface in \(xyz\)-space, the extrema of \(f\) correspond to
the peaks of hills or the bottoms of valleys on that surface.
Just like the line tangent to the graph of a single-variable function
must be perfectly horizontal at an extremum,
the plane tangent to the graph of a multivariable function
must also be perfectly horizontal at an extremum.
The partial derivatives of \(f\) can be used to determine
exactly where these extrema occur using an analysis similar to
the first- and second-derivative tests for single-variable functions.
If \(f\) has a local extremum at the point \((a,b)\)
and \(f_x(a,b)\) and \(f_y(a,b)\) exist,
then \(f_x(a,b) = 0\) and \(f_y(a,b) = 0;\)
this indicates that the plane tangent to
the graph \({z = f(x,y)}\) is horizontal at the point.
This condition is necessary for \((a,b)\) to correspond to an extremum, but not sufficient.
Such a point may also correspond to a saddle point
at which the function is “minimal in one direction but maximal in another”.
To determine whether such a point \((a,b)\) corresponds to an extremum or saddle
we must analyze the second derivatives of \(f.\)
The discriminant of \(f\) at \((a,b),\) denoted \(D\) and sometimes called the Hessian of \(f,\) is calculated as \( D = f_{xx}(a,b)f_{yy}(a,b) - \bigl(f_{xy}(a,b)\bigr)^2\,. \) If \(f_x(a,b) = 0\) and \(f_y(a,b) = 0\) and the second partial derivatives of \(f\) are continues in a neighborhood of \((a,b),\) then
- if \(D \gt 0\) and \(f_{xx}(a,b) \gt 0,\) then \(f(a,b)\) is a local minimum;
- if \(D \gt 0\) and \(f_{xx}(a,b) \lt 0,\) then \(f(a,b)\) is a local maximum;
- if \(D \lt 0\) then \((a,b)\) corresponds to a saddle point.