### Learning Objectives

- 4.1.1. Recognize a function of two variables and identify its domain and range.
- 4.1.2. Sketch a graph of a function of two variables.
- 4.1.3. Sketch several traces or level curves of a function of two variables.
- 4.1.4. Recognize a function of three or more variables and identify its level surfaces.

Our first step is to explain what a function of more than one variable is, starting with functions of two independent variables. This step includes identifying the domain and range of such functions and learning how to graph them. We also examine ways to relate the graphs of functions in three dimensions to graphs of more familiar planar functions.

### Functions 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 $z=f\left(x,y\right)$ maps each ordered pair $\left(x,y\right)$ 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 has at least one ordered pair $\left(x,y\right)\in D$ such that $f\left(x,y\right)=z$ as shown in the following figure.

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 4.1

#### Domains and Ranges for Functions of Two Variables

Find the domain and range of each of the following functions:

- $f\left(x,y\right)=3x+5y+2$
- $g\left(x,y\right)=\sqrt{9-{x}^{2}-{y}^{2}}$

Find the domain and range of the function $f\left(x,y\right)=\sqrt{36-9{x}^{2}-9{y}^{2}}.$

### Graphing Functions of Two Variables

Suppose we wish to graph the function $z=\left(x,y\right).$ This function has two independent variables $\left(x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y\right)$ and one dependent variable $\left(z\right).$ When graphing a function $y=f\left(x\right)$ of one variable, we use the Cartesian plane. We are able to graph any ordered pair $\left(x,y\right)$ in the plane, and every point in the plane has an ordered pair $\left(x,y\right)$ associated with it. With a function of two variables, each ordered pair $\left(x,y\right)$ in the domain of the function is mapped to a real number $z.$ Therefore, the graph of the function $f$ consists of ordered triples $\left(x,y,z\right).$ The graph of a function $z=\left(x,y\right)$ 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 $\left(x,y\right)$ coordinate system laying flat. Then, every point in the domain of the function $f$ has a unique $z\text{-value}$ associated with it. If $z$ is positive, then the graphed point is located above the $\mathit{\text{xy}}\text{-plane,}$ if $z$ is negative, then the graphed point is located below the $\mathit{\text{xy}}\text{-plane}.$ The set of all the graphed points becomes the two-dimensional surface that is the graph of the function $f.$

### Example 4.2

#### Graphing Functions of Two Variables

Create a graph of each of the following functions:

- $g\left(x,y\right)=\sqrt{9-{x}^{2}-{y}^{2}}$
- $f\left(x,y\right)={x}^{2}+{y}^{2}$

### Example 4.3

#### Nuts and Bolts

A profit function for a hardware manufacturer is given by

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.

### Level Curves

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 4.7). A level curve of a function of two variables $f\left(x,y\right)$ is completely analogous to a contour line on a topographical map.

### Definition

Given a function $f\left(x,y\right)$ and a number $c$ in the range of $f,\phantom{\rule{0.2em}{0ex}}\text{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\left(x,y\right)=c.$

Returning to the function $g\left(x,y\right)=\sqrt{9-{x}^{2}-{y}^{2}},$ we can determine the level curves of this function. The range of $g$ is the closed interval $\left[0,3\right].$ First, we choose any number in this closed interval—say, $c=2.$ The level curve corresponding to $c=2$ is described by the equation

To simplify, square both sides of this equation:

Now, multiply both sides of the equation by $\mathrm{-1}$ and add $9$ to each side:

This equation describes a circle centered at the origin with radius $\sqrt{5}.$ Using values of $c$ between $0\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}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. Figure 4.8 is a graph of the level curves of this function corresponding to $c=0,1,2,\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}3.$ 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.

A graph of the various level curves of a function is called a contour map.

### Example 4.4

#### Making a Contour Map

Given the function $f\left(x,y\right)=\sqrt{8+8x-4y-4{x}^{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?$

Find and graph the level curve of the function $g\left(x,y\right)={x}^{2}+{y}^{2}-6x+2y$ corresponding to $c=15.$

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\text{-plane,}$ but as their name implies, vertical traces are graphed in the $xz$- or $yz\text{-planes.}$

### Definition

Consider a function $z=f\left(x,y\right)$ with domain $D\subseteq {\mathbb{R}}^{2}.$ A vertical trace of the function can be either the set of points that solves the equation $f\left(a,y\right)=z$ for a given constant $x=a$ or $f\left(x,b\right)=z$ for a given constant $y=b.$

### Example 4.5

#### Finding Vertical Traces

Find vertical traces for the function $f\left(x,y\right)=\text{sin}\phantom{\rule{0.2em}{0ex}}x\phantom{\rule{0.2em}{0ex}}\text{cos}\phantom{\rule{0.2em}{0ex}}y$ corresponding to $x=-\frac{\pi}{4},0,\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}\frac{\pi}{4},$ and $y=-\frac{\pi}{4},0,\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}\frac{\pi}{4}.$

Determine the equation of the vertical trace of the function $g\left(x,y\right)=\text{\u2212}{x}^{2}-{y}^{2}+2x+4y-1$ corresponding to $y=3,$ and describe its graph.

Functions of two variables can produce some striking-looking surfaces. The following figure shows two examples.

### Functions of More Than Two Variables

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

and

In the first function, $\left(x,y,z\right)$ 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, $\left(x,y\right)$ 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.

### Example 4.6

#### Domains for Functions of Three Variables

Find the domain of each of the following functions:

- $f\left(x,y,z\right)=\frac{3x-4y+2z}{\sqrt{9-{x}^{2}-{y}^{2}-{z}^{2}}}$
- $g\left(x,y,t\right)=\frac{\sqrt{2t-4}}{{x}^{2}-{y}^{2}}$

Find the domain of the function $h\left(x,y,t\right)=\left(3t-6\right)\sqrt{y-4{x}^{2}+4}.$

Functions of two variables have level curves, which are shown as curves in the $xy\text{-plane.}$ However, when the function has three variables, the curves become surfaces, so we can define level surfaces for functions of three variables.

### Definition

Given a function $f\left(x,y,z\right)$ 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\left(x,y,z\right)=c.$

### Example 4.7

#### Finding a Level Surface

Find the level surface for the function $f\left(x,y,z\right)=4{x}^{2}+9{y}^{2}-{z}^{2}$ corresponding to $c=1.$

Find the equation of the level surface of the function

corresponding to $c=2,$ and describe the surface, if possible.

### Section 4.1 Exercises

For the following exercises, evaluate each function at the indicated values.

$W(x,y)=4{x}^{2}+{y}^{2}.$ Find $W(2+h,3+h).$

The volume of a right circular cylinder is calculated by a function of two variables, $V(x,y)=\pi {x}^{2}y,$ where $x$ is the radius of the right circular cylinder and $y$ represents the height of the cylinder. Evaluate $V(2,5)$ and explain what this means.

An oxygen tank is constructed of a right cylinder of height $y$ and radius $x$ with two hemispheres of radius $x$ mounted on the top and bottom of the cylinder. Express the volume of the tank as a function of two variables, $x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y,$ find $V(10,2),$ and explain what this means.

For the following exercises, find the domain of the function.

$f(x,y)=\sqrt{{x}^{2}+{y}^{2}-4}$

$g(x,y)=\sqrt{16-4{x}^{2}-{y}^{2}}$

$f(x,y)=\frac{y+2}{{x}^{2}}$

Find the range of the functions.

$V(x,y)=4{x}^{2}+{y}^{2}$

For the following exercises, find the level curves of each function at the indicated value of $c$ to visualize the given function.

$z(x,y)={y}^{2}-{x}^{2},$ $c=1$

$g(x,y)={x}^{2}+{y}^{2};c=4,c=9$

$f(x,y)=xy;c=1;c=\mathrm{-1}$

$f(x,y)={x}^{2}-y;c=1,2$

$g(x,y)={x}^{3}-y;c=\mathrm{-1},0,2$

$f(x,y)={x}^{2};c=4,9$

$h(x,y)=\text{ln}({x}^{2}+{y}^{2});c=\mathrm{-1},0,1$

$z=f(x,y)=\sqrt{{x}^{2}+{y}^{2}},$ $c=3$

For the following exercises, find the vertical traces of the functions at the indicated values of $x$ and *y*, and plot the traces.

$z=4-x-y;x=2$

$z=\text{cos}\sqrt{{x}^{2}+{y}^{2}}$ $x=1$

Find the domain of the following functions.

$z=\text{ln}\left(x-{y}^{2}\right)$

$f(x,y,z)=\sqrt{49-{x}^{2}-{y}^{2}-{z}^{2}}$

$f(x,y)=\text{cos}\sqrt{{x}^{2}+{y}^{2}}$

For the following exercises, plot a graph of the function.

$z={x}^{2}+{y}^{2}$

Sketch the following by finding the level curves. Verify the graph using technology.

$f(x,y)=\sqrt{4-{x}^{2}-{y}^{2}}$

$z=1+{e}^{\text{\u2212}{x}^{2}-{y}^{2}}$

$z={y}^{2}-{x}^{2}$

Find the level surface for the functions of three variables and describe it.

$w(x,y,z)=x-2y+z,c=4$

$w(x,y,z)={x}^{2}+{y}^{2}-{z}^{2},c=\mathrm{-4}$

$w(x,y,z)=9{x}^{2}-4{y}^{2}+36{z}^{2},c=0$

For the following exercises, find an equation of the level curve of $f$ that contains the point $P.$

$g(x,y)={y}^{2}\text{arctan}\phantom{\rule{0.2em}{0ex}}x,P(1,2)$

The strength $E$ of an electric field at point $\left(x,y,z\right)$ resulting from an infinitely long charged wire lying along the $y\text{-axis}$ is given by $E(x,y,z)=k\text{/}\sqrt{{x}^{2}+{y}^{2}},$ where $k$ is a positive constant. For simplicity, let $k=1$ and find the equations of the level surfaces for $E=10\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}E=100.$

A thin plate made of iron is located in the $xy\text{-plane.}$ The temperature $T$ in degrees Celsius at a point $P\left(x,y\right)$ is inversely proportional to the square of its distance from the origin. Express $T$ as a function of $x\phantom{\rule{0.2em}{0ex}}\text{and}\phantom{\rule{0.2em}{0ex}}y.$

Refer to the preceding problem. Using the temperature function found there, determine the proportionality constant if the temperature at point $P\left(1,2\right)\phantom{\rule{0.2em}{0ex}}is\phantom{\rule{0.2em}{0ex}}50\text{\xb0}\text{C}.$ Use this constant to determine the temperature at point $Q\left(3,4\right).$

Refer to the preceding problem. Find the level curves for $T=40\text{\xb0}\text{C and}\phantom{\rule{0.2em}{0ex}}T=100\text{\xb0}\text{C},$ and describe what the level curves represent.