Learning Outcomes
- Sketch several traces or level curves of a function of two variables.
If hikers walk along rugged trails, they might use a topographical map that shows how steeply the trails change. A topographical map contains curved lines called contour lines. Each contour line corresponds to the points on the map that have equal elevation (Figure 1). A level curve of a function of two variables [latex]f\,(x,\ y)[/latex] is completely analogous to a counter line on a topographical map.
Figure 1. (a) A topographical map of Devil’s Tower, Wyoming. Lines that are close together indicate very steep terrain. (b) A perspective photo of Devil’s Tower shows just how steep its sides are. Notice the top of the tower has the same shape as the center of the topographical map.
Definition
Given a function [latex]f\,(x,\ y)[/latex] and a number [latex]c[/latex] in the range of [latex]f[/latex], a level curve of a function of two variables for the value [latex]c[/latex] is defined to be the set of points satisfying the equation [latex]f\,(x,\ y)=c[/latex].
Returning to the function [latex]g\,(x,\ y)=\sqrt{9-x^{2}-y^{2}}[/latex], we can determine the level curves of this function. The range of [latex]g[/latex] is the closed interval [latex][0,\ 3][/latex]. First, we choose any number in this closed interval—say, [latex]c=2[/latex]. The level curve corresponding to [latex]c=2[/latex] is described by the equation
[latex]\sqrt{9-x^{2}-y^{2}}=2[/latex].
To simplify, square both sides of this equation:
[latex]9-x^{2}-y^{2}=4[/latex].
Now, multiply both sides of the equation by [latex]-1[/latex] and add [latex]9[/latex] to each side:
[latex]x^{2}+y^{2}=5[/latex].
This equation describes a circle centered at the origin with radius [latex]\sqrt{5}[/latex]. Using values of [latex]c[/latex] between [latex]0[/latex] and [latex]3[/latex] yields other circles also centered at the origin. If [latex]c=3[/latex], then the circle has radius [latex]0[/latex], so it consists solely of the origin. Figure 2 is a graph of the level curves of this function corresponding to [latex]c=0,\ 1,\ 2[/latex], and [latex]3[/latex]. Note that in the previous derivation it may be possible that we introduced extra solutions by squaring both sides. This is not the case here because the range of the square root function is nonnegative.
Figure 2. Level curves of the function [latex]\small{g(x,y)=\sqrt{9-x^{2}-y^{2}}}[/latex], using [latex]\small{c=0,1,2}[/latex], and [latex]\small{3}[/latex] ([latex]\small{c=3}[/latex] corresponds to the origin).
A graph of the various level curves of a function is called a contour map.
Example: Making a Contour Map
Given the function [latex]f\,(x,\ y)=\sqrt{8+8x-4y-4x^{2}-y^{2}}[/latex], find the level curve corresponding to [latex]c=0[/latex]. Then create a contour map for this function. What are the domain and range of [latex]f[/latex]?
Show Solution
To find the level curve for [latex]c=0[/latex], we set [latex]f\,(x,\ y)=0[/latex] and solve. This gives
[latex]0=\sqrt{8+8x-4y-4x^{2}-y^{2}}[/latex].
We then square both sides and multiply both sides of the equation by [latex]-1[/latex]:
[latex]4x^{2}+y^{2}-8x+4y-8=0[/latex].
Now, we rearrange the terms, putting the [latex]x[/latex] terms together and the [latex]y[/latex] terms together, and add [latex]8[/latex] to each side:
[latex]4x^{2}-8x+y^{2}+4y=8[/latex].
Next, we group the pairs of terms containing the same variable in parentheses, and factor [latex]4[/latex] from the first pair:
[latex]4(x^{2}-2x)+(y^{2}+4y)=8[/latex].
Then we complete the square in each pair of parentheses and add the correct value to the right-hand side:
[latex]4(x^{2}-2x+1)+(y^{2}+4y+4)=8+4(1)+4[/latex].
Next, we factor the left-hand side and simplify the right-hand side:
[latex]4(x-1)^{2}+(y+2)^{2}=16[/latex].
Last, we divide both sides by [latex]16[/latex]:
[latex]\large{\frac{(x-1)^{2}}{4}+\frac{(y+2)^{2}}{16}=1}[/latex].
This equation describes an ellipse centered at [latex](1,\ -2)[/latex]. The graph of this ellipse appears in the following graph.
Figure 3. Level curve of the function [latex]\small{f(x,y)=\sqrt{8+8x-4y-4x^{2}-y^{2}}}[/latex] corresponding to [latex]\small{c=0}[/latex]
We can repeat the same derivation for values of [latex]c[/latex] less than [latex]4[/latex]. Then, the equation of an ellipse centered at (1,−2) becomes
[latex]\large{\frac{4(x-1)^{2}}{16-c^{2}}+\frac{(y+2)^{2}}{16-c^{2}}=1}[/latex]
for an arbitrary value of [latex]c[/latex]. Figure 4 shows a contour map for [latex]f\,(x,\ y)[/latex] using the values [latex]c=0,\ 1,\ 2[/latex], and [latex]3[/latex]. When [latex]c=4[/latex], the level curve is the point [latex](-1,\ 2)[/latex].
Figure 4. Contour map for the function [latex]f(x,y)=\sqrt{8+8x-4y-4x^{2}-y^{2}}[/latex], using the values [latex]c=0,1,2,3[/latex], and [latex]4[/latex].
Try It
Find and graph the level curve of the function [latex]g\,(x,\ y)=x^{2}+y^{2}-6x+2y[/latex] corresponding to [latex]c=15[/latex].
Show Solution
The equation of the level curve can be written as [latex](x-3)^{2}+(y+1)^{2}=25[/latex], which is a circle with radius [latex]5[/latex] centered at [latex](3,\ -1)[/latex].
Figure 5.
Another useful tool for understanding the graph of a function of two variables is called a vertical trace. Level curves are always graphed in the [latex]xy[/latex]-plane, but as their name implies, vertical traces are graphed in the [latex]xz[/latex]– or [latex]yz[/latex]-planes.
Definition
Consider a function [latex]z=f\,(x,\ y)[/latex] with domain [latex]D\subseteq\mathbb{R}^{2}[/latex]. A vertical trace of the function can be either the set of points that solves the equation [latex]f\,(a,\ y)=z[/latex] for a given constant [latex]x=a[/latex] or [latex]f\,(x,\ b)=z[/latex] for a given constant [latex]y=b[/latex].
Example: Finding Vertical Traces
Find vertical traces for the function [latex]f\,(x,\ y)=\sin{x}\cos{y}[/latex] corresponding to [latex]x=-\frac{\pi}{4}, 0[/latex], and [latex]\frac{\pi}{4}[/latex], and [latex]y=-\frac{\pi}{4}, 0[/latex], and [latex]\frac{\pi}{4}[/latex].
Show Solution
First set [latex]x=-\frac{\pi}{4}[/latex] in the equation [latex]z=\sin{x}\cos{y}[/latex]:
[latex]z=\sin{\big(-\frac{\pi}{4}\big)}\cos{y}=-\frac{\sqrt{2}\cos{y}}{2}\approx{-0.7071\cos{y}}[/latex].
This describes a cosine graph in the plane [latex]x=-\frac{\pi}{4}[/latex]. The other values of [latex]z[/latex] appear in the following table.
[latex]c[/latex] |
Vertical Trace for[latex]x=c[/latex] |
[latex]-\frac{\pi}{4}[/latex] |
[latex]z=-\frac{\sqrt{2}\cos{y}}{2}[/latex] |
[latex]0[/latex] |
[latex]z=0[/latex] |
[latex]\frac{\pi}{4}[/latex] |
[latex]z=\frac{\sqrt{2}\cos{y}}{2}[/latex] |
In a similar fashion, we can substitute the [latex]y[/latex]-values in the equation [latex]f\,(x,\ y)[/latex] to obtain the traces in the [latex]yz[/latex]-plane, as listed in the following table.
[latex]d[/latex] |
Vertical Trace for[latex]y=d[/latex] |
[latex]-\frac{\pi}{4}[/latex] |
[latex]z=\frac{\sqrt{2}\sin{x}}{2}[/latex] |
[latex]0[/latex] |
[latex]z=\sin{x}[/latex] |
[latex]\frac{\pi}{4}[/latex] |
[latex]z=\frac{\sqrt{2}\sin{x}}{2}[/latex] |
The three traces in the [latex]xz[/latex]-plane are cosine functions; the three traces in the [latex]yz[/latex]-plane are sine functions. These curves appear in the intersections of the surface with the planes [latex]x=-\frac{\pi}{4},\ x=0,\ x=\frac{\pi}{4}[/latex] and [latex]y=-\frac{\pi}{4},\ y=0,\ y=\frac{\pi}{4}[/latex] as shown in the following figure.
Figure 6. Vertical traces of the function [latex]f(x,y)[/latex] are cosine curves in the [latex]xz[/latex]-planes(a), and sine curves in the [latex]yz[/latex]-planes (b).
Try It
Determine the equation of the vertical trace of the function [latex]g\,(x,\ y)=-x^{2}-y^{2}+2x+4y-1[/latex] corresponding to [latex]y=3[/latex], and describe its graph.
Show Solution
[latex]z=3-(x-1)^{2}[/latex]. This function describes a parabola opening downward in the plane [latex]y=3[/latex].
Watch the following video to see the worked solution to the above Try It
You can view the transcript for “CP 4.3” here (opens in new window).Functions of two variables can produce some striking-looking surfaces. The following figure shows two examples.
Figure 7. Examples of surfaces representing functions of two variables: (a) a combination of a power function and a sine function and (b) a combination of trigonometric, exponential, and logarithmic functions.