Tutorials › Calculus III › Graphs as Sets in Three Dimensions

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

Graphs as Sets in Three Dimensions

Learn to describe function graphs as subsets of three-dimensional space and test whether a surface gives exactly one height for each point in its domain.

Beginner 9 min read

What You'll Learn

  • Define the graph of a function from a domain in the plane to real numbers.
  • Interpret graph points as input pairs together with their output height.
  • Use vertical lines parallel to the z-axis to test whether a surface is a function graph.
  • Distinguish a full sphere and a cylinder from graphs over the plane.
  • Identify when part of a surface, such as an upper hemisphere, is a graph.

From a Formula to a Set of Points

A formula such as \(z=f(x,y)\) can describe a height assigned to each input pair \((x,y)\). To view the function geometrically, we place each input pair in the \(xy\)-plane and use the function value as the third coordinate. The resulting collection of points forms a surface in three-dimensional space.

This viewpoint also gives a precise way to ask whether a surface represents a function of \(x\) and \(y\). At a given input pair, there must be exactly one output height. A vertical line, parallel to the \(z\)-axis, makes that requirement visible: it must meet the surface at most once.

Definition of a Graph

Definition: Let \(D\) be a subset of \(\mathbb{R}^2\), and let \(f:D\to\mathbb{R}\) be a function. The graph of \(f\) is the set
$$ \operatorname{graph}(f) = \{(x,y,f(x,y)):(x,y)\in D\} \subseteq \mathbb{R}^3. $$
Each point on the graph has its first two coordinates as an input and its third coordinate as the corresponding function value.

The domain \(D\) matters: the graph contains one point above every input pair in \(D\), and it contains no point above an input pair outside \(D\). In particular, if \((a,b)\in D\), the point above that input is \((a,b,f(a,b))\). If \((a,b)\notin D\), there is no graph point with first two coordinates \(a,b\).

The graph is not the formula by itself. It is the set of all triples that satisfy the formula while using an allowed input. For instance, describing a graph by the equation \(z=f(x,y)\) means that the surface consists of precisely the points \((x,y,z)\) for which \((x,y)\in D\) and \(z=f(x,y)\).

The Vertical-Line Test

For a fixed pair \((a,b)\), the vertical line through that input consists of all points whose first two coordinates are \(a\) and \(b\). Its equation can be written as \((x,y)=(a,b)\), with \(z\) free to vary. A graph can meet this line at most once because a function assigns no more than one output to an input.

Theorem: A set \(S\subseteq\mathbb{R}^3\) is the graph of a function \(f:D\to\mathbb{R}\) over some domain \(D\subseteq\mathbb{R}^2\) if and only if every vertical line parallel to the \(z\)-axis meets \(S\) in at most one point.

Here, “at most one” allows a vertical line not to meet the set at all. The domain is then the set of input pairs that do have a point above them. The condition does not require the surface to cover the entire \(xy\)-plane.

Why the Test Works

The key issue is whether the third coordinate is uniquely determined by the first two. The vertical-line condition is exactly that uniqueness requirement, stated in terms of points in space.

1
Assume the set is a graph.
For each input \((x,y)\) in its domain, the graph contains the point \((x,y,f(x,y))\). Since \(f\) has one value at that input, no second point with the same first two coordinates can belong to the graph.
2
Assume every vertical line meets the set at most once.
Let \(D\) be the set of pairs \((x,y)\) for which some point \((x,y,z)\) belongs to \(S\). For each \((x,y)\in D\), there is exactly one such \(z\), so define \(f(x,y)=z\). This defines a function \(f:D\to\mathbb{R}\).
3
Identify the set with that function's graph.
Every point in \(S\) has the form \((x,y,f(x,y))\) by the definition of \(f\). Conversely, for every \((x,y)\in D\), the unique point of \(S\) above it is \((x,y,f(x,y))\). Therefore \(S=\operatorname{graph}(f)\).

This proves both directions. The test is about uniqueness of height above each input, not about whether a surface has a particular shape or can be drawn without bending.

Worked Examples

Worked Example: A Paraboloid as a Function Graph

Consider the set \(S\) described by \(z=x^2+y^2\), with \(x,y\in\mathbb{R}\). For any chosen input pair \((a,b)\), the equation forces the height to be \(z=a^2+b^2\). Thus there is one height for every input. The function is \(f:\mathbb{R}^2\to\mathbb{R}\), where \(f(x,y)=x^2+y^2\), and its graph is

$$ S=\{(x,y,x^2+y^2):(x,y)\in\mathbb{R}^2\}. $$

For example, at \((a,b)=(1,-2)\), the height is \(1^2+(-2)^2=1+4=5\), so the graph point is \((1,-2,5)\). Substituting this point into the defining equation gives \(5=1^2+(-2)^2=5\), as required. The vertical line above \((1,-2)\) meets the surface once, at that point.

Worked Example: A Sphere Is Not a Single Function Graph

Consider the unit sphere \(x^2+y^2+z^2=1\). To test the vertical line above the input \((0,0)\), substitute \(x=0\) and \(y=0\):

$$ 0^2+0^2+z^2=1 \quad\Longrightarrow\quad z^2=1 \quad\Longrightarrow\quad z=1\ \text{or}\ z=-1. $$

The vertical line through \((0,0)\) therefore meets the sphere at \((0,0,1)\) and \((0,0,-1)\), two distinct points. The full sphere fails the vertical-line test and is not the graph of a single function \(z=f(x,y)\).

However, the upper half, defined by \(x^2+y^2+z^2=1\) and \(z\geq 0\), does pass the test. Solving for its nonnegative height gives \(z=\sqrt{1-x^2-y^2}\), for inputs satisfying \(x^2+y^2\leq 1\). At \((0,0)\), this gives \(z=\sqrt{1}=1\), and \(0^2+0^2+1^2=1\). The restriction to the upper half removes the second height and makes the set a graph over the closed unit disk.

Worked Example: A Cylinder Fails the Test

Consider the circular cylinder \(x^2+y^2=1\), where \(z\) can be any real number. The input pair \((1,0)\) satisfies \(1^2+0^2=1\). Above it, the cylinder contains \((1,0,0)\) and \((1,0,2)\), since both points have first two coordinates satisfying the cylinder equation. The vertical line through \((1,0)\) therefore meets the cylinder more than once.

In fact, it contains \((1,0,c)\) for every real number \(c\), because \(1^2+0^2=1\) does not restrict \(z\). For example, substituting \(c=0\) gives \(1=1\), and substituting \(c=2\) also gives \(1=1\). The cylinder is not the graph of a function \(z=f(x,y)\): at the input \((1,0)\), there is not one unique output height.

Worked Example: A Plane That Is a Function Graph

Consider the plane \(z=2x-y+1\). At the input \((a,b)=(2,1)\), the equation gives \(z=2(2)-1+1=4\). Hence \((2,1,4)\) belongs to the plane, and substituting verifies the equation: \(4=2(2)-1+1=4\).

For any input \((x,y)\in\mathbb{R}^2\), the equation determines exactly one height, \(2x-y+1\). Thus the plane is the graph of \(f:\mathbb{R}^2\to\mathbb{R}\) defined by \(f(x,y)=2x-y+1\). At \((0,0)\), the height is \(2(0)-0+1=1\); the point \((0,0,1)\) satisfies \(1=2(0)-0+1\), confirming the calculation.

Implicit Equations and a Common Pitfall

An equation involving \(x,y,z\) may describe a surface without making \(z\) a unique function of \(x,y\). The sphere and cylinder illustrate why it is not enough to see an equation and assume it defines a function graph. For each input pair, solve for the possible \(z\)-values or otherwise check how many points lie above that pair.

A common mistake is to solve an equation for \(z\) while silently discarding one of the possible values. For the unit sphere, the calculation \(z^2=1-x^2-y^2\) leads to \(z=\pm\sqrt{1-x^2-y^2}\), not just one value. At \((0,0)\), these are \(z=1\) and \(z=-1\), so the full sphere fails the test. Choosing only the positive square root is valid only after restricting to the upper half; it describes that portion, not the entire sphere.

Key takeaway: A set in three-dimensional space is a graph \(z=f(x,y)\) precisely when no vertical line parallel to the \(z\)-axis meets the set more than once. Its domain consists of exactly the input pairs for which the line meets the set.

Check Your Understanding

For each question, focus on how many heights are possible above a fixed input pair.

  1. State the set-builder definition of the graph of \(f:D\to\mathbb{R}\).
  2. Why does a vertical line meet the graph of a function at most once?
  3. Does the set \(z=3x+y\), with \(x,y\in\mathbb{R}\), pass the vertical-line test? Explain.
  4. At the input \((0,0)\), how many points of the unit sphere lie on the vertical line? What does this imply?
  5. What is the domain in the \(xy\)-plane for the upper half of the unit sphere viewed as a graph?