Functions of Several Variables

Landscapes z = f(x, y) and their contour maps, level surfaces in space, and limits that depend on how you approach

Functions of Several Variables

A function of two variables is a landscape: over each point (x, y) of the floor stands a height z = f(x, y). You can look at it from the side as a surface, or from above as a map of contour lines, as hikers do. Add a third variable and the contours become surfaces in space, and even the idea of a limit gets more interesting, because there are infinitely many directions to come from.

Surfaces and Contour Maps

Type a function or pick one. Slide the cutting plane to see where it meets the surface, and move over the map to walk a marker across the landscape.

(0.60, 0.30)
marker (x, y)
1.640
height f(x, y) at the marker
0.891
cutting level c
The plane z = 0.89 meets the surface along the yellow curve; seen from above, that curve is the level curve f(x, y) = 0.89 on the map. The marker is above the plane. Where contour lines crowd together the ground is steep; where they spread out it is nearly flat.

Drag the surface to turn it. Both pictures use the same 14 equally spaced levels and the same colours, from deep indigo (low) to cream (high). The vertical scale of the surface is stretched to fit the scene, and the extreme 1% of heights is clipped so that poles do not swamp the picture; the readouts are true values.

Go deeper:Graphs, Level Curves and Maps

The graph of f(x, y) is the surface {(x, y, z) : z = f(x, y)} in space. Its level curves are the sets f(x, y) = c in the plane: slice the graph with the horizontal plane z = c and look down. A contour map draws level curves for equally spaced values of c, so the spacing between them measures steepness: crowded lines mean the height changes quickly with distance, wide gaps mean gentle ground.

Contours read the shape of a landscape. Around a peak or a pit they close up into nested loops. At a saddle such as x² − y² the level curve through the saddle point is a pair of crossing lines and the others are hyperbolas, rising on two sides and falling on the other two. The monkey saddle x³ − 3xy² has three valleys and three ridges meeting at the origin, room for a monkey’s tail.

Lines of equal depth appeared on Dutch charts of rivers and harbours long before anyone drew lines of equal height on land. One of the first to do that was the mathematician Charles Hutton, in the 1770s, while working up survey data from the Scottish mountain Schiehallion for the experiment that measured the density of the Earth.

Level Surfaces

For a function of three variables the level sets f(x, y, z) = c are surfaces. Slide c through the special values and watch the shape change, not just its size.

1.00
level c
53,144
triangles (marching tetrahedra)
49.93
surface area inside the box
c > 0: a hyperboloid of one sheet, a single connected tube with a waist of radius √c = 1.00. Lower c and the waist pinches.

f(x, y, z) = x² + y² − z²

Blue faces look towards larger f (the direction of the gradient), amber faces towards smaller f. The function is sampled once on a 49³ grid; each slider move re-runs marching tetrahedra on those samples, so the surface is exact at the grid’s edges and linear in between. The slice cuts away everything above z = s and draws the level curve f(x, y, s) = c in yellow.

Go deeper:When the Shape Changes

A function of three variables cannot be graphed (that would take four dimensions), but its level sets can be drawn. Temperature in a room has isothermal surfaces; the potential of a point charge has concentric spheres. For most c the level set f = c is a smooth surface, and as c changes it deforms gently.

The exceptions happen at critical values, levels that contain a point where the gradient of f is zero. For x² + y² − z² the only critical point is the origin, where f = 0: just above 0 the level set is a connected hyperboloid of one sheet, at 0 a double cone, and just below 0 two separate sheets. For the torus function the change comes at c = 4, when the tube reaches the z-axis, where the function is not smooth (√(x² + y²) has a corner there), and the hole closes. Morse theory, developed by Marston Morse in the 1920s and 1930s, makes this precise: the topology of the level sets can only change by passing a critical value.

The surfaces here are found by marching tetrahedra. Sample f on a grid, split each cube of the grid into six tetrahedra, and wherever f − c changes sign along an edge, put a vertex at the linearly interpolated crossing. Each tetrahedron contributes nothing, a triangle or a quadrilateral. The related marching cubes algorithm, published by William Lorensen and Harvey Cline in 1987, made this the standard way to turn CT and MRI scans into 3D surfaces.

Limits That Depend on the Path

A bead slides toward the origin and reports the heights it sees. Drag the start of the path, switch to a parabola or a spiral, and compare what different paths find.

1.000
bead’s distance to the origin
0.000
height f at the bead
line at 45°
current path
Watch the bead arrive. Each path’s final height is recorded here and marked on the z-axis; then try another path.

f(x, y) = xy / (x² + y²), undefined at the origin. On the map, blue means f > 0 and red means f < 0. The bead’s distance shrinks geometrically, to 0.2% of where it started. The polar panel shows f around circles of shrinking radius: if the limit were L, these curves would flatten onto the line at height L. For xy/(x² + y²) they do not change at all, sin 2θ / 2 at every radius; for 2x²y/(x⁴ + y²) the spikes narrow but keep their height 1.

Go deeper:Infinitely Many Directions

The limit of f(x, y) as (x, y) → (a, b) is L if f(x, y) is as close to L as you like whenever (x, y) is close enough to (a, b), however it gets there. In one variable there are only two directions, left and right. In the plane there are infinitely many, and also curved paths, spirals, and paths that zigzag.

That gives a practical test for non-existence. If two paths give different limits, the limit does not exist. For f = xy/(x² + y²) along the line y = mx, f = m/(1 + m²), so the x-axis gives 0 and the line y = x gives ½. The function 2x²y/(x⁴ + y²) is subtler: along every straight line through the origin f → 0, yet along the parabola y = x² it equals 1 everywhere. Checking all lines is not enough.

Agreement along paths never proves a limit exists; a proof needs a bound that works for every approach at once. Polar coordinates often supply one. For x²y/(x² + y²), write x = r cos θ, y = r sin θ to get r cos²θ sin θ, which is at most r in size whatever θ is, so the limit is 0. For xy/(x² + y²) the same substitution gives ½ sin 2θ, with no r left at all: the value depends only on the direction, which is exactly why the limit fails.

Key Takeaways

  • The graph z = f(x, y) and its contour map show the same function from the side and from above.
  • Crowded contour lines mean steep ground; loops mark peaks and pits, crossings mark saddles.
  • Level surfaces f(x, y, z) = c can change shape only at critical values, as the hyperboloids do at c = 0.
  • If two paths to a point give different limits, the limit does not exist.

Spot a mistake or have an idea?

Search