Opening the book…
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.
A function of two variables \(z=f(x,y)\) maps each ordered pair \((x,y)\) in a subset \(D\) of the real plane \(\mathbb{R}^2\) to a unique real number z. The set \(D\) is called the domain of the function. The range of \(f\) is the set of all real numbers \(z\) that have at least one ordered pair \((x,y)∈D\) such that \(f(x,y)=z\) as shown below.
Determining the domain of a function of two variables involves taking into account any domain restrictions that may exist. Let’s take a look.
Find the domain and range of each of the following functions:
(a) \(f(x,y)=3x+5y+2\)
(b) \(g(x,y)=\sqrt{9−x^2−y^2}\)
(c) \(h(x,y)=\ln(36−9x^2−4y^2)\)
(a) This is an example of a linear function in two variables. There are no values or combinations of \(x\) and \(y\) that cause \(f(x,y)\) to be undefined, so the domain of \(f\) is \(\mathbb{R}^2\).
To determine the range, first pick a value for \(z\). We hope to find a solution to the equation \(f(x,y)=z,\) or \(3x+5y+2=z.\) One such solution can be obtained by first setting \(y=0\), which yields the equation \(3x+2=z\). The solution to this equation is \(x=\dfrac{z−2}{3}\), which gives the ordered pair \(\left(\dfrac{z−2}{3},0\right)\) as a solution to the equation \(f(x,y)=z\) for any value of \(z\).
Therefore, the range of the function is all real numbers, or \(\mathbb{R}\).
(b) For the function \(g(x,y)\) to have a real value, the quantity under the square root must be nonnegative:
\[9-x^2-y^2\ge 0 \longleftrightarrow x^2+y^2\le 9 \nonumber \]
Therefore, the domain of \(g(x,y)\) is \(\{(x,y)\in \mathbb{R}^2 \, : \, x^2+y^2\le 9 \}\). The graph of this set of points can be described as a disk of radius 3 centered at the origin. The domain includes the boundary circle as shown in the following graph.

To determine the range of \(g(x,y)=\sqrt{9−x^2−y^2}\), once again we pick a real number \(z\). We hope to find a solution to the equation \(z=\sqrt{9-x^2-y^2}\). This relationship is easier to think about in cylindrical coordinates:
\[ z=\sqrt{9-r^2} \text{ for } 0\le r\le 3 \nonumber \]
Since this is now reduced to a two variable equation, we can use our previous calculus knowledge to sketch the graph:

It is clear from this graph that the range of \(z\) is the interval \([0,3]\)
(c) For the function \(h(x,y)\) to have a real value, the quantity inside of the log must be positive:
\[ 36−9x^2−4y^2>0 \longleftrightarrow \dfrac{ x^2}{4}+\dfrac{y^2}{9}<1 \nonumber \]
Therefore, the domain of \(h(x,y)\) is \(\left\{(x,y)\in \mathbb{R}^2 \, \Big| \, \dfrac{x^2}{4}+\dfrac{y^2}{9}< 1 \right\}\). The graph of this set of points can be described as the interior of an ellipse centered at the origin. The domain does not include the boundary ellipse as shown in the following graph.

To determine the range of \(h(x,y)=\ln(36−9x^2−4y^2)\), once again we pick a real number \(z\). We hope to find a solution to the equation \(z=\ln(36−9x^2−4y^2)\). While cylindrical coordinates do not help here, we can still look at the interior of the log first. Since \(9x^2+4y^2\ge 0\) must hold, we know that
\[ 0<36−9x^2−4y^2\le 36 \nonumber \]
So if we define \(u=36−9x^2−4y^2\), we are looking to solve \(z=\ln(u)\) where \(0<u\le 36\). Once again this is now reduced to a two variable equation, we can use our previous calculus knowledge to sketch the graph:

Clearly the range of this graph, and therefore also \(h(x,y)\) is \((-\infty,\ln(36)]\)
Suppose we wish to graph the function \(z=f(x,y).\) This function has two independent variables (\(x\) and \(y\)) and one dependent variable \((z)\). When graphing a function \(y=f(x)\) of one variable, we use the Cartesian plane. We are able to graph any ordered pair \((x,y)\) in the plane, and every point in the plane has an ordered pair \((x,y)\) associated with it. With a function of two variables, each ordered pair \((x,y)\) in the domain of the function is mapped to a real number \(z\). Therefore, the graph of the function \(f\) consists of ordered triples \((x,y,z)\). The graph of a function \(z=f(x,y)\) 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 \((x,y)\) coordinate system laying flat. Then, every point in the domain of the function f has a unique \(z\)-value associated with it. If \(z\) is positive, then the graphed point is located above the \(xy\)-plane, if \(z\) is negative, then the graphed point is located below the \(xy\)-plane. The set of all the graphed points becomes the two-dimensional surface that is the graph of the function \(f\).
Create a graph of each of the following functions:
(a) \(g(x,y)=\sqrt{9−x^2−y^2}\)
(b) \(f(x,y)=x^2+y^2\)
(a) In Illustration \(\PageIndex{2b}\), we determined that the domain of \(g(x,y)=\sqrt{9−x^2−y^2}\) is \(\left\{(x,y) \in \mathbb{R}^2 \,: \, x^2+y^2≤9\right\}\) and the range is \(\left\{ z\in \mathbb{R} \, : \, 0\le z\le 3 \right\}\). When \(x^2+y^2=9\) we have \(g(x,y)=0\). Therefore any point on the circle of radius \(3\) centered at the origin in the \(xy\)-plane maps to \(z=0\) in \(\mathbb{R}^3\). If \(x^2+y^2=8\), then \(g(x,y)=1,\) so any point on the circle of radius \(2\sqrt{2}\) centered at the origin in the \(xy\)-plane maps to \(z=1\) in \(\mathbb{R}^3\). As \(x^2+y^2\) gets closer to zero, the value of \(z\) approaches \(3\). When \(x^2+y^2=0\), then \(g(x,y)=3\). This is the origin in the \(xy\)-plane If \(x^2+y^2\) is equal to any other value between \(0\) and \(9\), then \(g(x,y)\) equals some other constant between \(0\) and \(3\). The surface described by this function is a hemisphere centered at the origin with radius \(3\) as shown in the following graph.
(b) This function also contains the expression \(x^2+y^2\). Setting this expression equal to various values starting at zero, we obtain circles of increasing radius. The minimum value of \(f(x,y)=x^2+y^2\) is zero (attained when \(x=y=0.\). When \(x=0\), the function becomes \(z=y^2\), and when \(y=0\), then the function becomes \(z=x^2\). These are cross-sections of the graph, and are parabolas. Recall that the name of the graph of \(f(x,y)=x^2+y^2\) is a paraboloid. The graph of \(f\) appears in the following graph.
A profit function for a hardware manufacturer is given by
\[f(x,y)=16−(x−3)^2−(y−2)^2 \nonumber \]
where \(x\) is the number of nuts sold per month (measured in thousands) and \(y\) represents the number of bolts sold per month (measured in thousands). Profit is measured in thousands of dollars. Sketch a graph of this function.
Solution
This function is a polynomial function in two variables. The domain of \(f\) consists of \((x,y)\) coordinate pairs that yield a nonnegative profit:
\[ \begin{align*} 16−(x−3)^2−(y−2)^2 ≥ 0 \\[4pt] (x−3)^2+(y−2)^2 ≤ 16 \end{align*}\]
This is a disk of radius \(4\) centered at \((3,2)\). A further restriction is that both \(x\) and \(y\) must be nonnegative. When \(x=3\) and \(y=2, f(x,y)=16.\) Note that it is possible for either value to be a noninteger; for example, it is possible to sell \(2.5\) thousand nuts in a month. The domain, therefore, contains thousands of points, so we can consider all points within the disk. For any \(z<16\), we can solve the equation \(f(x,y)=16:\)
\[ \begin{align*} 16−(x−3)^2−(y−2)^2 =z \\[4pt] (x−3)^2+(y−2)^2 =16−z \end{align*}\]
Since \(z<16,\) we know that \(16−z>0,\) so the previous equation describes a circle with radius \(\sqrt{16−z}\) centered at the point \((3,2)\). Therefore. the range of \(f(x,y)\) is \(\left\{z∈\mathbb{R} \,:\, z\le 16 \right\}.\) The graph of \(f(x,y)\) is also a paraboloid, and this paraboloid points downward as shown.

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. A level curve of a function of two variables \(f(x,y)\) is completely analogous to a contour line on a topographical map.
Given a function \(f(x,y)\) and a number \(c\) in the range of \(f\), a level curve of a function of two variables for the value \(c\) is defined to be the set of points satisfying the equation \(f(x,y)=c.\)
Returning to the function \(g(x,y)=\sqrt{9−x^2−y^2}\), we can determine the level curves of this function. The range of \(g\) is the closed interval \([0,3]\). First, we choose any number in this closed interval—say, \(c=2\). The level curve corresponding to \(c=2\) is described by the equation
\[ \sqrt{9−x^2−y^2}=2 \nonumber \]
To simplify, square both sides of this equation:
\[ 9−x^2−y^2=4 \nonumber \]
Now, multiply both sides of the equation by \(−1\) and add \(9\) to each side:
\[ x^2+y^2=5 \nonumber \]
This equation describes a circle centered at the origin with radius \(\sqrt{5}\). Using values of \(c\) between \(0\) and \(3\) yields other circles also centered at the origin. If \(c=3\), then the circle has radius \(0\), so it consists solely of the origin. Pictured below is a graph of the level curves of this function corresponding to \(c=0,1,2,\) and \(3\).
A graph of the various level curves of a function is called a contour map.
Given the function \(f(x,y)=\sqrt{8+8x−4y−4x^2−y^2}\), find the level curve corresponding to \(c=0\). Then create a contour map for this function. What are the domain and range of \(f\)?
To find the level curve for \(c=0,\) we set \(f(x,y)=0\) and solve. This gives
\(0=\sqrt{8+8x−4y−4x^2−y^2}\)
We then square both sides and multiply both sides of the equation by \(−1\):
\(4x^2+y^2−8x+4y−8=0\)
Now, we rearrange the terms, putting the \(x\) terms together and the \(y\) terms together, and add \(8\) to each side:
\(4x^2−8x+y^2+4y=8\)
Next, we group the pairs of terms containing the same variable in parentheses, and factor \(4\) from the first pair:
\(4(x^2−2x)+(y^2+4y)=8\)
Then we complete the square in each pair of parentheses and add the correct value to the right-hand side:
\(4(x^2−2x+1)+(y^2+4y+4)=8+4(1)+4\)
Next, we factor the left-hand side and simplify the right-hand side:
\(4(x−1)^2+(y+2)^2=16\)
Last, we divide both sides by \(16:\)
\[\dfrac{(x−1)^2}{4}+\dfrac{(y+2)^2}{16}=1 \nonumber\]
This equation describes an ellipse centered at \((1,−2).\) The graph of this ellipse is provided below.

We can repeat the same derivation for values of \(c\) less than \(4.\) Then, each level curve equation becomes
\(\dfrac{4(x−1)^2}{16−c^2}+\dfrac{(y+2)^2}{16−c^2}=1\)
The figure below shows a contour map for \(f(x,y)\) using the values \(c=0,1,2,\) and \(3\). When \(c=4,\) the level curve is the point \((−1,2)\).

To find our domain, since this is a square root function, the radicand must not be negative. So we have
\[8+8x−4y−4x^2−y^2\ge 0 \nonumber \]
Recognizing that the boundary of the domain is an ellipse, we repeat the steps we showed above to obtain
\[\dfrac{(x−1)^2}{4}+\dfrac{(y+2)^2}{16}\le 1 \nonumber \]
So the domain of \(f\) can be written: \(\left\{ (x,y) \, \Big| \, \dfrac{(x−1)^2}{4}+\dfrac{(y+2)^2}{16}\le 1 \right\}.\)
To find the range of \(f,\) we need to consider the possible outputs of this square root function. We know the output cannot be negative, so we need to next check if its output is ever \(0.\) From the work we completed above to find the level curve for \(c = 0,\) we know the value of \(f\) is \(0\) for any point on that level curve (on the ellipse, \(\dfrac{(x−1)^2}{4}+\dfrac{(y+2)^2}{16}=1\)). So we know the lower bound of the range of this function is \(0.\)
To determine the upper bound for the range of the function in this problem, it's easier if we first complete the square under the radical.
\[\begin{align*} f(x,y) &= \sqrt{8+8x−4y−4x^2−y^2} \\[5pt]
&= \sqrt{8 - 4(x^2 - 2x \quad) - (y^2 + 4y \quad)}\\[5pt]
&= \sqrt{8 - 4(x^2 - 2x +1 - 1) - (y^2 + 4y + 4 - 4)}\\[5pt]
&= \sqrt{8 - 4(x^2 - 2x +1) + 4 - (y^2 + 4y + 4) +4}\\[5pt]
&= \sqrt{16 - 4(x-1)^2 - (y+2)^2} \end{align*}\]
Now that we have \(f\) in this form, we can see how large the radicand can be. Since we are subtracting two perfect squares from \(16,\) we know that the value of the radicand cannot be greater than \(16.\) At the point \((1, -2),\) we can see the radicand will be 16 (since we will be subtracting \(0\) from \(16\) at this point. This gives us the maximum value of \(f\), that is \(f(1, -2) = \sqrt{16} = 4\)
So the range of this function is the interval \([0, 4]\)
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 \(xy\)-plane, but as their name implies, vertical traces are graphed in the \(xz\)-plane or \(yz\)-plane respectively.
Consider a function \(z=f(x,y)\) with domain \(D⊆\mathbb{R}^2\). A vertical trace of the function can be either the set of points that solve the equation \(f(a,y)=z\) for a given constant \(x=a\) or \(f(x,b)=z\) for a given constant \(y=b.\)
Find vertical traces for the function \(f(x,y)=\sin (x) \cos (y)\) corresponding to \(x=−\dfrac{π}{4},0,\) and \(\dfrac{π}{4}\), and \(y=−\dfrac{π}{4},0\), and \(\dfrac{π}{4}\)
First set \(x=-\dfrac{\pi}{4}\) in the equation \(z=\sin (x) \cos (y)\):
\(z=\sin\left(-\dfrac{\pi}{4}\right)\cos (y)=−\dfrac{\sqrt{2}\cos (y)}{2}\)
This describes a cosine graph in the plane \(x=-\dfrac{\pi}{4}\). The other values of \(z\) appear in the following table.
| \(c\) | Vertical Trace for \(x=c\) |
|---|---|
| \(−\dfrac{\pi}{4}\) | \(z=−\dfrac{\sqrt{2}\cos (y)}{2}\) |
| 0 | \(z=0\) |
| \(\dfrac{\pi}{4}\) | \(z=\dfrac{\sqrt{2}\cos (y)}{2}\) |
In a similar fashion, we can substitute the \(y\)-values in the equation \(f(x,y)\) to obtain the traces in the \(yz\)-plane, as listed in the following table.
| \(d\) | Vertical Trace for \(y=d\) |
|---|---|
| \(\dfrac{\pi}{4}\) | \(z=\dfrac{\sqrt{2}\sin (x)}{2}\) |
| 0 | \(z=\sin (x)\) |
| \(−\dfrac{\pi}{4}\) | \(z=\dfrac{\sqrt{2}\sin (x)}{2}\) |
The three traces in the \(xz\)-plane are cosine functions; the three traces in the \(yz\)-plane are sine functions. These curves appear in the intersections of the surface with the planes \(x=-\dfrac{\pi}{4}, \, x=0, \, x=\dfrac{\pi}{4}\) and \(y=-\dfrac{\pi}{4}, \, y=0, \, y=\dfrac{\pi}{4}\) as shown in the following figure.
Functions of two variables can produce some striking-looking surfaces. Below we see two such examples.
(a) a combination of a power function and a sine function
(b) a combination of trigonometric, exponential, and logarithmic functions.
So far, we have examined only functions of two variables. However, it is useful to take a brief look at functions of more than two variables. Two such examples are
\[ \underbrace{f(x,y,z)=x^2−2xy+y^2+3yz−z^2+4x−2y+3z−6}_{\text{a polynomial in three variables}} \nonumber \]
and
\[g(x,y,t)=(x^2−4xy+y^2)\sin (t)−(3x+5y)\cos (t) \nonumber \]
In the first function, \((x,y,z)\) represents a point in space, and the function \(f\) maps each point in space to a fourth quantity, such as temperature or wind speed. In the second function, \((x,y)\) can represent a point in the plane, and \(t\) can represent time. The function might map a point in the plane to a third quantity (for example, pressure) at a given time \(t\). The method for finding the domain of a function of more than two variables is analogous to the method for functions of one or two variables.
Find the domain of each of the following functions:
(a) \(f(x,y,z)=\dfrac{3x−4y+2z}{\sqrt{9−x^2−y^2−z^2}}\)
(b) \(g(x,y,t)=\dfrac{\sqrt{2t−4}}{x^2−y^2}\)
(c) \(h(x,y,t)=(3t−6)\sqrt{y−4x^2+4}\)
Solution:
(a) For the function \(f(x,y,z)=\dfrac{3x−4y+2z}{\sqrt{9−x^2−y^2−z^2}}\) to be defined (and be a real value), two conditions must hold:
- The denominator cannot be zero.
- The radicand cannot be negative.
Combining these conditions leads to the inequality
\[9−x^2−y^2−z^2>0\nonumber \]
Moving the variables to the other side and reversing the inequality gives the domain as
\[\boxed{\text{Domain}(f)=\left\{(x,y,z)∈\mathbb{R}^3 \, : \, x^2+y^2+z^2<9\right\}}\nonumber \]
which describes a ball of radius \(3\) centered at the origin. (Note: The surface of the ball is not included in this domain.)
(b) For the function \(g(x,y,t)=\dfrac{\sqrt{2t−4}}{x^2−y^2}\) to be defined (and be a real value), two conditions must hold:
- The radicand cannot be negative.
- The denominator cannot be zero.
Since the radicand cannot be negative, this implies \(2t−4≥0\), and therefore that \(t≥2\). Since the denominator cannot be zero, \(x^2−y^2≠0\), or \(x^2≠y^2\), Which can be rewritten as \(y=±x\), which are the equations of two lines passing through the origin. Therefore, the domain of \(g\) is
\[ \boxed{\text{Domain}(g)=\left\{(x,y,t) \, : \,y≠±x,\, t≥2\right\} }\nonumber \]
(c) For the function \(h(x,y,t)=(3t−6)\sqrt{y−4x^2+4}\) we only need to worry about the radicand being non-negative:
\[ y-4x^2+4\ge 0 \longleftrightarrow y\ge 4x^2-4\nonumber\]
There is no restriction on the values of \(t\) for this function to exist, so we get
\[\boxed{ \text{Domain}(h)=\left\{(x,y,t) \, : \, y\ge 4x^2-4,\, t\in\mathbb{R}\right\}} \nonumber \]
Functions of two variables have level curves, which are shown as curves in the \(xy-plane.\) However, when the function has three variables, the curves become surfaces, so we can define level surfaces for functions of three variables.
Given a function \(f(x,y,z)\) and a number \(c\) in the range of \(f\), a level surface of a function of three variables is defined to be the set of points satisfying the equation \(f(x,y,z)=c.\)
Find the level surface for the function \(f(x,y,z)=4x^2+9y^2−z^2\) corresponding to \(c=0,1,2\) and \(3\).
Solution
The level surface is defined by the equation \(4x^2+9y^2−z^2=c.\)
When \(c=0\) this defines a cone, but for \(c=1,2,3\) this equation describes a hyperboloid of one sheet as shown below:

This page titled 2.1: Functions of Several Variables was last modified on Wed, 15 Apr 2026 11:34:11 GMT and is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Kenn Huber via source content that was edited to the style and standards of the LibreTexts platform.
The book could not be loaded just now.