This surface has bumps, valleys, and passes. You can see them - but how do you prove which is which? A bump might be a true hilltop, or it might be a mountain pass that only looks like a peak from certain angles.

Where the Slope Vanishes

Imagine you're standing on a hilly landscape, represented by $z = f(x,y)$. If you're truly at the top of a hill, then every direction you step leads downward. That means the slope in every direction must be zero at that exact point. In particular, the slope in the $x$-direction and the slope in the $y$-direction must both be zero:

$$\frac{\partial f}{\partial x}(x_0, y_0) = 0 \quad \text{and} \quad \frac{\partial f}{\partial y}(x_0, y_0) = 0$$

Why is this necessary? Suppose $f$ has a relative maximum at $(x_0, y_0)$. Fix $y = y_0$ and look at the single-variable function $g(x) = f(x, y_0)$. This function has a maximum at $x_0$, so $g'(x_0) = f_x(x_0, y_0) = 0$. The same argument with $x = x_0$ fixed gives $f_y(x_0, y_0) = 0$. The reasoning for a minimum is identical.

Points where both partial derivatives vanish are called critical points. Every relative max and every relative min must occur at a critical point. But - and this is the crucial question - does a critical point have to be a max or min?

Think about $z = x^3$ in one variable: $z' = 0$ at $x = 0$, but that's neither a max nor a min - it's an inflection point. In two variables, even stranger things happen. Consider $z = x^2 - y^2$ at the origin: $f_x = 0$ and $f_y = 0$ at $(0,0)$, but it curves up in the $x$-direction and down in the $y$-direction. That's a saddle point - a critical point that's neither max nor min.

So we need a way to classify critical points. We need a test.

The Second Derivative Test

In one variable, the test is simple: at a critical point $x_0$, if $f''(x_0) > 0$ the curve bends upward (minimum), and if $f''(x_0) \lt 0$ it bends downward (maximum). We need to generalize this to two variables, where the surface can bend differently in different directions.

Here's the key idea. At a critical point $(x_0, y_0)$, the first directional derivative $\nabla_\alpha f$ is zero in every direction $\alpha$. So we look at the second directional derivative - the curvature of the surface along a line through the critical point in direction $\alpha$:

$$\nabla_\alpha \nabla_\alpha f = A\cos^2\alpha + 2B\sin\alpha\cos\alpha + C\sin^2\alpha$$

where we use the abbreviations:

$A = f_{xx}(x_0, y_0), \qquad B = f_{xy}(x_0, y_0), \qquad C = f_{yy}(x_0, y_0)$

This expression $P(\alpha) = A\cos^2\alpha + 2B\sin\alpha\cos\alpha + C\sin^2\alpha$ tells us how the surface curves in direction $\alpha$. For a maximum, we need $P(\alpha) \lt 0$ for every direction. For a minimum, $P(\alpha) > 0$ for every direction.

So when is $P(\alpha)$ always positive (or always negative)? There's a lovely algebraic argument. For $\alpha \ne \pm\pi/2$, we can factor out $\cos^2\alpha$ and write $P(\alpha) = \cos^2\alpha \cdot Q(\tan\alpha)$ where $Q(u) = Cu^2 + 2Bu + A$ is a quadratic in $u = \tan\alpha$. This quadratic has no real roots precisely when its discriminant $(2B)^2 - 4CA = 4(B^2 - AC) \lt 0$, i.e., when $AC - B^2 > 0$. In that case, $Q(u)$ has the same sign for all $u$, and that sign is determined by $A$ (just plug in $u = 0$).

This gives us the classification:

Local minimum $AC - B^2 > 0$ and $A > 0$
Surface curves upward in every direction
Local maximum $AC - B^2 > 0$ and $A \lt 0$
Surface curves downward in every direction
Saddle point $AC - B^2 \lt 0$
Some directions curve up, others down
Inconclusive $AC - B^2 = 0$
Need higher derivatives to decide

The trap here: students sometimes check $A > 0$ and $C > 0$ separately and conclude "minimum." That's not enough! You could have $A > 0$, $C > 0$, and still get a saddle point if $B$ is large enough to make $AC - B^2 \lt 0$. The cross-derivative $B = f_{xy}$ captures how the surface twists, and a strong enough twist overpowers the individual curvatures.

Worked example. Take $z = x^2 + 3xy + y^2 - 5x - 5y$. Setting $f_x = 2x + 3y - 5 = 0$ and $f_y = 3x + 2y - 5 = 0$, we solve: subtracting gives $-x + y = 0$, so $y = x$. Substitute back: $5x - 5 = 0$, giving $x = 1$, $y = 1$. The critical point is $(1, 1)$.

Now for the second derivatives: $f_{xx} = 2$, $f_{xy} = 3$, $f_{yy} = 2$. So $A = 2$, $B = 3$, $C = 2$. Check: $AC - B^2 = (2)(2) - (3)^2 = 4 - 9 = -5 \lt 0$. This is a saddle point - despite both $A > 0$ and $C > 0$ (positive curvature in each coordinate direction individually), the cross-term overwhelms them both.

Saddle Points: Seeing the Sign Change

A saddle point is beautiful and subtle. The surface passes through the critical point like a mountain pass - it curves upward along the ridge but downward along the valley. The second directional derivative $P(\alpha)$ literally changes sign as you rotate your direction.

Here's a classic example: $z = x^2 - y^2$. At the origin, $A = 2$, $B = 0$, $C = -2$, so $AC - B^2 = -4 \lt 0$ - a saddle. The directional second derivative is $P(\alpha) = 2\cos^2\alpha - 2\sin^2\alpha = 2\cos(2\alpha)$. Rotate the direction and watch the curvature swing from positive (upward) to negative (downward).

Left: the surface near the critical point. Right: a polar plot of $P(\alpha)$ - the second directional derivative as a function of direction. For a minimum, $P(\alpha) > 0$ everywhere (the polar curve stays in the positive region). For a saddle, it crosses zero and dips negative.

Notice how the level curves reveal the geometry too. At a max or min, level curves form closed ovals around the critical point. At a saddle, they form hyperbola-like curves - think of the contour lines around a mountain pass.

Absolute Extrema on Closed Regions

So far we've classified relative maxima and minima - local hilltops and valleys. But often we need the absolute largest or smallest value of $f$ on some region. Think of it this way: if you're optimizing the design of a container subject to constraints, you need the global best, not just a local one.

The key theorem (generalizing the familiar one-variable result) says:

Extreme Value Theorem. If $f(x,y)$ is continuous on a bounded, closed region $\bar{E}$ (domain plus boundary), then $f$ attains an absolute maximum and an absolute minimum on $\bar{E}$.

The algorithm for finding them mirrors the one-variable case:

  1. Find all critical points of $f$ inside the region (where $f_x = 0$ and $f_y = 0$).
  2. Optimize $f$ on the boundary. Parametrize the boundary curve and reduce to a one-variable problem, or use Lagrange multipliers (§2.20).
  3. Compare all values - the largest is the absolute max, the smallest is the absolute min.

Worked example (from Kaplan). Find the max and min of $z = x^2 + 2y^2 - x$ on the disk $x^2 + y^2 \le 1$.

Interior critical point: $f_x = 2x - 1 = 0$ and $f_y = 4y = 0$ give the critical point $(\frac{1}{2}, 0)$. Here $z = \frac{1}{4} - \frac{1}{2} = -\frac{1}{4}$. We can verify it's a minimum: $A = 2$, $B = 0$, $C = 4$, so $AC - B^2 = 8 > 0$ and $A > 0$.

On the boundary $x^2 + y^2 = 1$: substitute $y^2 = 1 - x^2$ to get $z = x^2 + 2(1 - x^2) - x = 2 - x - x^2$ for $-1 \le x \le 1$. Setting $dz/dx = -1 - 2x = 0$ gives $x = -\frac{1}{2}$, so $y = \pm\frac{\sqrt{3}}{2}$, and $z = 2 + \frac{1}{2} - \frac{1}{4} = \frac{9}{4}$. At the endpoints: $x = 1$ gives $z = 0$; $x = -1$ gives $z = 2$.

Comparing all values: absolute min $= -\frac{1}{4}$ at $(\frac{1}{2}, 0)$, absolute max $= \frac{9}{4}$ at $(-\frac{1}{2}, \pm\frac{\sqrt{3}}{2})$.

Common mistake: forgetting the boundary entirely. Students find the interior critical point, classify it as a minimum, and declare it the answer. But the absolute max here is on the boundary - you'll miss it if you only look inside.

The surface $z = x^2 + 2y^2 - x$ over the unit disk, with the interior minimum (blue) and boundary maximum (red) marked.

Worked Example: Bounded Domain

Let's put the full algorithm to work. Consider the inverted paraboloid $z = 4 - x^2 - y^2$ on the closed disk $x^2 + y^2 \le 4$.

Predict first. This is a downward-opening paraboloid with vertex at the origin. We expect the peak to be at $(0,0)$ (where $z = 4$), and as we move outward, $z$ decreases. On the boundary circle $x^2 + y^2 = 4$, we get $z = 4 - 4 = 0$. So we should find a maximum at the origin and a minimum of zero on the boundary. Let's verify with calculus.

Step 1: Interior critical points. Set both partial derivatives to zero:

$f_x = -2x = 0, \qquad f_y = -2y = 0$

The only critical point is $(0, 0)$, where $z = 4$.

Step 2: Classify the critical point. The second derivatives are $A = f_{xx} = -2$, $B = f_{xy} = 0$, $C = f_{yy} = -2$. So:

$AC - B^2 = (-2)(-2) - 0^2 = 4 > 0, \qquad A = -2 < 0$

This confirms a local maximum at $(0, 0)$.

Step 3: Check the boundary. On $x^2 + y^2 = 4$, we have $z = 4 - 4 = 0$ everywhere. The boundary contributes a constant value of 0.

Result: Absolute maximum $= 4$ at $(0, 0)$. Absolute minimum $= 0$ on the entire boundary circle.

Trap: On a bounded domain, you must check BOTH interior critical points AND the boundary. Forgetting the boundary misses half the answer. In this example it was obvious, but in harder problems the boundary extremum might be the global winner.

Worked Example: Unbounded Domain

What changes when there's no boundary at all? Consider $z = \dfrac{1}{1 + x^2 + y^2}$ on all of $\mathbb{R}^2$.

Predict first. This function is always positive (the denominator is always at least 1). At the origin, $z = 1$. As we move away from the origin, the denominator grows, so $z$ shrinks toward 0. We expect a maximum at the origin and no minimum - the function approaches 0 but never reaches it.

Step 1: Find critical points. Using the quotient rule:

$f_x = \dfrac{-2x}{(1 + x^2 + y^2)^2} = 0, \qquad f_y = \dfrac{-2y}{(1 + x^2 + y^2)^2} = 0$

Since the denominator is never zero, we need $x = 0$ and $y = 0$. The only critical point is $(0, 0)$, where $z = 1$.

Step 2: Classify. We need the second derivatives at the origin. At $(0, 0)$:

$A = f_{xx}(0,0) = -2, \qquad B = f_{xy}(0,0) = 0, \qquad C = f_{yy}(0,0) = -2$

$AC - B^2 = (-2)(-2) - 0 = 4 > 0, \qquad A = -2 < 0$

This is a local maximum.

Step 3: Behavior at infinity. As $(x, y) \to \infty$, $z \to 0^+$. But $z > 0$ everywhere - the value 0 is never actually achieved.

Result: Absolute maximum $= 1$ at $(0, 0)$. No absolute minimum - the infimum is 0, but it's never attained.

Trap: On an unbounded domain, there's no boundary to check. Instead, we must analyze behavior at infinity. A function can approach a value without reaching it - that value is an infimum, not a minimum. The Extreme Value Theorem does not apply when the domain is unbounded.

Worked Example: When Interior Fails, Try Lagrange

Sometimes the interior has no critical points at all, and the extrema live entirely on the boundary. Consider $z = x^2 + 2y$ on $x^2 + y^2 \le 4$.

Step 1: Look for interior critical points. Set the partial derivatives to zero:

$f_x = 2x = 0, \qquad f_y = 2 = 0$

The first equation gives $x = 0$, but the second equation $2 = 0$ is never satisfied. There are no interior critical points. The function $z = x^2 + 2y$ has no place in the interior where the slope vanishes in all directions - the $y$-direction always slopes upward. So the extrema must occur on the boundary.

Step 2: Optimize on the boundary using Lagrange multipliers. On the circle $g(x,y) = x^2 + y^2 - 4 = 0$, we set $\nabla f = \lambda \nabla g$:

$2x = \lambda \cdot 2x, \qquad 2 = \lambda \cdot 2y$

From the first equation: $2x(1 - \lambda) = 0$, so either $x = 0$ or $\lambda = 1$.

Case 1: $\lambda = 1$. The second equation gives $2 = 2y$, so $y = 1$. From the constraint: $x^2 + 1 = 4$, so $x^2 = 3$, giving $x = \pm\sqrt{3}$. At these points, $z = 3 + 2(1) = 5$.

Case 2: $x = 0$. From the constraint: $y^2 = 4$, so $y = \pm 2$. We get $z = 0 + 2(2) = 4$ at $(0, 2)$ and $z = 0 + 2(-2) = -4$ at $(0, -2)$.

Step 3: Compare all boundary values.

$z(\pm\sqrt{3}, 1) = 5, \qquad z(0, 2) = 4, \qquad z(0, -2) = -4$

Result: Absolute maximum $= 5$ at $(\pm\sqrt{3}, 1)$. Absolute minimum $= -4$ at $(0, -2)$.

Contour plot of $z = x^2 + 2y$ with the constraint circle $x^2 + y^2 = 4$. The red dots mark the maxima at $(\pm\sqrt{3}, 1)$ and the blue dot marks the minimum at $(0, -2)$.

Practice Problems - §2.19

From Kaplan, problems after §2.21

4(b) Find and classify the critical points of $z = 1 + x^2 + y^2$

Find the critical points of $z = 1 + x^2 + y^2$ and test for maxima and minima.

Step 1: Find the critical points.

$$f_x = 2x = 0, \qquad f_y = 2y = 0$$

The only critical point is $(0, 0)$ with $z = 1$.

Step 2: Apply the second derivative test.

$f_{xx} = 2$, $f_{xy} = 0$, $f_{yy} = 2$. So $A = 2$, $B = 0$, $C = 2$.

$AC - B^2 = 4 > 0$ and $A = 2 > 0$.

Local minimum at $(0,0)$ with $z = 1$.

Geometrically, this is a circular paraboloid opening upward with vertex at $(0,0,1)$. The level curves $x^2 + y^2 = c - 1$ are circles - the perfect symmetry makes $B = 0$.

4(d) Find and classify the critical points of $z = x^2 - 5xy - y^2$

Find the critical points of $z = x^2 - 5xy - y^2$ and test for maxima and minima.

Step 1: Find the critical points.

$$f_x = 2x - 5y = 0, \qquad f_y = -5x - 2y = 0$$

From the first equation: $x = 5y/2$. Substitute into the second: $-25y/2 - 2y = -29y/2 = 0$, so $y = 0$ and $x = 0$.

Critical point: $(0,0)$ with $z = 0$.

Step 2: Apply the second derivative test.

$f_{xx} = 2$, $f_{xy} = -5$, $f_{yy} = -2$. So $A = 2$, $B = -5$, $C = -2$.

$AC - B^2 = (2)(-2) - (-5)^2 = -4 - 25 = -29 \lt 0$.

Since $AC - B^2 \lt 0$: saddle point at $(0,0)$.

The large $|B|$ relative to $|A|$ and $|C|$ means the cross-term $-5xy$ dominates - the surface twists strongly between the $x$ and $y$ directions.

5(b) Find and classify the critical points of $z = x^4 - y^4$

Find the critical points of $z = x^4 - y^4$, classify them, and describe the level curves.

Step 1: Find the critical points.

$$f_x = 4x^3 = 0 \implies x = 0, \qquad f_y = -4y^3 = 0 \implies y = 0$$

Only critical point: $(0,0)$ with $z = 0$.

Step 2: The second derivative test is inconclusive.

$f_{xx} = 12x^2$, $f_{yy} = -12y^2$, $f_{xy} = 0$. At $(0,0)$: $A = 0$, $B = 0$, $C = 0$.

$AC - B^2 = 0$ - the test tells us nothing. We need to look more carefully.

Step 3: Direct analysis near $(0,0)$.

Along the $x$-axis ($y = 0$): $z = x^4 > 0$ for $x \ne 0$.

Along the $y$-axis ($x = 0$): $z = -y^4 \lt 0$ for $y \ne 0$.

Since $z$ takes both positive and negative values near $(0,0)$: saddle point.

The level curves $x^4 - y^4 = c$ factor as $(x^2 - y^2)(x^2 + y^2) = c$. Near the origin, these resemble the hyperbolas of $x^2 - y^2 = c$ but with a "flatter" saddle - the fourth-power behavior makes the surface much flatter near the origin than a typical $x^2 - y^2$ saddle.

5(e) Find and classify the critical points of $z = x^2 - xy + y^2$

Find the critical points of $z = x^2 - xy + y^2$, classify them, and describe the level curves.

Step 1: Find the critical points.

$$f_x = 2x - y = 0, \qquad f_y = -x + 2y = 0$$

From the first: $y = 2x$. Substitute into the second: $-x + 4x = 3x = 0$, so $x = 0$, $y = 0$.

Critical point: $(0,0)$ with $z = 0$.

Step 2: Second derivative test.

$f_{xx} = 2$, $f_{xy} = \frac{\partial}{\partial y}(2x - y) = -1$, $f_{yy} = 2$.

So $A = 2$, $B = -1$, $C = 2$.

$AC - B^2 = 4 - 1 = 3 > 0$ and $A = 2 > 0$.

Local minimum at $(0,0)$ with $z = 0$.

The level curves $x^2 - xy + y^2 = c$ are ellipses tilted at $45°$. Because $B \ne 0$ (the cross-term $-xy$), the principal axes of the ellipses don't align with the coordinate axes.