Processing math: 100%
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

13.1: Functions of Multiple Variables

( \newcommand{\kernel}{\mathrm{null}\,}\)

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: Function of Two Variables

A function of two variables z=f(x,y) maps each ordered pair (x,y) in a subset D of the real plane IR2 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 (x,y)D such that f(x,y)=z as shown in Figure 13.1.1.

imageedit_1_9200797960.png
Figure 13.1.1: The domain of a function of two variables consists of ordered pairs (x,y).

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 13.1.1: Domains and Ranges for Functions of Two Variables

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

  1. f(x,y)=3x+5y+2
  2. g(x,y)=9x2y2

Solution

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 IR2. Written in set-builder notation, this could be written as, {(x,y)|xIR,yIR}.

To determine the range, first pick a value for z. We need to find a solution to the equation f(x,y)=z, or 3x5y+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=z23, which gives the ordered pair (z23,0) 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 (,).

b. For the function g(x,y) to have a real value, the quantity under the square root must be nonnegative:

9x2y20.

This inequality can be written in the form

x2+y29.

Therefore, the domain of g(x,y) is {(x,y)R2x2+y29}. 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.

imageedit_4_7342383220.png
Figure 13.1.2: The domain of the function g(x,y)=9x2y2 is a closed disk of radius 3.

To determine the range of g(x,y)=9x2y2 we start with a point (x0,y0) on the boundary of the domain, which is defined by the relation x2+y2=9. It follows that x20+y20=9 and

g(x0,y0)=9x20y20=9(x20+y20)=99=0.

If x20+y20=0 (in other words, x0=y0=0), then

g(x0,y0)=9x20y20=9(x20+y20)=90=3.

This is the maximum value of the function. Given any value c between 0 and 3, we can find an entire set of points inside the domain of g such that g(x,y)=c:

9x2y2=c9x2y2=c2x2+y2=9c2.

Since 9c2>0, this describes a circle of radius 9c2 centered at the origin. Any point on this circle satisfies the equation g(x,y)=c. Therefore, the range of this function can be written in interval notation as [0,3].

Exercise 13.1.1

Find the domain and range of the function f(x,y)=369x29y2.

Hint

Determine the set of ordered pairs that do not make the radicand negative.

Solution

The domain is {(x,y)|x2+y24} the shaded circle defined by the inequality x2+y24, which has a circle of radius 2 as its boundary. The range is [0,6].

imageedit_7_9917563416.png

Graphing Functions of Two Variables

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.

Example 13.1.2: Graphing Functions of Two Variables

Create a graph of each of the following functions:

  1. g(x,y)=9x2y2
  2. f(x,y)=x2+y2

Solution

a. In Example 13.1.2, we determined that the domain of g(x,y)=9x2y2 is {(x,y)R2x2+y29} and the range is {zR20z3}. When x2+y2=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 R3. If x2+y2=8, then g(x,y)=1, so any point on the circle of radius 22 centered at the origin in the xy-plane maps to z=1 in R3. As x2+y2 gets closer to zero, the value of z approaches 3. When x2+y2=0, then g(x,y)=3. This is the origin in the xy-plane If x2+y2 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.

imageedit_10_4895909268.png
Figure 13.1.3: Graph of the hemisphere represented by the given function of two variables.

b. This function also contains the expression x2+y2. Setting this expression equal to various values starting at zero, we obtain circles of increasing radius. The minimum value of f(x,y)=x2+y2 is zero (attained when x=y=0.. When x=0, the function becomes z=y2, and when y=0, then the function becomes z=x2. These are cross-sections of the graph, and are parabolas. Recall from Introduction to Vectors in Space that the name of the graph of f(x,y)=x2+y2 is a paraboloid. The graph of f appears in the following graph.

imageedit_13_4445278108.png
Figure 13.1.4: A paraboloid is the graph of the given function of two variables.

Example 13.1.3: Nuts and Bolts

A profit function for a hardware manufacturer is given by

f(x,y)=16(x3)2(y2)2,

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:

16(x3)2(y2)20(x3)2+(y2)216.

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:

16(x3)2(y2)2=z(x3)2+(y2)2=16z.

Since z<16, we know that 16z>0, so the previous equation describes a circle with radius 16z centered at the point (3,2). Therefore. the range of f(x,y) is {zR|z16}. The graph of f(x,y) is also a paraboloid, and this paraboloid points downward as shown.

imageedit_16_6559141963.png
Figure 13.1.5: The graph of the given function of two variables is also a paraboloid.

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

CNX_Calc_Figure_14_01_007.jpg
Figure 13.1.6: (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: Level Curves

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)=9x2y2, 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

9x2y2=2.

To simplify, square both sides of this equation:

9x2y2=4.

Now, multiply both sides of the equation by 1 and add 9 to each side:

x2+y2=5.

This equation describes a circle centered at the origin with radius 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. Figure 13.1.7 is a graph of the level curves of this function corresponding to c=0,1,2, and 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.

CNX_Calc_Figure_14_01_008.jpg
Figure 13.1.7: Level curves of the function g(x,y)=9x2y2, using c=0,1,2, and 3(c=3 corresponds to the origin).

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

Example 13.1.4: Making a Contour Map

Given the function f(x,y)=8+8x4y4x2y2, find the level curve corresponding to c=0. Then create a contour map for this function. What are the domain and range of f?

Solution

To find the level curve for c=0, we set f(x,y)=0 and solve. This gives

0=8+8x4y4x2y2.

We then square both sides and multiply both sides of the equation by 1:

4x2+y28x+4y8=0.

Now, we rearrange the terms, putting the x terms together and the y terms together, and add 8 to each side:

4x28x+y2+4y=8.

Next, we group the pairs of terms containing the same variable in parentheses, and factor 4 from the first pair:

4(x22x)+(y2+4y)=8.

Then we complete the square in each pair of parentheses and add the correct value to the right-hand side:

4(x22x+1)+(y2+4y+4)=8+4(1)+4.

Next, we factor the left-hand side and simplify the right-hand side:

4(x1)2+(y+2)2=16.

Last, we divide both sides by 16:

(x1)24+(y+2)216=1.

This equation describes an ellipse centered at (1,2). The graph of this ellipse appears in the following graph.

imageedit_19_2343044549.png
Figure 13.1.8: Level curve of the function f(x,y)=8+8x4y4x2y2 corresponding to c=0

We can repeat the same derivation for values of c less than 4. Then, Equation ??? becomes

4(x1)216c2+(y+2)216c2=1

for an arbitrary value of c.

Setting the function equal to c, we get:

8+8x4y4x2y2=c

We then square both sides and multiply both sides of the equation by 1:

4x2+y28x+4y8=c2.

Now, we rearrange the terms, putting the x terms together and the y terms together, and add 8 to each side:

4x28x+y2+4y=8c2.

Next, we group the pairs of terms containing the same variable in parentheses, and factor 4 from the first pair:

4(x22x)+(y2+4y)=8c2.

Then we complete the square in each pair of parentheses and add the correct value to the right-hand side:

4(x22x+1)+(y2+4y+4)=8c2+4(1)+4.

Next, we factor the left-hand side and simplify the right-hand side:

4(x1)2+(y+2)2=16c2.

Last, we divide both sides by 16c2:

4(x1)216c2+(y+2)216c2=1

Figure 13.1.9 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).

imageedit_22_5058568518.png
Figure 13.1.9: Contour map for the function f(x,y)=8+8x4y4x2y2 using the values c=0,1,2,3, and 4.

Finding the Domain & Range

Since this is a square root function, the radicand must not be negative.  So we have

8+8x4y4x2y20

Recognizing that the boundary of the domain is an ellipse, we repeat the steps we showed above to obtain

(x1)24+(y+2)2161

So the domain of f can be written:  {(x,y)|(x1)24+(y+2)2161}.

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, (x1)24+(y+2)216=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.

f(x,y)=8+8x4y4x2y2=84(x22x)(y2+4y)=84(x22x+11)(y2+4y+44)=84(x22x+1)+4(y2+4y+4)+4=164(x1)2(y+2)2

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)=16=4.

So the range of this function is [0,4].

Exercise 13.1.2

Find and graph the level curve of the function g(x,y)=x2+y26x+2y corresponding to c=15.

Hint

First, set g(x,y)=15 and then complete the square.

Solution

The equation of the level curve can be written as (x3)2+(y+1)2=25, which is a circle with radius 5 centered at (3,1).

imageedit_25_7368210218.png

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 or yz planes.

Definition: Vertical Traces

Consider a function z=f(x,y) with domain DIR2. A vertical trace of the function can be either the set of points that solves the equation f(a,y)=z for a given constant x=a or f(x,b)=z for a given constant y=b.

Example 13.1.5: Finding Vertical Traces

Find vertical traces for the function f(x,y)=sinxcosy corresponding to x=π4,0, and π4, and y=π4,0, and π4.

Solution

First set x=π4 in the equation z=sinxcosy:

z=sin(π4)cosy=2cosy20.7071cosy.

This describes a cosine graph in the plane x=π4. The other values of z appear in the following table.

Vertical Traces Parallel to the xzPlane for the Function f(x,y)=sinxcosy
c Vertical Trace for x=c
π4 z=2cosy2
0 z=0
π4 z=2cosy2

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.

Vertical Traces Parallel to the yz-plane for the Function f(x,y)=sinxcosy
d Vertical Trace for y=d
π4 z=2sinx2
0 z=sinx
π4 z=2sinx2

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=π4,x=0,x=π4 and y=π4,y=0,y=π4 as shown in the following figure.

imageedit_28_9326708123.png
Figure 13.1.10: Vertical traces of the function f(x,y) are cosine curves in the xz-planes (a) and sine curves in the yz-planes (b).

Exercise 13.1.3

Determine the equation of the vertical trace of the function g(x,y)=x2y2+2x+4y1 corresponding to y=3, and describe its graph.

Hint

Set y=3 in the equation z=x2y2+2x+4y1 and complete the square.

Solution

z=3(x1)2. This function describes a parabola opening downward in the plane y=3.

Functions of two variables can produce some striking-looking surfaces. Figure 13.1.11 shows two examples.

CNX_Calc_Figure_14_01_015.jpg
Figure 13.1.11: 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.

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

f(x,y,z)=x22xy+y2+3yzz2+4x2y+3x6a polynomial in three variables

and

g(x,y,t)=(x24xy+y2)sint(3x+5y)cost.

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.

Example 13.1.6: Domains for Functions of Three Variables

Find the domain of each of the following functions:

  1. f(x,y,z)=3x4y+2z9x2y2z2
  2. g(x,y,t)=2t4x2y2

Solution:

a. For the function f(x,y,z)=3x4y+2z9x2y2z2 to be defined (and be a real value), two conditions must hold:

  1. The denominator cannot be zero.
  2. The radicand cannot be negative.

Combining these conditions leads to the inequality

9x2y2z2>0.

Moving the variables to the other side and reversing the inequality gives the domain as

domain(f)={(x,y,z)R3x2+y2+z2<9},

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)=2t4x2y2 to be defined (and be a real value), two conditions must hold:

  1. The radicand cannot be negative.
  2. The denominator cannot be zero.

Since the radicand cannot be negative, this implies 2t40, and therefore that t2. Since the denominator cannot be zero, x2y20, or x2y2, Which can be rewritten as y=±x, which are the equations of two lines passing through the origin. Therefore, the domain of g is

domain(g)={(x,y,t)|y±x,t2}.

Exercise 13.1.4

Find the domain of the function h(x,y,t)=(3t6)y4x2+4.

Hint

Check for values that make radicands negative or denominators equal to zero.

Solution

domain(h)={(x,y,t)R3y4x24}

Functions of two variables have level curves, which are shown as curves in the xyplane. However, when the function has three variables, the curves become surfaces, so we can define level surfaces for functions of three variables.

Definition: Level Surface of a Function 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.

Example 13.1.7: Finding a Level Surface

Find the level surface for the function f(x,y,z)=4x2+9y2z2 corresponding to c=1.

Solution

The level surface is defined by the equation 4x2+9y2z2=1. This equation describes a hyperboloid of one sheet as shown in Figure 13.1.12.

imageedit_31_4198249321.png
Figure 13.1.12: A hyperboloid of one sheet with some of its level surfaces.

Exercise 13.1.5

Find the equation of the level surface of the function

g(x,y,z)=x2+y2+z22x+4y6z

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

Hint

Set g(x,y,z)=c and complete the square.

Solution

(x1)2+(y+2)2+(z3)2=16 describes a sphere of radius 4 centered at the point (1,2,3).

Summary

  • The graph of a function of two variables is a surface in R3 and can be studied using level curves and vertical traces.
  • A set of level curves is called a contour map.

Key Equations

  • Vertical trace

f(a,y)=z for x=a or f(x,b)=z for y=b

  • Level surface of a function of three variables

f(x,y,z)=c

Glossary

contour map
a plot of the various level curves of a given function f(x,y)
function of two variables
a function z=f(x,y) that maps each ordered pair (x,y) in a subset D of R2 to a unique real number z
graph of a function of two variables
a set of ordered triples (x,y,z) that satisfies the equation z=f(x,y) plotted in three-dimensional Cartesian space
level curve of a function of two variables
the set of points satisfying the equation f(x,y)=c for some real number c in the range of f
level surface of a function of three variables
the set of points satisfying the equation f(x,y,z)=c for some real number c in the range of f
surface
the graph of a function of two variables, z=f(x,y)
vertical trace
the set of ordered triples (c,y,z) that solves the equation f(c,y)=z for a given constant x=c or the set of ordered triples (x,d,z) that solves the equation f(x,d)=z for a given constant y=d

Contributors

  • Gilbert Strang (MIT) and Edwin “Jed” Herman (Harvey Mudd) with many contributing authors. This content by OpenStax is licensed with a CC-BY-SA-NC 4.0 license. Download for free at http://cnx.org.


This page titled 13.1: Functions of Multiple Variables is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by OpenStax.

Support Center

How can we help?