Skip to main content

Section 2.1 Graphs and Level Sets

A scalar-valued function of several variables assigns one number to each point in its domain. We can visualize this number as a height or examine the points where it has a fixed value. These viewpoints lead to graphs and level sets.

Subsection 2.1.1 Graphs and Contours

Definition 2.1.1. Graph of a Function.

Let \(A\subseteq \R^n\) and \(f\colon A\to \R\text{.}\) The graph of \(f\) is
\begin{equation*} \operatorname{graph}(f) :=\{\langle x_1,\ldots,x_n,t\rangle\in A\times\R: t=f(\langle x_1,\ldots,x_n\rangle)\}. \end{equation*}
Thus \(\operatorname{graph}(f)\) is a subset of \(\R^{n+1}\text{.}\) For \(n=1\text{,}\) it is the familiar curve \(y=f(x)\text{.}\) For \(n=2\text{,}\) it is the surface \(z=f(x,y)\) in \(\R^3\text{.}\)
When \(n\ge 3\text{,}\) the graph lies in at least four dimensions and cannot be drawn directly in three-dimensional space. Level sets give a useful lower-dimensional picture that works in any dimension.

Definition 2.1.2. Level Set.

Let \(f\colon A\to \R\) and let \(c\in\R\text{.}\) The level set of \(f\) at level \(c\) is
\begin{equation*} \mathcal L_c(f) :=\{\vx\in A:f(\vx)=c\}=f^{-1}(\{c\}). \end{equation*}
For a function on \(\R^2\text{,}\) a level set is also called a level curve or contour line. A collection of labeled contour lines is a contour map. For a function on \(\R^3\text{,}\) a level set is often called a level surface.
If \(f\colon A\subseteq\R^2\to\R\text{,}\) then the horizontal plane \(z=c\) intersects the graph \(z=f(x,y)\) above the contour \(f(x,y)=c\text{.}\) Projecting this intersection onto the \(xy\)-plane produces the contour line. Closely spaced contours indicate that the height changes rapidly, as on a topographic map.

Example 2.1.3. A Paraboloid and Its Contours.

Describe the graph and all level sets of \(f(x,y)=x^2+y^2\text{.}\)
Solution.
The graph \(z=x^2+y^2\) is an upward-opening paraboloid. At level \(c\text{,}\) the equation is
\begin{equation*} x^2+y^2=c. \end{equation*}
The level set is empty when \(c\lt 0\text{,}\) is the single point \(\langle 0,0\rangle\) when \(c=0\text{,}\) and is a circle of radius \(\sqrt{c}\) when \(c\gt 0\text{.}\) The circular contours record the heights of horizontal slices through the paraboloid.
Upward paraboloid with three horizontal circular slices.
(a) Horizontal slices of the graph.
Concentric circular contours labeled one half, one, and two.
(b) The corresponding contour map.
Figure 2.1.4. The graph of \(f(x,y)=x^2+y^2\) and selected contour lines.

Example 2.1.5. Level Curves of a Saddle.

Describe the level curves of \(g(x,y)=x^2-y^2\text{.}\)
Solution.
The level equation is \(x^2-y^2=c\text{.}\) For \(c\gt 0\text{,}\) it is a hyperbola opening left and right. For \(c\lt 0\text{,}\) it is a hyperbola opening up and down. At \(c=0\text{,}\) it becomes the two lines \(y=x\) and \(y=-x\text{.}\) The change in the contours reflects the saddle shape of the graph.
Hyperbolic contours and the two diagonal lines at level zero.
Figure 2.1.6. Selected level curves of \(g(x,y)=x^2-y^2\text{.}\)

Subsection 2.1.2 Graphs as Zero Level Sets

A graph is itself a level set of a function with one additional input variable. Indeed, let \(f\colon A\subseteq\R^n\to\R\) and define \(F\colon A\times\R\to\R\) by
\begin{equation*} F(\vx,t)=f(\vx)-t. \end{equation*}
Then
\begin{equation*} \operatorname{graph}(f) =\{\langle\vx,t\rangle:F(\vx,t)=0\} =\mathcal L_0(F). \end{equation*}
Thus the graph of an \(n\)-variable function can be viewed as the level \(0\) set of a function of \(n+1\) variables.

Example 2.1.7.

Express the graph of \(f(x,y)=x^2+y^2\) as a zero level set.
Solution.
Define \(F\colon\R^3\to\R\) by
\begin{equation*} F(x,y,z)=x^2+y^2-z. \end{equation*}
Then \(F(x,y,z)=0\) exactly when \(z=x^2+y^2\text{.}\) Therefore \(\operatorname{graph}(f)=\mathcal L_0(F)\text{.}\)
The converse is not always true globally: a level set need not be the graph of a function in a chosen coordinate direction. For example, the level set \(x^2+y^2-1=0\) is the unit circle. It is not the graph of a single function \(y=f(x)\text{,}\) because most vertical lines meet it twice. It can, however, be split into the two graphs \(y=\sqrt{1-x^2}\) and \(y=-\sqrt{1-x^2}\text{.}\) This local graph viewpoint will return in the implicit function theorem.