We can generalise the idea of contour lines to higher dimensions, and consider what we call level sets. If \(f\) is a function defined on a set \(D\subset\mathbb R^N\) with values in \(\mathbb R\) we call the set
a level set (to the level \(c\)). If \(N=2\) then \(f^{-1}[c]\) are the contour lines from Section 2.2. For \(N=3\) we can still visualise the level sets. In general they are surfaces in \(\mathbb R^3\text{,}\) and often called level surfaces.
Example2.8.
As a first example look at the function \(f(x,y,z)=x^2/4+y^2/9+z^2\) defined on \(\mathbb R^3\text{.}\) To find the level surface, say to the level \(c=1\text{,}\) we can look at cross-sections along some coordinate plains. Let us take the plane \(z=0\text{.}\) Then \(f(x,y,0)=x^2/4+y^2/9=1\text{,}\) which is the equation of an ellipse with axis of length \(2\) and \(3\text{.}\) Similarly we consider \(y=0\text{,}\) which leads to the ellipse \(f(x,0,z)=x^2/4+z^2=1\) with axis \(2\) and \(1\text{.}\) Doing the same on the third coordinate plane, \(x=0\text{,}\) we get the ellipse \(f(x,y,z)=y^2/9+z^2\) with axis \(3\) and \(1\text{.}\) The resulting surface is the ellipsoid shown in Figure 2.9.
Example2.10.
We next consider some level sets of \(f(x,y,z)=x^2+y^2-z^2\text{.}\) Observe that the function is rotationally symmetric about the \(z\)-axis. Hence the level surfaces \(f^{-1}[c]\) can be obtained by revolving the curve \(f(x,0,z)=c\) about the \(z\)-axis.
We determine the surfaces for the levels \(c=0,\pm 1\text{.}\) If \(c=0\) then \(f(x,0,z)=0=x^2-z^2\) is given by \(z=\pm x\text{.}\) Hence \(f^{-1}[0]\) is a double cone centred about the \(z\)-axis as shown in Figure 2.11. For \(c=1\) we have \(f(x,0,z)=1=x^2-z^2\text{,}\) implying that \(x=\pm\sqrt{1+z^2}\text{.}\) Revolving about the about the \(z\)-axis we get the corresponding surface in Figure 2.12. Proceeding similarly for \(c=-1\) we get \(f(x,0,z)=-1=x^2-z^2\text{,}\) or \(z=\pm\sqrt{1+x^2}\text{.}\) These are the same hyperbolas as before but turned by \(90^\circ\text{.}\) As a result the corresponding level surface of \(f\) shown in Figure 2.13 consists of two shells.