Before tackling two variables, recall the single-variable case. The function y=x2 has a minimum at x=0 because the tangent line there is horizontal — the derivative vanishes.
y = x² — minimum at origin
The tangent is horizontal at the minimum: y′(0)=0. The same idea extends to two variables using the gradient.
1. Local maxima and minima
Definition. A function f(x,y) has a local maximum at (a,b) if f(a,b)≥f(x,y) for all (x,y) in some open disk around (a,b). It has a local minimum if f(a,b)≤f(x,y) in that disk.
Informally: a local maximum is a hilltop, a local minimum is a valley bottom — both from the local perspective of a neighborhood.
2. Critical points
Theorem. If f has a local maximum or minimum at (a,b) and the partial derivatives exist there, then
∇f(a,b)=0,i.e.,fx(a,b)=0 and fy(a,b)=0.
A point where ∇f=0 (or ∇f does not exist) is called a critical point.
Warning. Not every critical point is a local extremum. Just as x=0 is a critical point of y=x3 but not an extremum, functions of two variables can have critical points that are saddle points — neither a max nor a min.
3. Three-dimensional illustration: the paraboloid
The surface z=x2+y2 has fx=2x and fy=2y. Both vanish only at (0,0). The tangent plane there is z=0 — horizontal, confirming the minimum.
Blue = surface z = x² + y². Orange = tangent plane at critical point (0, 0, 0) where ∇f = 0.
The surface curves upward in every direction from the origin, so (0,0) is indeed a local (and global) minimum.
4. Example: f(x,y)=x2+y2−2x−6y+14
Find and classify the critical point.
Set the partial derivatives to zero:
fx=2x−2=0⟹x=1,fy=2y−6=0⟹y=3.
So (1,3) is the only critical point. Completing the square confirms it is a minimum:
f(x,y)=(x−1)2+(y−3)2+4≥4,
with equality at (1,3). The minimum value is f(1,3)=4.
Blue = surface z = (x−1)² + (y−3)² + 4. Orange = tangent plane at critical point (1, 3, 4) where ∇f = 0.
5. Example: f(x,y)=y2−x2
Find and classify the critical point.
fx=−2x=0,fy=2y=0⟹(0,0) is the only critical point.
But f(0,0)=0, while f(1,0)=−1<0 and f(0,1)=1>0. So (0,0) is neither a local max nor a local min — it is a saddle point.
Blue = surface z = y² − x². Orange = tangent plane at critical point (0, 0, 0) where ∇f = 0.
6. The second derivative test
To classify a critical point without completing the square, use the discriminant
D(a,b)=fxx(a,b)fyy(a,b)−[fxy(a,b)]2.
Second derivative test. Let (a,b) be a critical point of f.
Condition
Conclusion
D>0 and fxx(a,b)>0
local minimum
D>0 and fxx(a,b)<0
local maximum
D<0
saddle point
D=0
test is inconclusive
7. Hessian matrix and concavity
The Hessian matrix of f at a point is
H=(fxxfxyfxyfyy).
For a unit vector u=⟨a,b⟩, the second directional derivative is
Du2f=uTHu=a2fxx+2abfxy+b2fyy.
This is the Hessian quadratic form. The sign of Du2f for all directions u determines concavity:
H is positive definite⟺Du2f>0 for every u=0⟺ the surface is concave up in every direction ⟺ local minimum.
H is negative definite⟺Du2f<0 for every u=0⟺ the surface is concave down in every direction ⟺ local maximum.
H is indefinite (positive in some directions, negative in others) ⟺ saddle point.
The discriminant D=det(H)=fxxfyy−fxy2 is the determinant of the Hessian. When D>0 the Hessian is definite (the sign is determined by fxx); when D<0 it is indefinite.
The paraboloid z=x2+y2 has H=(2002) — positive definite, concave up in every direction:
Blue = surface z = x² + y². Orange = tangent plane at critical point (0, 0, 0) where ∇f = 0.
The saddle z=y2−x2 has H=(−2002) — indefinite, concave up in the y-direction but down in the x-direction:
Blue = surface z = y² − x². Orange = tangent plane at critical point (0, 0, 0) where ∇f = 0.
8. Applying the second derivative test to f=y2−x2
At the critical point (0,0):
fxx=−2,fyy=2,fxy=0.
D=fxxfyy−fxy2=(−2)(2)−0=−4<0.
Since D<0, the origin is a saddle point — confirming the observation from Section 5.
9. Absolute extrema on a closed region
Local extrema are found at critical points inside a region. But to find absolute (global) extrema on a closed, bounded region D, we must also check the boundary of D.
Procedure:
Find all critical points of f inside D and evaluate f there.
Find the maximum and minimum of f on the boundary of D.
The overall maximum (or minimum) is the largest (or smallest) of all these values.
Analogy in one variable. Consider y=x2 on the interval [−1,1]. The interior critical point is x=0 (minimum, y=0), but the absolute maximum occurs at the boundary points x=±1 (where y=1).
y = x² on [−1, 1]: absolute max at the boundary endpoints
The marked points at x=±1 are the boundary; the absolute maximum value 1 is attained there, not at the interior minimum.
10. Exercises
Solution.
fx=3x2−3=0⟹x=±1.fy=2y−2=0⟹y=1.
Critical points: (1,1) and (−1,1).
Second derivatives: fxx=6x, fyy=2, fxy=0. So D=12x.
At (1,1): D=12>0 and fxx=6>0 → local minimum. f(1,1)=1−3+1−2=−3.
At (−1,1): D=−12<0 → saddle point.
Solution.
fx=2x+y−3=0,fy=x+2y=0⟹x=−2y.
Substituting: 2(−2y)+y−3=0⟹−3y=3⟹y=−1, x=2.
Critical point: (2,−1).
fxx=2,fyy=2,fxy=1.D=(2)(2)−12=3>0,fxx=2>0.
Local minimum at (2,−1). f(2,−1)=4−2+1−6=−3.
Solution.
fx=4x3=0 and fy=4y3=0 give the only critical point (0,0).
The second derivative test gives D=(12⋅0)(12⋅0)−0=0, so it is inconclusive.
However, f(x,y)=x4+y4≥0 for all (x,y), and f(0,0)=0. Therefore (0,0) is a global minimum by direct argument.
Solution.
Interior critical points.fx=2x−2=0⟹x=1; fy=2y=0⟹y=0. Critical point (1,0) is inside the disk. f(1,0)=1−2=−1.
Boundary. On x2+y2=4 use the parametrization x=2cost, y=2sint:
g(t)=4−4cost.
Maximum when cost=−1: point (−2,0), f(−2,0)=4+4=8.
Minimum when cost=1: point (2,0), f(2,0)=4−4=0.
Conclusion. Absolute minimum −1 at (1,0); absolute maximum 8 at (−2,0).