Watch on Instagram

Math Bytes · Multivariable calculus · Episode 5 · Applications of multivariable derivatives

Finding peaks and valleys in 3D

At a peak or a valley of a surface z = f(x, y), the slope is zero in both the x and y directions, so both partial derivatives are zero; that spot is a critical point. For f = x² + y² − 4x − 2y the critical point is (2, 1), the bottom of a bowl, while x² − y² is flat at (0, 0) and is a saddle point.

Posted · About a 1 minute watch, 3 minute read · Take the quiz

Flat both ways

Picture the graph z = f(x, y) as a landscape. At the very top of a hill, or the very bottom of a valley, the ground is level: walk a tiny step in the x direction or in the y direction, and you neither climb nor drop at first.

The slopes in those two directions are the partial derivatives from lesson 3. So at a peak or a valley (of a smooth surface):

  • ∂f/∂x = 0 (flat in the x direction)
  • ∂f/∂y = 0 (flat in the y direction)

A point where both are zero is a critical point. (Points where a partial doesn't exist count as critical points too, but this lesson sticks to smooth surfaces.)

Worked example: x² + y² − 4x − 2y

Take f(x, y) = x² + y² − 4x − 2y.

  1. Partial with respect to x: hold y still, so y² and −2y are constants (their derivative is 0). The power rule on x² gives 2x, and −4x gives −4: ∂f/∂x = 2x − 4.
  2. Partial with respect to y: hold x still: ∂f/∂y = 2y − 2.
  3. Set both to zero: 2x − 4 = 0 gives 2x = 4, so x = 2. 2y − 2 = 0 gives 2y = 2, so y = 1.

The critical point is (2, 1).

Is it a peak or a valley? This surface is a bowl: completing the square, f = (x − 2)² + (y − 1)² − 5, so it can never go below −5, and it reaches −5 exactly at (2, 1). That's the bottom of the bowl, a minimum (a valley). Check: f(2, 1) = 4 + 1 − 8 − 2 = −5.

Careful: saddle points

Flat doesn't always mean a peak or a valley. Take g(x, y) = x² − y²:

  • ∂g/∂x = 2x and ∂g/∂y = −2y, which are both zero only at (0, 0).
  • Along the x-axis the surface is x², curving up. Along the y-axis it is −y², curving down.

So (0, 0) is a critical point that is neither a max nor a min: it's a saddle point, up one way and down the other, like the middle of a horse saddle or a mountain pass.

Try it yourself

  1. Find the critical point of h(x, y) = x² + y² − 8x − 4y.
  2. Find the critical point of k(x, y) = x² + y² + 2x.

(Answers: 1. 2x − 8 = 0 and 2y − 4 = 0 give (4, 2), the bottom of a bowl. 2. 2x + 2 = 0 and 2y = 0 give (−1, 0), also a minimum.)

Good to know

  • A critical point is a candidate: it can be a local max, a local min, or a saddle point.
  • The second derivative test sorts them using D = f_xx · f_yy − (f_xy)²; the video leaves it out and uses "this is a bowl" instead.
  • "Peaks and valleys in 3D" means on the graph surface of a function of two variables, z = f(x, y).
  • The 3D pictures in the video are flat sketches with simple perspective, and the level bubble is just a memory aid for "flat".

Answer to the comment question

f(x, y) = x² + y² − 6x + 2y. Where's the critical point? (3, −1). The partials are ∂f/∂x = 2x − 6 and ∂f/∂y = 2y + 2. Setting 2x − 6 = 0 gives x = 3, and 2y + 2 = 0 gives y = −1. Like the example, the surface is a bowl, f = (x − 3)² + (y + 1)² − 10, so (3, −1) is its lowest point, a minimum.

Test your knowledge

Quick quiz: Finding peaks and valleys in 3D

4 multiple-choice questions. Pick one answer for each, then check how you did.

1At a peak or valley of a smooth surface z = f(x, y), what is true?
2For f = x² + y² − 4x − 2y, what are the partial derivatives?
3Where is the critical point of f = x² + y² − 4x − 2y?
4What kind of critical point does x² − y² have at (0, 0)?

Sources

Video transcript

Where is the ground flat in every direction?

At a hilltop or a valley floor, the slope is zero in both the x and y directions. So set both partials to zero. That spot is a critical point.

Take f equals x squared plus y squared, minus four x, minus two y. The partials are two x minus four, and two y minus two.

Both are zero at two, one. This is a bowl, so that's its lowest spot: a valley.

But careful: x squared minus y squared is flat at zero, zero, and it's a saddle, up one way and down the other.

Your turn. f equals x squared plus y squared, minus six x, plus two y. Where's the critical point? Comment your answer below!

That's your byte.

More from Multivariable calculus

All Multivariable calculus lessons