Tutorials › Calculus III › Horizontal Slices and Level Curves

Graphs, Traces, and Level Sets · Tutorial 254 of 999

Horizontal Slices and Level Curves

See why a horizontal slice at height c corresponds exactly to the planar level set where the function has value c.

Beginner 9 min read

What You'll Learn

  • Write the graph of a function as a set of points in three-dimensional space.
  • Describe a horizontal plane using the equation z = c.
  • Identify the intersection as the points whose function values equal c.
  • Interpret the planar equation f(x,y) = c as a level set.
  • Recognize that a level set may be empty or may consist of more than one curve.
  • Check points on a proposed level set by evaluating the function.

Horizontal Slices of a Surface

A graph \(z=f(x,y)\) is a surface in three-dimensional space. One way to understand its shape is to intersect it with a horizontal plane. “Horizontal” means that the height coordinate \(z\) is fixed while \(x\) and \(y\) are allowed to vary.

Choose a height \(c\). The plane at that height has equation \(z=c\). Where this plane meets the surface, the surface’s height must be \(c\). Since the surface is defined by \(z=f(x,y)\), its intersection points must satisfy \(f(x,y)=c\).

This gives two related objects: a three-dimensional intersection lying in the plane \(z=c\), and a planar set of \((x,y)\)-coordinates satisfying \(f(x,y)=c\). The planar set is called the level set of \(f\) at height \(c\). Thinking of it as a horizontal slice connects the equation to the geometry of the surface.

Definitions: Graph, Horizontal Plane, and Level Set

Let \(f:D\to\mathbb{R}\) be a function, where \(D\) is a subset of the \(xy\)-plane. Its graph consists of all points whose first two coordinates belong to \(D\) and whose third coordinate is the function value.

$$ \operatorname{Graph}(f) = \{(x,y,z)\in\mathbb{R}^3:(x,y)\in D,\ z=f(x,y)\}. $$

For a real number \(c\), the horizontal plane at height \(c\) is the set of points with third coordinate equal to \(c\). Its intersection with the graph is called the horizontal trace of the graph at height \(c\). The corresponding level set records the first two coordinates of that trace.

Definition: For \(f:D\to\mathbb{R}\) and \(c\in\mathbb{R}\), the level set of \(f\) at height \(c\) is $$ L_c=\{(x,y)\in D:f(x,y)=c\}. $$ The horizontal trace is $$ \operatorname{Graph}(f)\cap\{(x,y,z)\in\mathbb{R}^3:z=c\}. $$

The level set is drawn in the \(xy\)-plane, while the horizontal trace lies in three-dimensional space at height \(c\). They contain the same horizontal positions, but they are not literally the same set of points: each point \((x,y)\) in the level set corresponds to the point \((x,y,c)\) in the trace.

Why the Intersection Gives the Level Set

The relationship follows directly from the definitions. A point on the graph has the form \((x,y,f(x,y))\). It lies in the plane \(z=c\) precisely when its third coordinate equals \(c\), or \(f(x,y)=c\). Conversely, if \((x,y)\) belongs to \(D\) and satisfies \(f(x,y)=c\), then the graph contains \((x,y,c)\), which also lies in the plane \(z=c\).

Theorem: For \(f:D\to\mathbb{R}\) and \(c\in\mathbb{R}\), $$ \operatorname{Graph}(f)\cap\{(x,y,z):z=c\} = \{(x,y,c):(x,y)\in D,\ f(x,y)=c\}. $$ Thus, deleting the fixed third coordinate \(c\) from each intersection point gives exactly the level set \(L_c\).

In particular, the horizontal trace is empty if and only if there are no points in the domain where \(f\) takes the value \(c\). This happens when \(c\) is outside the range of \(f\). When the level set is nonempty, its shape can vary: it may be a circle, a line, several branches, or another planar set. The name “level set” remains accurate even when the set is not a single curve.

1
Choose a height.
Fix a real number \(c\), which specifies the horizontal plane \(z=c\).
2
Use the graph equation.
On the graph, \(z=f(x,y)\), so being at height \(c\) requires \(f(x,y)=c\).
3
Interpret the planar set.
The solutions \((x,y)\) in the domain form \(L_c\); the corresponding three-dimensional points are \((x,y,c)\).

Worked Examples

Worked Example: A Circular Horizontal Trace

Let \(f(x,y)=x^2+y^2\), with domain \(D=\mathbb{R}^2\), and take the horizontal plane \(z=4\). The graph is \(z=x^2+y^2\). At an intersection with \(z=4\), both expressions for \(z\) must agree:

$$ x^2+y^2=4. $$

This equation describes a circle of radius \(2\), centered at the origin in the \(xy\)-plane. Its points lift to the horizontal trace by adding height coordinate \(4\). For example, \((2,0)\) is on the level set because \(2^2+0^2=4\), and its point on the surface is \((2,0,4)\). The function value there is \(f(2,0)=4+0=4\), so it lies in the plane \(z=4\). Similarly, \((0,2)\), \((-2,0)\), and \((0,-2)\) each have function value \(4\), and their corresponding surface points all have third coordinate \(4\).

Conversely, any point on this surface and in the plane must satisfy \(z=4\) and \(z=x^2+y^2\), so \(x^2+y^2=4\). Thus the circle gives all, not merely some, of the horizontal trace’s \(xy\)-positions.

Worked Example: A Straight-Line Level Set

Consider \(f(x,y)=2x-y\) on \(\mathbb{R}^2\), and slice its graph with the plane \(z=3\). At an intersection, \(z=2x-y\) and \(z=3\), so the level-set equation is

$$ 2x-y=3. $$

For instance, when \(x=0\), the equation gives \(-y=3\), hence \(y=-3\). Evaluating the function confirms \(f(0,-3)=2(0)-(-3)=3\), so \((0,-3,3)\) is on both the graph and the plane. When \(x=2\), the equation gives \(4-y=3\), hence \(y=1\). Indeed, \(f(2,1)=2(2)-1=3\), and \((2,1,3)\) also lies on both.

The planar set is the line \(y=2x-3\). Every point on this line satisfies \(2x-y=3\), so its graph point has height \(3\). Conversely, every point of the graph at height \(3\) must satisfy this same line equation. The horizontal trace is therefore the lifted line \(\{(x,y,3):y=2x-3\}\).

Worked Example: A Height with No Intersection

Again let \(f(x,y)=x^2+y^2\), but now choose the plane \(z=-1\). A point in the intersection would need to satisfy

$$ x^2+y^2=-1. $$

For real \(x\) and \(y\), each square is nonnegative, so \(x^2+y^2\geq 0\). It cannot equal \(-1\). Therefore the level set is empty, and the plane \(z=-1\) does not meet the graph.

This conclusion also agrees with the surface’s heights: \(f(x,y)=x^2+y^2\geq 0\) everywhere on its domain. A horizontal plane below height \(0\) has no point in common with this graph.

Worked Example: A Level Set with Two Branches

Let \(f(x,y)=x^2-y^2\) and choose \(c=0\). The level-set equation is

$$ x^2-y^2=0 \qquad\Longleftrightarrow\qquad (x-y)(x+y)=0. $$

A product is zero when at least one factor is zero, so the level set consists of the two lines \(y=x\) and \(y=-x\). To check points on the first line, take any real \(t\): \(f(t,t)=t^2-t^2=0\). On the second line, \(f(t,-t)=t^2-(-t)^2=t^2-t^2=0\). Thus each corresponding point \((t,t,0)\) or \((t,-t,0)\) lies on both the graph and the plane \(z=0\).

There are two crossing branches, rather than one isolated curve. This example illustrates why “level set” is the general term: it describes all points at a specified function value without assuming the set has one particular shape.

A Common Mistake: Confusing Horizontal and Vertical Slices

A horizontal slice fixes \(z\), not \(x\) or \(y\). For example, with \(z=x^2+y^2\), the incorrect calculation “set \(x=4\), so the slice at height \(4\) is \(x=4\)” confuses a vertical restriction with a horizontal one. Fixing \(x=4\) would constrain the surface to a vertical plane and would give \(z=16+y^2\), not a trace at a single height.

For a horizontal slice at height \(4\), set \(z=4\) and equate it to the graph formula: \(4=x^2+y^2\). The resulting circle is the set of horizontal positions where the surface has height \(4\). The correction is to fix the third coordinate, then use \(z=f(x,y)\) to find which \((x,y)\) positions have that height.

How to Read the Geometry

A level set answers a specific geometric question: at which points in the domain does the surface have height \(c\)? It does not by itself display the height coordinate, because every point in the level set is understood to be lifted to the plane \(z=c\) when describing the actual intersection.

The height \(c\) matters. Changing \(c\) changes the plane and may change the level set’s shape or whether it exists at all. Even for a fixed function, one height might give an empty set, another might give a single point or a curve, and another might produce several branches. The equation \(f(x,y)=c\) captures the precise condition in each case.

When examining a proposed level set, two checks are useful. First, every listed point should belong to the domain and satisfy \(f(x,y)=c\). Second, the description should account for every point in the domain satisfying that equation. The first check rules out extraneous points; the second ensures the trace has not been only partly described.

Key takeaway: Intersecting \(z=f(x,y)\) with the horizontal plane \(z=c\) means requiring \(f(x,y)=c\). The solutions in the \(xy\)-plane form the level set, and each solution \((x,y)\) corresponds to the intersection point \((x,y,c)\).

Check Your Understanding

Use the relationship between a horizontal plane and a level set to answer these questions.

  1. For a graph \(z=f(x,y)\), what equation specifies the horizontal plane at height \(c\)?
  2. Why must the \(xy\)-coordinates of an intersection point satisfy \(f(x,y)=c\)?
  3. For \(f(x,y)=x^2+y^2\), does the graph meet the plane \(z=9\)? State the planar level-set equation.
  4. Can a level set be empty? Explain what that means for the horizontal plane and graph.
  5. For \(f(x,y)=x^2-y^2\), what points belong to the level set at height \(0\)?