Type a command or search the notes. Tab cycles completions. Up and down recall history when blank. Escape dismisses, then leaves the prompt.
MATH
[1251]

Local extrema

Critical points, stationary points and the Hessian test for local maxima, minima and saddles.

This page locates and classifies the local extrema of a function of several variables. At a stationary point the tangent plane is horizontal, which does not say whether the graph is a hill, a valley or a saddle. First-order calculus locates the candidates; the quadratic part of the multivariable Taylor model classifies them.

Local and absolute extrema

[DEFINITION]

Local and absolute extrema

Let f:D→Rf:D\to\mathbb{R} and let x0∈D\mathbf{x}_0\in D.

  • ff has a local minimum at x0\mathbf{x}_0 if f(x)≥f(x0)f(\mathbf{x})\ge f(\mathbf{x}_0) for every x\mathbf{x} in DD sufficiently close to x0\mathbf{x}_0.
  • ff has a local maximum at x0\mathbf{x}_0 if f(x)≤f(x0)f(\mathbf{x})\le f(\mathbf{x}_0) for every x\mathbf{x} in DD sufficiently close to x0\mathbf{x}_0.
  • ff has an absolute, or global, minimum at x0\mathbf{x}_0 if f(x)≥f(x0)f(\mathbf{x})\ge f(\mathbf{x}_0) for every x∈D\mathbf{x}\in D.
  • ff has an absolute maximum at x0\mathbf{x}_0 if f(x)≤f(x0)f(\mathbf{x})\le f(\mathbf{x}_0) for every x∈D\mathbf{x}\in D.

A local classification cannot settle a global optimisation problem.

Critical and stationary points

[DEFINITION]

Critical and stationary points

For f:D→Rf:D\to\mathbb{R}, an interior point x0∈int⁡(D)\mathbf{x}_0\in\operatorname{int}(D) is a critical point if ff is not differentiable at x0\mathbf{x}_0 or if ∇f(x0)=0\nabla f(\mathbf{x}_0)=\mathbf{0}. A point at which the gradient exists and is zero is called a stationary point.

Critical points include points where differentiability fails because such points can still be extrema. The stationary-point equations locate only the critical points with zero gradient; boundary points are handled separately in a global-extrema problem.

[THEOREM]

The multivariable Fermat condition

If all first partial derivatives of ff exist at an interior local maximum or local minimum x0\mathbf{x}_0, then

∇f(x0)=0.{\nabla f(\mathbf{x}_0)=\mathbf{0}}.

Differentiability is sufficient for the partial derivatives to exist, but is stronger than what this coordinatewise condition needs. The condition is necessary, not a classification: a stationary point may be a local maximum, a local minimum, a saddle, or a point requiring higher-order analysis.

[PROOF]

Fix a coordinate direction and vary only that coordinate through x0\mathbf{x}_0. Since x0\mathbf{x}_0 is an interior local extremum of ff, the resulting one-variable function also has a local extremum at the corresponding coordinate value. The one-variable Fermat condition makes the associated partial derivative zero. Repeating this for every coordinate gives

fx1(x0)=⋯=fxn(x0)=0,f_{x_1}(\mathbf{x}_0)=\cdots=f_{x_n}(\mathbf{x}_0)=0,

which is exactly ∇f(x0)=0\nabla f(\mathbf{x}_0)=\mathbf{0}.

[METHOD]

Find stationary points

For a function f(x,y)f(x,y):

  1. calculate fxf_x and fyf_y;
  2. solve fx(x,y)=0,fy(x,y)=0;f_x(x,y)=0, \qquad f_y(x,y)=0;
  3. retain the simultaneous solutions in the domain;
  4. classify each candidate using local geometry or the Hessian test.

For a complete search for interior extrema, also inspect points where ff is not differentiable; the stationary equations cannot detect those points.

[EXAMPLE]

Finding two stationary points

Let

f(x,y)=8x3+y2−6xy−2y+3.f(x,y)=8x^3+y^2-6xy-2y+3.

Then

fx=24x2−6y,fy=2y−6x−2.f_x=24x^2-6y, \qquad f_y=2y-6x-2.

The stationary equations give

y=4x2,y=3x+1.y=4x^2, \qquad y=3x+1.

Hence

4x2=3x+1,(4x+1)(x−1)=0.4x^2=3x+1, \qquad (4x+1)(x-1)=0.

The stationary points are

(1,4)and(−14,14).{(1,4)} \qquad\text{and}\qquad {\left(-\frac14,\frac14\right)}.

The Fermat condition needs only the coordinate partial derivatives, but their existence does not guarantee differentiability, which the tangent-plane and directional-derivative formulas require. Partial derivatives inspect only the coordinate paths and may miss behaviour along other directions.

[EXAMPLE]

Zero partial derivatives without differentiability

Define

f(x,y)={xyx2+y2,(x,y)≠(0,0),0,(x,y)=(0,0).f(x,y)= \begin{cases} \dfrac{xy}{x^2+y^2},&(x,y)\ne(0,0),\\[6pt] 0,&(x,y)=(0,0). \end{cases}

Along the coordinate axes,

f(h,0)=0,f(0,h)=0,f(h,0)=0, \qquad f(0,h)=0,

so

fx(0,0)=0,fy(0,0)=0.f_x(0,0)=0, \qquad f_y(0,0)=0.

However, along y=xy=x,

f(t,t)=t22t2=12(t≠0).f(t,t)=\frac{t^2}{2t^2}=\frac12 \qquad(t\ne0).

The function is therefore not continuous at the origin and cannot be differentiable there, even though its two partial derivatives exist and vanish.

The geometry of a stationary point

At a stationary point (x0,y0)(x_0,y_0) of the graph z=f(x,y)z=f(x,y), the tangent plane has equation

z=f(x0,y0),z=f(x_0,y_0),

because both first partial derivatives vanish.

A saddle point is a point x0\mathbf{x}_0 for which every neighbourhood within the domain contains points with both larger and smaller function values than f(x0)f(\mathbf{x}_0). A saddle is neither a local maximum nor a local minimum.

[EXAMPLE]

A saddle from two directions

For

f(x,y)=xy,f(x,y)=xy,

the only stationary point is (0,0)(0,0) because

∇f(x,y)=(yx).\nabla f(x,y) = \begin{pmatrix} y\\ x \end{pmatrix}.

Along y=xy=x,

f(t,t)=t2>0(t≠0),f(t,t)=t^2>0 \qquad(t\ne0),

whereas along y=−xy=-x,

f(t,−t)=−t2<0.f(t,-t)=-t^2<0.

Every neighbourhood of the origin contains larger and smaller values than f(0,0)=0f(0,0)=0, so the origin is a saddle point.

Classifying stationary points

The gradient gives the linear part of the local model. At a stationary point that part vanishes, so the Hessian supplies the next term to inspect. If the quadratic part also vanishes in some directions, higher-order terms may matter.

[DEFINITION]

Hessian matrix

For f:R2→Rf:\mathbb{R}^2\to\mathbb{R}, the Hessian at x0=(x0,y0)\mathbf{x}_0=(x_0,y_0) is

Hf(x0)=(fxx(x0)fxy(x0)fyx(x0)fyy(x0)).H_f(\mathbf{x}_0) = \begin{pmatrix} f_{xx}(\mathbf{x}_0)&f_{xy}(\mathbf{x}_0)\\ f_{yx}(\mathbf{x}_0)&f_{yy}(\mathbf{x}_0) \end{pmatrix}.
[THEOREM]

The second-order partial derivative test

Let x0=(x0,y0)\mathbf{x}_0=(x_0,y_0) be a stationary point. Assume that ff has continuous second-order partial derivatives on a neighbourhood of x0\mathbf{x}_0 (so ff is C2C^2 there). Define

D=det⁡Hf(x0)=fxx(x0)fyy(x0)−fxy(x0)2.D =\det H_f(\mathbf{x}_0) =f_{xx}(\mathbf{x}_0)f_{yy}(\mathbf{x}_0) -f_{xy}(\mathbf{x}_0)^2.

Then:

  • if D>0D>0 and fxx(x0)>0f_{xx}(\mathbf{x}_0)>0, x0\mathbf{x}_0 is a local minimum;
  • if D>0D>0 and fxx(x0)<0f_{xx}(\mathbf{x}_0)<0, x0\mathbf{x}_0 is a local maximum;
  • if D<0D<0, x0\mathbf{x}_0 is a saddle point;
  • if D=0D=0, the test is inconclusive.

At a stationary point, the quadratic Taylor term is

12hTHf(x0)h.\frac12\mathbf{h}^{\mathsf T}H_f(\mathbf{x}_0)\mathbf{h}.

For a symmetric Hessian, this quadratic form is positive definite if it is positive for every nonzero h\mathbf{h}, negative definite if it is negative for every nonzero h\mathbf{h} and indefinite if it takes both positive and negative values. The test uses DD and fxxf_{xx} to tell these cases apart.

When D>0D>0, the quadratic form has one sign in all non-zero directions and fxxf_{xx} determines whether that sign is positive or negative. When D<0D<0, the form changes sign, which is the algebraic signature of a saddle. If D=0D=0, higher-order terms or direct comparisons along curves are required.

To see the determinant rule when D>0D>0, write a=fxx(x0)a=f_{xx}(\mathbf{x}_0), b=fxy(x0)b=f_{xy}(\mathbf{x}_0) and c=fyy(x0)c=f_{yy}(\mathbf{x}_0). Then a≠0a\ne0 and the quadratic part satisfies

ah2+2bhk+ck2=a(h+bak)2+Dak2.ah^2+2bhk+ck^2 =a\left(h+\frac ba k\right)^2+\frac Da k^2.

Both coefficients on the right have the sign of aa, so small nonzero displacements change ff in the same direction.

For intuition, a symmetric Hessian has principal directions described by its eigenvectors. Its eigenvalues give the curvatures in those directions: both positive suggests a local minimum, both negative a local maximum and opposite signs a saddle. In two variables, DD is the product of those two eigenvalues, while fxxf_{xx} picks the sign when they agree.

[METHOD]

Classify a stationary point

For each stationary point:

  1. calculate the Hessian entries at the point;
  2. compute D=fxxfyy−fxy2D=f_{xx}f_{yy}-f_{xy}^2;
  3. use the sign of DD and then the sign of fxxf_{xx} when D>0D>0;
  4. if D=0D=0, inspect higher-order terms or compare the function along carefully chosen curves.
[EXAMPLE]

Standard quadratic surfaces

For

f(x,y)=x2+y2,f(x,y)=x^2+y^2,

the Hessian at the origin is

Hf(0,0)=(2002),D=4>0,fxx=2>0.H_f(0,0) = \begin{pmatrix} 2&0\\ 0&2 \end{pmatrix}, \qquad D=4>0, \qquad f_{xx}=2>0.

Thus the origin is a local minimum; f(x,y)≥0f(x,y)\ge0 everywhere, so it is also a global minimum.

For

g(x,y)=−x2−y2,g(x,y)=-x^2-y^2,

we have D=4>0D=4>0 and gxx=−2<0g_{xx}=-2<0, so the origin is a local maximum.

For

h(x,y)=x2−y2,h(x,y)=x^2-y^2,

the Hessian is

Hh(0,0)=(200−2),D=−4<0.H_h(0,0) = \begin{pmatrix} 2&0\\ 0&-2 \end{pmatrix}, \qquad D=-4<0.

The origin is therefore a saddle; the two coordinate axes show this directly.

[EXAMPLE]

Classifying the stationary points of a cubic

Let

f(x,y)=x3−y3+3xy.f(x,y)=x^3-y^3+3xy.

The first derivatives are

fx=3x2+3y,fy=−3y2+3x.f_x=3x^2+3y, \qquad f_y=-3y^2+3x.

Thus

y=−x2,x=y2,y=-x^2, \qquad x=y^2,

so x=x4x=x^4. The stationary points are (0,0)(0,0) and (1,−1)(1,-1).

The Hessian is

Hf(x,y)=(6x33−6y).H_f(x,y) = \begin{pmatrix} 6x&3\\ 3&-6y \end{pmatrix}.

At (0,0)(0,0),

det⁡Hf(0,0)=−9<0,\det H_f(0,0)=-9<0,

so the origin is a saddle. At (1,−1)(1,-1),

Hf(1,−1)=(6336),det⁡Hf(1,−1)=27>0,fxx(1,−1)=6>0.H_f(1,-1) = \begin{pmatrix} 6&3\\ 3&6 \end{pmatrix}, \qquad \det H_f(1,-1)=27>0, \qquad f_{xx}(1,-1)=6>0.

Therefore (1,−1)(1,-1) is a local minimum. Its value is

f(1,−1)=1−(−1)3+3(1)(−1)=−1.f(1,-1)=1-(-1)^3+3(1)(-1)=-1.
[EXAMPLE]

Checking a positive factor for new stationary points

Let

f(x,y)=xy ex2+y2.f(x,y)=xy\,e^{x^2+y^2}.

The derivatives factor as

fx=y ex2+y2(1+2x2),fy=x ex2+y2(1+2y2).f_x=y\,e^{x^2+y^2}(1+2x^2), \qquad f_y=x\,e^{x^2+y^2}(1+2y^2).

The exponential factors and the terms 1+2x21+2x^2, 1+2y21+2y^2 are always positive. Both derivatives therefore vanish only at (0,0)(0,0). At that point,

Hf(0,0)=(0110),det⁡Hf(0,0)=−1.H_f(0,0) = \begin{pmatrix} 0&1\\ 1&0 \end{pmatrix}, \qquad \det H_f(0,0)=-1.

The origin is a saddle. In this example, the derivative factors prove that the positive exponential adds no stationary points; positivity of a factor alone would not guarantee that for every product.

[EXAMPLE]

Revisiting the polynomial stationary points

For

f(x,y)=8x3+y2−6xy−2y+3,f(x,y)=8x^3+y^2-6xy-2y+3,

the Hessian and its determinant are

Hf(x,y)=(48x−6−62),det⁡Hf(x,y)=96x−36.H_f(x,y) = \begin{pmatrix} 48x&-6\\ -6&2 \end{pmatrix}, \qquad \det H_f(x,y)=96x-36.

At (1,4)(1,4),

det⁡Hf(1,4)=60>0,fxx(1,4)=48>0,\det H_f(1,4)=60>0, \qquad f_{xx}(1,4)=48>0,

so (1,4)(1,4) is a local minimum. At (−1/4,1/4)(-1/4,1/4),

det⁡Hf(−14,14)=−60<0,\det H_f\left(-\frac14,\frac14\right)=-60<0,

so that point is a saddle.

Local classification compares values only near one point. On a closed and bounded region, the absolute maximum and minimum also require every boundary piece; the global extrema page sets out that search.

On this page