Learning Outcomes
- Recognize a function of two variables and identify its domain and range.
- Sketch a graph of a function of two variables.
The definition of a function of two variables is very similar to the definition for a function of one variable. The main difference is that, instead of mapping values of one variable to values of another variable, we map ordered pairs of variables to another variable.
Definition
A function of two variables [latex]z=f\,(x,\ y)[/latex] maps each ordered pair [latex](x,\ y)[/latex] in a subset [latex]{\bf{D}}[/latex] of the real plane [latex]\mathbb{R}^{2}[/latex] to a unique real number [latex]z[/latex]. The set [latex]{\bf{D}}[/latex] is called the domain of the function. The range of [latex]f[/latex] is the set of all real numbers [latex]z[/latex] that has at least one ordered pair [latex](x,\ y)\in{\bf{D}}[/latex] such that [latex]f\,(x,\ y)=z[/latex] as shown in the following figure.
Figure 1. The domain of a function of two variables consists of ordered pairs [latex](x,y)[/latex].
Determining the domain of a function of two variables involves taking into account any domain restrictions that may exist. Let’s take a look.
Example: Domains and Ranges for Functions of Two Variables
Find the domain and range of each of the following functions:
- [latex]f\,(x,\ y)=3x+5y+2[/latex]
- [latex]g\,(x,\ y)=\sqrt{9-x^{2}-y^{2}}[/latex]
Show Solution
- This is an example of a linear function in two variables. There are no values or combinations of [latex]x[/latex] and [latex]y[/latex] that cause [latex]f\,(x,\ y)[/latex] to be undefined, so the domain of [latex]f[/latex] is [latex]\mathbb{R}^{2}[/latex]. To determine the range, first pick a value for [latex]z[/latex]. We need to find a solution to the equation [latex]f\,(x,\ y)=z[/latex], or [latex]3x-5y+2=z[/latex]. One such solution can be obtained by first setting [latex]y=0[/latex], which yields the equation [latex]3x+2=z[/latex]. The solution to this equation is [latex]x=\frac{z-2}{3}[/latex], which gives the ordered pair [latex](\frac{z-2}{3},\ 0)[/latex] as a solution to the equation [latex]f\,(x,\ y)=z[/latex] for any value of [latex]z[/latex]. Therefore, the range of the function is all real numbers, or [latex]\mathbb{R}[/latex].
- For the function [latex]g\,(x,\ y)[/latex] to have a real value, the quantity under the square root must be nonnegative:
[latex]9-x^{2}-y^{2}\,\geq\,0.[/latex]
This inequality can be written in the form
[latex]x^{2}+y^{2}\,\leq\,9.[/latex]
Therefore, the domain of [latex]g\,(x,\ y)[/latex] is [latex]{\{(x,\ y)\in\mathbb{R}^{2}\,|\,x^{2}+y^{2}\,\leq\,9\}}[/latex]. The graph of this set of points can be described as a disk of radius [latex]3[/latex] centered at the origin. The domain includes the boundary circle as shown in the following graph.
Figure 2. The domain of the function [latex]\small{g(x,y)=\sqrt{9-x^{2}-y^{2}}}[/latex] is a closed disk of radius [latex]\small{3}[/latex].
To determine the range of [latex]g\,(x,\ y)=\sqrt{9-x^{2}-y^{2}}[/latex] we start with a point [latex](x_0,\ y_0)[/latex] on the boundary of the domain, which is defined by the relation [latex]x^{2}+y^{2}=9[/latex]. It follows that [latex]x^2_0+y^2_0=9[/latex] and
[latex]g\,(x_0,\ y_0)=\sqrt{9-x^2_0-y^2_0}=\sqrt{9-(x^2_0+y^2_0)}=\sqrt{9-9}=0[/latex].
If [latex]x^2_0+y^2_0=0[/latex] (in other words, [latex]x_0=y_0=0[/latex]), then
[latex]g\,(x_0,\ y_0)=\sqrt{9-x^2_0-y^2_0}=\sqrt{9-(x^2_0+y^2_0)}=\sqrt{9-0}=3[/latex]
This is the maximum value of the function. Given any value [latex]c[/latex] between 0 and 3, we can find an entire set of points inside the domain of [latex]g[/latex] such that [latex]g\,(x,\ y)=c[/latex]:
[latex]\begin{array}{ccc} \hfill {\sqrt{9-x^{2}-y^{2}}} & =\hfill & {c} \hfill \\ \hfill {9-x^{2}-y^{2}} & =\hfill & {c^{2}}\hfill \\ \hfill {x^{2}+y^{2}} & =\hfill & {9-c^{2}.}\hfill \\ \hfill \end{array}[/latex]
Since [latex]9-c^{2}\,>\,0[/latex], this describes a circle of radius [latex]\sqrt{9-c^{2}}[/latex] centered at the origin. Any point on this circle satisfies the equation [latex]g\,(x,\ y)=c[/latex]. Therefore, the range of this function can be written in interval notation as [latex][0,\ 3][/latex].
Try It
Find the domain and range of the function [latex]f\,(x,\ y)=\sqrt{36-9x^{2}-9y^{2}}[/latex].
Show Solution
The domain is the shaded circle defined by the inequality [latex]9x^{2}+9y^{2}\,\leq\,36[/latex], which has a circle of radius [latex]2[/latex] as its boundary. The range is [latex][0,\ 6][/latex].
Figure 3.
Watch the following video to see the worked solution to the above Try It
You can view the transcript for “CP 4.1” here (opens in new window).
Graphing Functions of Two Variables
Suppose we wish to graph the function [latex]z=(x,\ y)[/latex]. This function has two independent variables ([latex]x[/latex] and [latex]y[/latex]) and one dependent variable ([latex]z[/latex]). When graphing a function [latex]y=f\,(x)[/latex] of one variable, we use the Cartesian plane. We are able to graph any ordered pair [latex](x,\ y)[/latex] in the plane, and every point in the plane has an ordered pair [latex](x,\ y)[/latex] associated with it. With a function of two variables, each ordered pair [latex](x,\ y)[/latex] in the domain of the function is mapped to a real number [latex]z[/latex]. Therefore the graph of the function [latex]f[/latex] consists of ordered pairs [latex](x,\ y,\ z)[/latex]. The graph of a function [latex]z=f\,(x,\ y)[/latex] of two variables is called a surface.
To understand more completely the concept of plotting a set of ordered triples to obtain a surface in three-dimensional space, imagine the [latex]x,\ y)[/latex] coordinate system laying flat. Then, every point in the domain of the function [latex]f[/latex] has a unique [latex]z[/latex]-value associated with it. If [latex]z[/latex] is positive, then the graphed point is located above the [latex]xy[/latex]-plane. The set of all the graphed points becomes the two-dimensional surface that is the graph of the function [latex]f[/latex].
Example: Graphing Functions of Two Variables
Create a graph of each of the following functions:
- [latex]g\,(x,\ y)=\sqrt{9-x^{2}-y^{2}}[/latex]
- [latex]f\,(x,\ y)=x^{2}+y^{2}[/latex]
Show Solution
- In the previous example, we determined that the domain of [latex]g\,(x,\ y)=\sqrt{9-x^{2}-y^{2}}[/latex] is [latex]\{(x,\ y)\in\mathbb{R}^{2}\,|\,x^{2}+y^{2}\,\leq\,9\}[/latex] and the range is [latex]{z\in\mathbb{R}^{2}\,|\,0\,\leq\,z\,\leq\,3}[/latex]. When [latex]x^{2}+y^{2}=9[/latex] we have [latex]g\,(x,\ y)=0[/latex]. Therefore, any point on the circle of radius [latex]3[/latex] centered at the origin in the [latex]xy[/latex]-plane maps to [latex]z=0[/latex] in [latex]\mathbb{R}^3[/latex]. If [latex]x^{2}+y^{2}=8[/latex], then [latex]g\,(x,\ y)=1[/latex], so any point on the circle of radius [latex]2\sqrt{2}[/latex] centered at the origin in the [latex]xy[/latex]-plane maps to [latex]z=1[/latex] in [latex]\mathbb{R}^{3}[/latex]. As [latex]x^{2}+y^{2}[/latex] gets closer to zero, the value of [latex]z[/latex] approaches [latex]3[/latex]. When [latex]x^{2}+y^{2}=0[/latex], then [latex]g\,(x,\ y)=3[/latex]. This is the origin in the [latex]xy[/latex]-plane. If [latex]x^{2}+y^{2}[/latex] is equal to any other value between [latex]0[/latex] and [latex]9[/latex], then [latex]g\,(x,\ y)[/latex] equals some other constant between [latex]0[/latex] and [latex]3[/latex]. The surface described by this function is a hemisphere centered at the origin with radius [latex]3[/latex] as shown in the following graph.
Figure 4. Graph of the hemisphere represented by the given function of two variables.
- This function also contains the expression [latex]x^{2}+y^{2}[/latex]. Setting this expression equal to various values starting at zero, we obtain circles of increasing radius. The minimum value of [latex]f\,(x,\ y)=x^{2}+y^{2}[/latex] is zero (attained when [latex]x=y=0[/latex]). When [latex]x=0[/latex], the function becomes [latex]z=y^{2}[/latex], and when [latex]y=0[/latex], then the function becomes [latex]z=x^{2}[/latex]. These are cross-sections of the graph, and are parabolas. Recall from Introduction to Vectors in Space that the name of the graph of [latex]f\,(x,\ y)=x^{2}+y^{2}[/latex] is a paraboloid. The graph of [latex]f[/latex] appears in the following graph.
Figure 5. A paraboloid is the graph of the given function of two variables.
Example: Nuts and Bolts
A profit function for a hardware manufacturer is given by
[latex]f\,(x,\ y)=16-(x-3)^{2}-(y-2)^{2}[/latex],
where [latex]x[/latex] is the number of nuts sold per month (measured in thousands) and [latex]y[/latex] represents the number of bolts sold per month (measured in thousands). Profit is measured in thousands of dollars. Sketch a graph of this function.
Show Solution
This function is a polynomial function in two variables. The domain of [latex]f[/latex] consists of [latex](x,\ y)[/latex] coordinate pairs that yield a nonnegative profit:
[latex]16-(x-3)^{2}-(y-2)^{2}\,\geq\,0[/latex]
[latex](x-3)^{2}-(y-2)^{2}\,\leq\,16.[/latex]
This is a disk of radius [latex]4[/latex] centered at [latex](3,\ 2)[/latex]. A further restriction is that both [latex]x[/latex] and [latex]y[/latex] must be nonnegative. When [latex]x=3[/latex] and [latex]y=2[/latex], [latex]f\,(x,\ y)=16[/latex]. Note that it is possible for either value to be a noninteger; for example, it is possible to sell [latex]2.5[/latex] thousand nut in a month. The domain, therefore, contains thousands of points, so we can consider all points within the disk. For any [latex]z<16[/latex], we can solve the equation [latex]f\,(x,\ y)=z[/latex]:
[latex]16-(x-3)^{2}-(y-2)^{2}=z[/latex]
[latex](x-3)^{2}-(y-2)^{2}=16-z[/latex]
Since [latex]z<16[/latex], we know that [latex]16-z>0[/latex], so the previous equation describes a circle with radius [latex]\sqrt{16-z}[/latex] centered at the point [latex](3,\ 2)[/latex]. Therefore, the range of [latex]f\,(x,\ y)[/latex] is [latex]\{z\in\mathbb{R}\,|z\,\leq\,16\}[/latex]. The graph of [latex]f\,(x,\ y)[/latex] is also a paraboloid, and this paraboloid points downward as shown.
Figure 6. The graph of the given function of two variables is also a paraboloid.