Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 39 · Getting Started

Level Curves and Level Surfaces

Read contour maps, draw level curves of f(x, y) and understand level surfaces of f(x, y, z), with worked examples and runnable contour plots.

Hikers read hills from a map with contour lines. Each line joins points of equal altitude. Mathematicians do exactly the same with any function of two variables, and the lines are called level curves. This idea shrinks a three-dimensional surface to a flat picture, and it will return when we study the gradient and optimization.

Level curves

A level curve of f(x, y) at level c is the set of points where f(x, y) = c. Equivalently, it is the shadow on the xy-plane of the intersection of the surface with the horizontal plane z = c.

Worked example 1: f(x, y) = x² + y². For c > 0 the level curve x² + y² = c is a circle of radius √c. For c = 0 it is the single point (0, 0). For c < 0 there is no curve. The contour map is a set of concentric circles: close together far from the origin (steep) and spaced out near it.

Worked example 2: f(x, y) = x² - y². For c = 0 we get x² = y², so two crossing lines y = x and y = -x. For c > 0 the curves are hyperbolas opening left and right; for c < 0, opening up and down. This pattern is the signature of a saddle.

Worked example 3: f(x, y) = 2x + 3y. The level curves 2x + 3y = c are parallel straight lines. Equally spaced parallel lines mean a plane.

Python Contour maps of a bowl and a saddle

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Reading a contour map

  • Lines close together mean a steep slope; lines far apart mean a gentle one.
  • Closed loops around a point often mark a peak or a pit.
  • Crossing contour lines of different levels cannot happen for a function, since a point has only one height.
  • Levels are usually chosen at equally spaced values, such as 0, 1, 2, 3.

Slice the surface

Cut at z = c A horizontal plane
Keep the curve Where f(x, y) = c
1 / 2

Level curves from data

If you only have a formula for the level, you can plot a level curve implicitly. For example the curve x³ + y³ = 3xy (the folium of Descartes) is the level curve f(x, y) = 0 of f = x³ + y³ - 3xy. We ask the contour routine to draw only the level 0.

Python An implicit curve as a level curve

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Level surfaces

For a function of three variables, f(x, y, z) = c is normally a surface, called a level surface.

  • f = x² + y² + z²: level surfaces are spheres of radius √c.
  • f = x² + y²: level surfaces are cylinders around the z axis (no dependence on z).
  • f = x + 2y + 3z: level surfaces are parallel planes.
  • f = z - x² - y²: the level surface f = 0 is the paraboloid z = x² + y². In general, the graph of z = g(x, y) is a level surface of F(x, y, z) = z - g(x, y). This trick lets us treat every graph as a level surface.

You can test which level surface a point lies on by simply evaluating f.

Python Which level surface contains each point?

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. What do the level curves of f(x, y) = x² + y² look like for positive levels?

    x² + y² = c with c > 0 is a circle of radius √c centered at the origin.
  2. 2. The level curve f = 0 of f(x, y) = x² - y² is

    x² - y² = 0 means x² = y², so y = x or y = -x.
  3. 3. On a contour map, closely spaced lines indicate

    The height changes by the same amount over a short distance, so the slope is steep.
  4. 4. The level surfaces of f(x, y, z) = x² + y² + z² for c > 0 are

    x² + y² + z² = c is a sphere of radius √c.

Summary

  • A level curve of f(x, y) is the set where f(x, y) = c; a contour map shows several of them.
  • Closely spaced curves mean steepness; closed loops mark peaks or pits.
  • A function of three variables has level surfaces f(x, y, z) = c.
  • Every graph z = g(x, y) is the level surface z - g(x, y) = 0.

Next: Limits and Continuity in Several Variables