To find the peaks and pits on a 3D surface f(x,y), we first need a way to locate every candidate spot on the surface.
1
Flat Spots and Horizontal Tangent Planes
A flat spot on a smooth surface is a point where the surface does not tilt in either the x-direction or the y-direction. On a single-variable curve f(x), peaks and pits happen where the tangent line is horizontal and the slope is zero. On a surface f(x,y), there are two slopes: fx along the x-slice and fy along the y-slice. Both slopes must be zero at the exact same point for the tangent plane to be horizontal, which means the uphill gradient vector ∇f=⟨fx,fy⟩ equals ⟨0,0⟩.
Flat Spots and Horizontal Tangent Planes
Here is how we find the flat spot on f(x,y)=x2+y2−4x−6y.
Text solution
Set the x-slope to zeroKeeping y constant, differentiate the x terms to find where the x-slice is flat:
fx2x−42xx=2x−4=0=4=2
Set the y-slope to zeroKeeping x constant, differentiate the y terms to find where the y-slice is flat:
fy2y−62yy=2y−6=0=6=3
Combine the coordinates at the flat spotBoth slices are flat at the same time only at (2,3), so the tangent plane is horizontal there and the slope is zero in every direction:
∇f(2,3)=⟨0,0⟩
On f(x,y)=x2+y2−4x−6y, making only the x-slice flat along x=2 or only the y-slice flat along y=3 still leaves the tangent plane tilted and ∇f nonzero. The tangent plane becomes completely horizontal and ∇f equals ⟨0,0⟩ only at (2,3), where fx=0 and fy=0 at the same time.
Flattening just one slice still leaves the tangent plane tilted, so both slices have to go flat at the same time to level the plane and shrink the gradient to zero.
2
Sharp Points and Critical Points
Setting fx=0 and fy=0 finds every smooth flat spot, but a peak or a pit can also sit at a sharp tip or crease where there is no tangent plane. A critical point is any point (a,b) on the surface that is either a smooth flat spot or a sharp point where a partial derivative does not exist.
Now let's see what happens at the sharp tip of the cone f(x,y)=x2+y2.
Sharp Points and Critical Points
Text solution
Differentiate in the x- and y-directionsAway from the tip of f(x,y)=x2+y2, taking the partial derivatives puts the square root in the denominator:
fxfy=x2+y2x,=x2+y2y
Check where the derivatives are undefinedPlugging (0,0) into either formula gives 00, so the formulas give no value at the origin. Slicing along the x-axis shows why: there the cone is ∣x∣, which has a sharp corner at x=0, so fx(0,0) does not exist, and the slice f(0,y)=∣y∣ along the y-axis shows fy(0,0) does not exist either:
f(x,0)=x2=∣x∣
Compare heights around (0,0)Because (0,0) has height 0 while every other point on the cone is higher up, the sharp critical point at (0,0) is a pit:
f(0,0)=0,f(x,y)=x2+y2>0 for (x,y)=(0,0)
smooth flat spot
fx=0,fy=0(∇f=⟨0,0⟩)
sharp tip
f(x,y)=x2+y2
(0,0)
fx,fy do not exist
Every local maximum or minimum of f(x,y) must happen at one of these two kinds of critical points:
smooth flat spot (∇f=⟨0,0⟩)fx(a,b)=0 and fy(a,b)=0orsharp point or creasefx(a,b) or fy(a,b) does not exist
3
Solving for Critical Points by Factoring
In our first example, fx=0 had only x and fy=0 had only y, so we could solve them one at a time. When x and y are mixed together in both equations, as in f(x,y)=x2y−8x2−y2, we have to solve them together as a system without accidentally losing solutions.
Solving for Critical Points by Factoring
f(x,y)=x2y−8x2−y2
fx=0 and fy=0 at (x,y)=?
Text solution
Set both partial derivatives to zeroSince f(x,y)=x2y−8x2−y2 is a smooth polynomial, its derivatives exist everywhere and critical points happen only where both slopes are zero:
fxfy=2xy−16x=0=x2−2y=0
Factor fx=0 into two casesFactor out 2x instead of dividing by x, splitting the equation into two separate cases:
2x(y−8)=0⟹x=0ory=8
Substitute Case 1 (x=0) into fy=0Plugging x=0 into the second equation gives the first critical point at (0,0):
02−2y−2yy=0=0=0
Substitute Case 2 (y=8) into fy=0Plugging y=8 into the second equation gives two values of x, which gives the points (4,8) and (−4,8):
x2−2(8)x2−16x2x=0=0=16=4 or x=−4
So the surface has three critical points: (0,0),(4,8), and (−4,8).
4
Peaks, Pits, and Saddles
Finding where fx=0 and fy=0 tells us where the surface is flat, but not what shape the surface has around that flat spot. Around a smooth critical point, the surface can form a peak (local maximum, curving down in every direction), a pit (local minimum, curving up in every direction), or a saddle point (curving up in one direction and down in another).
On a 1D curve, the second derivative f′′ tells us how the curve bends: negative for a downward-bending peak (∩) and positive for an upward-bending pit (∪). On a surface, fxx measures the bend in the x-direction and fyy measures the bend in the y-direction.
Peaks, Pits, and Saddles
x
y
f′′<0
f′′>0
fxx<0
fyy<0
Peak
fxx>0
fyy>0
Pit
fxx<0
fyy>0
Saddle point
5
Diagonal Twist and Hidden Saddles
Checking fxx and fyy only tells us how the surface bends along the x-axis and the y-axis. Even when both axis slices bend upward (fxx>0 and fyy>0), a large mixed xy term can twist the surface along the diagonals and turn the point into a saddle. Let's see how this happens at (0,0) on f(x,y)=x2+y2+4xy.
Diagonal Twist and Hidden Saddles
f(x,y)=x2+y2+4xy
x
y
fxx>0
fyy>0
(0,0)
Text solution
Slice along the x-axis (y=0)Setting y=0 leaves an upward-opening parabola in the x-direction:
f(x,0)=x2,fxx=2>0
Slice along the y-axis (x=0)Setting x=0 also leaves an upward-opening parabola in the y-direction:
f(0,y)=y2,fyy=2>0
Slice along the diagonal y=−xSubstituting y=−x into f(x,y)=x2+y2+4xy shows that the slice along the diagonal bends downward:
f(x,−x)=x2+(−x)2+4x(−x)=2x2−4x2=−2x2
Because the surface curves upward along the axes (x2 and y2) but curves downward along the diagonal (−2x2), (0,0) is a saddle point rather than a pit. Which way the surface ends up curving comes down to a tug-of-war between the second partial derivatives:
axis bendsfxx,fyyvs.diagonal twistfxy
On f(x,y)=x2+y2+4xy, the vertical slice through (0,0) bends upward along both the x-axis and the y-axis, but as you rotate the slice toward the diagonal y=−x, the parabola flattens out and flips to bend downward, showing that (0,0) is a saddle point.
Even when the slices along the x-axis and y-axis both bend up, slicing diagonally between them bends the curve down and reveals a saddle point.
6
Critical Points on a Contour Map
When a surface is shown from straight above as a contour map of level curves rather than an equation, we can spot and classify critical points directly from the shape of the curves and their height labels.
Remember that each contour line is a horizontal slice at a constant height z, the gradient vector ∇f is always perpendicular to the contour lines and points uphill toward higher numbers, and wider spacing between contours means a flatter surface.
Critical Points on a Contour Map
10
20
30
40
∇f
Peak
40
30
20
10
∇f
Pit
x
y
50
60
70
60
70
40
30
40
30
∇f
Saddle point
On this contour map and its matching 3D surface, the contour lines spread further apart where the surface flattens near each smooth critical point (∇f→⟨0,0⟩), with loops going up inward at the peak, loops going down inward at the pit, and an X-shaped crossing going up in two opposite directions and down in the other two at the saddle.
On a contour map, the height labels and uphill gradient arrow show whether nested loops climb to a peak or drop into a pit, while an X-crossing marks a saddle point that goes up in two opposite directions and down in the other two.
Summary
Here is how all of these pieces fit together when you analyze a surface f(x,y).
Lesson Recap
peak
pit
saddle
To find every candidate spot for a peak or a pit on f(x,y), start by finding the critical points:
Smooth flat spots (fx=0 and fy=0, so ∇f=⟨0,0⟩)
When x and y are already separated, as in fx=2x−4=0 and fy=2y−6=0, solve each equation on its own. You don't need to split into cases when only one variable appears in each equation. When x and y are multiplied together, as in 2xy−16x=0, factor as 2x(y−8)=0 and plug each case (x=0 and y=8) into the other equation so you never divide by a variable and lose a solution.
Sharp points or creases (fx or fy does not exist)
When taking the derivative puts variables in the denominator, as in fx=x2+y2x, check the point that makes the denominator zero ((0,0)) to catch sharp peaks or pits.
To tell a peak, a pit, and a saddle point apart:
From an equation
Opposite bends along the axes (fxx and fyy with opposite signs) right away give a saddle. When fxx and fyy have the same sign, check whether there is a mixed xy twist term (fxy): on f(x,y)=x2+y2+4xy, both axis slices bend upward (fxx=2>0,fyy=2>0), yet the diagonal slice f(x,−x)=−2x2 bends downward into a saddle.
From a contour map
Nested closed loops whose heights go up inward (10→20→30→40) mark a peak with ∇f pointing inward; nested closed loops whose heights go down inward (40→30→20→10) mark a pit with ∇f pointing outward; contours meeting in an X-shape whose heights go up in two opposite directions and down in the other two mark a saddle point.
7
Practice
1
Find the critical point of f(x,y)=x2+3y2−6x+12y+5, and give the value of ∇f at that point.
Watch out for the signs when moving −6 and +12 across the equals sign: reading the signs straight from −6x+12y gives the wrong point (−3,2).
For a smooth polynomial, both slices must be flat at the same time: fx=? and fy=?
Set the x-slope and y-slope to zero:
fxfy=2x−6=0⟹2x=6⟹x=3=6y+12=0⟹6y=−12⟹y=−2
(Watch out for the signs when moving −6 and +12 across the equals sign: reading the signs straight from −6x+12y gives the wrong point (−3,2).)
At (3,−2), the tangent plane is horizontal and the gradient is the zero vector (write the vector ⟨0,0⟩, not the number 0):
Critical point: (3,−2),∇f(3,−2)=⟨0,0⟩
2
Find the critical point of f(x,y)=4−x2+(y−1)2, explain why it is a critical point, and decide whether it is a peak, a pit, or a saddle point.
Check where the denominator of fx and fy becomes zero, then compare the height f(x,y) at that point with the height everywhere else.
Take the partial derivatives away from the tip:
fxfy=x2+(y−1)2−x,=x2+(y−1)2−(y−1)
At (0,1), both denominators are 02+(1−1)2=0, so the formulas give 0/0 and no value there. Slicing through (0,1) shows that neither fx nor fy exists there: along y=1 the surface has a sharp corner at x=0, and along x=0 it has one at y=1:
f(x,1)=4−x2=4−∣x∣,f(0,y)=4−∣y−1∣
(Don't conclude that there are no critical points just because fx and fy are never both 0: at (0,1) they don't exist, which makes it a sharp critical point.)
Plug (0,1) into the original function to check the height:
f(0,1)=4−0=4,f(x,y)=4−x2+(y−1)2<4 for (x,y)=(0,1)
(Watch the minus sign in front of the square root: unlike +x2+y2, which opens upward with a pit at height 0, subtracting the square root flips the cone upside down so 4 is the highest point rather than a pit.)
Critical point: (0,1) (sharp tip where fx,fy do not exist), which is a peak (local maximum)
3
Find all critical points of f(x,y)=2x2y−6x2−3y2.
In fx=4xy−12x=0, factor out the common term rather than dividing, then plug each case into fy=0.
Set both partial derivatives to zero:
fxfy=4xy−12x=0=2x2−6y=0
Factor 4x out of the first equation:
4x(y−3)=0⟹x=0ory=3
(Never divide 4xy=12x by 4x to get only y=3: that divides by zero when x=0 and loses the critical point (0,0).)
Case 1 (x=0)Substitute x=0 into 2x2−6y=0:
2(0)2−6y=0⟹−6y=0⟹y=0⟹(0,0)
Case 2 (y=3)Substitute y=3 into 2x2−6y=0:
2x2−6(3)=0⟹2x2=18⟹x2=9⟹x=3 or x=−3
(Remember both square roots of 9: taking only x=3 misses (−3,3).)
Critical points: (0,0),(3,3), and (−3,3)
4
On a contour map of a smooth surface f(x,y), point A sits at the center of nested closed loops whose heights go 50→40→30→20 as you move inward, point B sits at the center of nested closed loops whose heights go 20→30→40→50 as you move inward, and point C sits at an X-shaped crossing at height 30 where heights go up to 40 and 50 moving north or south and go down to 20 and 10 moving east or west. Classify A, B, and C as a peak, a pit, or a saddle point, and say whether the gradient arrows near A and B point inward or outward.
Check whether the height numbers go up or down as you move inward toward A and B, and remember that ∇f always points toward higher numbers.
Point AThe nested loops go down inward (50→40→30→20), so A sits at the bottom of a pit (local minimum). Because ∇f points uphill toward higher numbers (20→30→40→50), the gradient arrows near A point outward. (Don't point the gradient arrows inward just because the problem lists the loops going inward: at a pit, inward is downhill, so ∇f points outward.)
Point BThe nested loops go up inward (20→30→40→50), so B sits at the top of a peak (local maximum), and the uphill gradient arrows near B point inward.
Point CThe contour lines meet in an X-shape that goes uphill moving north or south (30→40→50) and downhill moving east or west (30→20→10), so C is a saddle point.
Show that (0,0) is a critical point of f(x,y)=−x2−y2+6xy, find how the surface bends along the x-axis and y-axis using fxx and fyy, and slice along the diagonal y=x to decide whether (0,0) is a peak, a pit, or a saddle point.
Compare the downward bend of the axis slices f(x,0) and f(0,y) with the diagonal slice f(x,x) you get by replacing y with x.
First check the partial derivatives at (0,0):
fxfy=−2x+6y⟹fx(0,0)=0,=−2y+6x⟹fy(0,0)=0
Both slopes are zero, so (0,0) is a critical point.
Next check the bends along the x-axis (y=0) and y-axis (x=0):