In this chapter, we have primarily worked with functions of two variables including understanding graphs of the form \(z=f(x,y)\) and measuring change with functions of two variables. In this section, we explore how many of the tools we have developed for understanding two-variable functions can be generalized to functions of three or more variables.
A significant impediment to expanding the ideas in this chapter to functions of three or more variables will be that is it difficult (or impossible) to draw plots of these functions, which means we must rely on simplifications or analogies to understand these measurements geometrically. For this reason, most efforts to understand functions of three or more variables is algebraically-focused.
For a constant \(k\) and a function \(f\text{,}\) the level set is the set of points \(P\) for which \(f(P)=k\text{.}\) The remainder of this Preview Activity asks you to consider level sets of some functions of three variables. We use the term “level set” here because the set of inputs for a function of three or more variables that gives a particular output value will likely not be a curve.
State the equation and shape of the level sets for the function \(g(x,y,z)=x^2+y^2-z^2\) for \(-2,-1,0,1,2\text{.}\) These level set values should give three different types of surfaces.
In this section, we will often use the idea of level sets to explore functions of three or more variables. The topics we explore are not likely to surprise you: domain and range, graphs, limits, and rates of change.
Subsection11.8.2Inputs and Outputs with Functions of Three or More Variables
A function is a rule that assigns an single output for each allowed input. For instance, your school likely uses a function that takes your student ID number as an input and outputs your name. While you may not be the only student at your school with your name, this function should not associate more than one name with each student ID number. A function of \(n\) variables can be thought of as taking points in \(\R^n\) as input and outputing a real number for each valid input.
Recall from Definition 11.1.2 that the domain of a function is the set of input values for which a function is defined. The range of a function is the set of values actually output by the function.
Consider the function \(g(x,y,z)= \sqrt{1-x}+e^{y^2+z^2}\text{.}\) We see here that we need \(\sqrt{1-x}\) to be defined, which requires that \(1-x\geq 0\) or \(x\leq 1\text{.}\) However, there is is no restriction on the values of \(y\) or \(z\text{.}\) Thus, we can say that the domain of \(g\) is all points \((x,y,z)\) for which \(x\leq 1\text{.}\) You may be tempted to say the range of \(g\) is all real numbers since \(g\) outputs scalars. However, a closer look shows that \(g\) cannot output negative numbers. Since the outputs of the exponential portion of \(g\) is always positive and the square root portion is always nonnegative, the range of \(g\) is the interval \((0,\infty)\text{.}\)
Subsection11.8.3Visualizing Functions of Three or More Variables
Given a function \(f\) of several variables the level set of \(f\) at the value \(k\) is the collection of input points \(P\) for which \(f(P)=k\text{.}\) A level set is a subset of the domain of the function \(f\) because the level set is a collection of input points.
If \(f(x,y)\) is a function of two variables, then a level set is a contour or a level curve of the form \(f(x,y)=k\text{.}\) Notice that the level set in this case is a set of points in the \(xy\)-plane. As we saw in Section 11.1, we can make a contour plot by graphing a collection of these level curves on the same two-dimensional plot, which will give us an idea of what the surface corresponding to \(z=f(x,y)\) looks like. In other words, we were able to give enough information in a two-dimensional plot to describe a three-dimensional surface.
If \(g(x,y,z)\) is a function of three variables, then a graph of \(g\) function would require four dimensions: three dimensions for the inputs and one dimension for the output. Drawing plots in three dimensions is challenging, but we will use three-dimensional graphs to understand functions of three variables rather than attempting to visualize four-dimensional graphs directly. We will do this by generalizing our approach of using contour plots to express a three-dimensional plot in a two-dimensional setting. Specifically, we will use level sets of \(g(x,y,z)\) to understand a graph of \(w=g(x,y,z)\) and help measure change in the output of \(g\text{.}\)
A level set of \(g\) is a collection of points in \(xyz\)-space that corresponds to a surface of the form \(g(x,y,z)=k\text{.}\) As you saw in Preview Activity 11.8.1, the level sets of a function of three variables are often surfaces, which we call level surfaces. For example, if \(g(x,y,z)=x^2+y^2+z^2\text{,}\) then the level surface corresponding to the value \(1\) is all points that satisfy the equation \(x^2+y^2+z^2=1\text{.}\) This set of points forms the sphere of radius \(1\) centered at the origin.
These level surfaces will often be a different kind of surface than we have been working with throughout Chapter 11. Surfaces of the form \(z=f(x,y)\) are called explicit surfaces because one of the coordinates can be solved explicitly as a function of the other coordinates. Surfaces such as spheres or hyperboloids are not explicit surfaces because there is no way to solve for one variable as a function of the other coordinates. Two perspectives from which you can recognize that are first that these surfaces fail the vertical line test in \(\R^3\) and algebraically, the \(\pm\) that comes from needing to take square roots prevents this for many quadric surfaces.
Surfaces like spheres and hyperboloids are called implicit surfaces because they can be described as the set of points that satisfy an implicit equation. For instance, a hyperboloid of one sheet can be described by an equation of the form
This insight goes the other way as well. Any implicit surface can be thought of as a level set for some function of three variables. If \(S_1\) is the surface described by \(x^2-xyz=y^2 z^3-2\text{,}\) then we can also think of \(S_1\) as the level set of the three-variable function \(F(x,y,z)=x^2-xyz-y^2 z^3\) for the output value \(-2\) because any point in three dimensions that satisfies \(x^2-xyz=y^2 z^3-2\) must also satisfy \(x^2-xyz-y^2 z^3=-2\text{.}\)
Analogous to how a two-dimensional contour plot provides useful information about the corresponding three-dimensional surface plot, we would like to see if we can graph multiple level sets of a three variable function to understand the four-dimensional graph of a function of the form \(w=g(x,y,z)\text{.}\) In this example, we will work with the three-variable function \(g(x,y,z)=x^2+y^2-z^2\text{.}\)
If we consider the level sets corresponding to the values \(k=\{-4,-1,0,1,4\}\text{,}\) we get the following level surfaces:
If \(k=-4\text{,}\) then we are looking at the implicit equation \(x^2+y^2-z^2=-4\) which corresponds to a hyperboloid of two-sheets given by \(\frac{z^2}{4}-\frac{x^2}{4}-\frac{y^2}{4}=1 \text{.}\)
If \(k=-1\text{,}\) then we are looking at the implicit equation \(x^2+y^2-z^2=-1\) which corresponds to a hyperboloid of two-sheets given by \(z^2-x^2-y^2=1 \text{.}\)
If \(k=1\text{,}\) then we are looking at the implicit equation \(x^2+y^2-z^2=1\) which corresponds to a hyperboloid of one-sheet given by \(x^2+y^2-z^2=1 \text{.}\)
If \(k=4\text{,}\) then we are looking at the implicit equation \(x^2+y^2-z^2=-4\) which corresponds to a hyperboloid of one-sheet given by \(\frac{x^2}{4}+\frac{y^2}{4}-\frac{z^2}{4}=1 \text{.}\)
We can plot these level sets together to create the analogous plot to a contour plot. Figure 11.8.3 shows a graph of these surfaces with colors that go from red (at \(k=-4\)) to blue (at \(k=4\)). You can see how a three-dimensional plot of multiple level sets gets visually cluttered very quickly, but you can see how the output of \(g\) increases as you move away from the \(z\)-axis or if you move closer to the \(xy\)-plane. Later in this section, we will explore how these level surfaces are related to questions such as “In what direction will the output of \(g\) have the greatest rate of increase?”
While the plot of multiple level surfaces may be a bit overwhelming, we can show each of these level sets in a separate plot. Figure 11.8.4 plots a level surface for the value given by the slider at the top. Use the slider to change the value of \(k\) over the entire range from \(-4\) to \(4\text{.}\) As you do so, look at how the shape of the corresponding level surface morphs from a hyperboloid of two sheets to a cone to a hyperbola of one sheet.
Figure 11.8.4 may look like a three-dimensional plot, but we really have a four-dimensional plot with slider providing the axis for the fourth dimension. We saw a similar case in Figure 10.1.3 where the plot of \(\vr(t)\) was a four dimensional idea. In that plot, one dimension was the input changing, with the \(t\)-axis for the slider. The other three dimensions were represented by the vector \(\vr\) in standard position, which we can also think of as being a plot of the vector’s terminal point. With vector-valued functions of one variables, we simplified the four-dimensional plot to include all of the three-dimensional outputs, frequently ignoring plotting how those outputs depended on the value of the parameter \(t\text{.}\)
In this activity, we will look at level surfaces created by two three-variable functions and consider the direction in which the output is increasing or decreasing as fast as possible.
Write a couple of sentences to describe shape and characteristics will the level surfaces of \(f\text{.}\) Be sure to include all possibilities for different types of level surfaces. Compare what is the same or different about these level surfaces and relate the differences to the level value, \(k\text{.}\)
If you are at the point \((1,1,-1)\text{,}\) in what direction should you change the input of \(f\) to see the greatest increase in the output of \(f\text{?}\) You should think about how a change in each variable will change the output of \(f\) and talk about this in your reasoning.
Write a couple of sentences to describe shape and characteristics will the level surfaces of \(g\text{.}\) Be sure to include all possibilities for different types of level surfaces. Compare what is the same or different about these level surfaces and relate the differences to the level value, \(k\text{.}\)
If you at the point \((2,0,-2)\text{,}\) in what direction should you change the input of \(g\) to see the greatest increase in the output of \(g\text{?}\) You should think about how a change in each variable will change the output of \(g\) and talk about this in your reasoning.
Subsection11.8.4Measuring Change with Functions of Three or More Variables
Conceptually, limits for functions of three or more variables work the same as for functions of two variables. Given a function \(f\text{,}\) we say that \(f\) has limit \(L\) as the inputs approach \(P_0\) provided that we can make \(f(P)\) as close to \(L\) as we like by taking \(P\) sufficiently close (but not equal) to \(P_0\text{.}\) We write
If the limit of a function \(f\) along every path through an input point \(P_0\) exists and all of those limits are the same value \(L\) then we say the limit of \(f\) at \(P\) is \(L\text{.}\) There is not much more insight into limits of multivariable functions to be had at this point, so we will move on to measuring the change in output of our multivariable functions of three or more variables.
The partial derivative of a multivariable function measures the rate of change in the output of the function when one variable is changed and all others are held constant. Our definition and notation of partial derivatives given for functions of two variables only needs to be updated to account for three or more input variables.
If we consider \(T(x,y,z,t)\) to be a function that measures the air temperature at a location with spatial coordinates \((x,y,z)\) at time \(t\text{,}\) then we have four first partial derivatives:
This partial derivative measures the instantaneous rate of change in temperature with respect to time at the location \((x_0,y_0,z_0)\) at time \(t=t_0\text{.}\)
measure the rate of change with respect to time of \(T_y\text{.}\) This function has sixteen second partial derivatives: four unmixed partials and 12 mixed partials.
Clairaut’s Theorem also generalizes to higher dimensions: if all mixed partials are continuous near an input point of a function of three or more variables, then the mixed partials at that point are equal.
In Section 11.5, we saw how the ideas of locally linear functions and differentiability meant that for small scales, the change in the output of a function could be expressed as a linear combination of the changes in each variable separately. This connected to the idea that the linearization of a function approximates the original function well for small neighborhoods around the point at which the linearization was created. We visualized this linearization with the tangent plane and saw that geometrically speaking, the tangent plane was a good approximation for the surface at small scales.
Unfortunately, we will not be able to use this kind of visualization for functions of three or more variables because our graphing techniques are limited to looking at plots of level surfaces. However, we can use linearizations to approximate the change in functions of three or more variables. For example, if \(T\) is the four-variable function of Example 11.8.5, then the linearization of this function at location \((a,b,c)\) and time \(t=d\) is
Notice this is the same form as we have used for all of our linear ideas: the change in the output is a linear combination of the changes with respect to a change in a single input variable, while holding all other inputs constant.
We can easily generalize related ideas like the differential to functions of three or more variables. The differential for the temperature function is given by
Other important ideas, like the classic calculus approach or our interpretation of the gradient, did not depend on using a function of two variables, so we can adapt these arguments and results to higher dimensional cases as well. Again, the downside to this abstraction is that we do not have the geometric tools to help us interpret and understand these measurements in higher dimensions.
Subsection11.8.5Directional Derivatives and Gradients
Directional derivatives and gradients for functions of three or more variables are critical concepts, both in this course and in future coursework in math, economics, and the physical sciences. Recall that the directional derivative measures the instantaneous rate of change of a multivariable function when the inputs are changed in a particular direction. None of the arguments in Section 11.7 were specific to functions of two variables, but rather than stating these results in terms of an abstract function of \(n\) variables, we will illustrate the various definitions and results in terms of functions of three or four variables: \(f(x,y,z)\) or \(g(x,y,z,w)\text{.}\)
Let \(f = f(x,y,z)\) be a function of three variables. The derivative of \(f\) at the point \((x,y,z)\) in the direction of the unit vector \(\vu = \langle u_1, u_2 , u_3 \rangle\) is denoted \(D_{\vu}f(x,y,z)\) and is given by
for those values of \(x\text{,}\)\(y\text{,}\) and \(z\) for which the limit exists. We can make a similar limit definition for a function of more than three variables because we are able to separate the length of the step in a particular direction (\(t\) in the above statement) and the unit vector in that particular direction (\(\vu\) from above) for vectors with any number of components.
We can calculate the directional derivative in terms of partial derivatives of the function and \(\vu\text{.}\) This result comes from using the chain rule on a composition of the multivariable function with the line in the direction of \(\vu\text{.}\) If \(f(x,y,z)\) and \(g(x,y,z,w)\) are functions of three and four variables, respectively, then
Remember that the direction vector will have as many components as there are inputs to the function because the direction vector corresponds to a change in the inputs of the function.
This generalization shows that in any dimension, the directional derivative can be calculated as the dot product of the gradient and the direction vector.
This also means that all of our work to understand the meaning of the gradient will generalize to any dimension as well. In particular, we update our summary of the meaning of the gradient below.
The gradient \(\nabla f(P)\) points in the direction of greatest rate of increase for \(f\) at \(P\text{,}\) and the instantaneous rate of change of \(f\) in that direction is the length of the gradient vector.
If \(\vu = \frac{1}{\vecmag{\nabla f(P)}} \nabla f(P)\text{,}\) then \(\vu\) is a unit vector in the direction of greatest increase of \(f\) at \(P\text{,}\) and \(D_{\vu} f(P) = \vecmag{\nabla f(P)}\text{.}\)
The gradient \(\nabla f(P)\) points in the opposite direction of greatest rate of decrease for \(f\) at \((P)\text{,}\) and the instantaneous rate of change of \(f\) in that direction is the length of the gradient vector times \(-1\text{.}\)
If \(\vu = -\frac{1}{\vecmag{\nabla f(P)}} \nabla f(P)\text{,}\) then \(\vu\) is a unit vector in the direction of greatest decrease of \(f\) at \((P)\text{,}\) and \(D_{\vu} f(P) = -\vecmag{\nabla f(P)}\text{.}\)
The first idea above is useful when finding an equation for the plane tangent to an implicit surface. Let \(P_1\) be a point on \(S_1\text{,}\) an implicit surface given by \(F(P)=k\text{.}\) The tools of Section 11.5 will not work because our surface is not of the form \(z=f(x,y)\text{.}\) Because \(\nabla F(P_1)\) is perpendicular to the surface \(S_1\text{,}\)\(\nabla F(P_1)\) is a normal vector for the tangent plane at \(P_1\text{.}\) This leads to the following key idea.
Let \(S_1\) be an implicit surface given by \(F(x,y,z)=k\) and let \(P_0=(x_0,y_0,z_0)\) be a point on \(S_1\text{.}\) The tangent plane to \(S_1\) at \(P_0\) is given by
By Equations of a plane we need to find a normal vector for the plane and a point on the plane. The point \(P_0=(x_0,y_0,z_0)\) is the location where the tangent plane will be tangent to \(S_1\text{.}\) Thus, we only need to find a normal vector for the plane. By the interpretation of the gradient above, \(\nabla F (P_0)= \langle \frac{\partial F}{\partial x}(P_0), \frac{\partial F}{\partial y}(P_0), \frac{\partial F}{\partial z}(P_0)\rangle\) is perpendicular to \(S_1\) because this is a level surface. Therefore,
This example examines the function \(f(x,y,z)=x^2+y^2+z^2\) and the meaning of its gradient \(\nabla f = \langle 2x,2y,2z\rangle \text{.}\) In order to visualize the graph of \(f\) we can look at a level surface given by \(f(x,y,z)=k\text{.}\)Figure 11.8.8 shows a plot of the level surface for a value of \(k\text{.}\) Note that the level surfaces of \(f\) are spheres of radius \(R=\sqrt{k}\) centered at the origin. Move the slider at the top of Figure 11.8.8 to change the value of \(k\text{.}\) This illustrates how the scale of the level surface changes but the shape does not.
Use the checkbox in Figure 11.8.8 to show the gradient vector plotted at a collection of points on the level surface. If you turn on the gradient vectors, you can see that the gradient vector is perpendicular to the level surface and this relationship is true regardless of what value of \(k\) is used for the level surface. Two other properties should be noticed as well. First, the gradient always points out of the sphere (in the direction opposite the origin). Second, the length of the gradient increases as \(k\) increases.
The function \(f\) takes a point \((x,y,z)\) as input and outputs the square of the distance to this point from the origin. This means that \(f\) increases as the point considered moves away from the origin, but the direction of greatest increase is to move directly away from the origin. The rate of increase of \(f\) also increases as the point gets farther from the origin. Both of these ideas are demonstrated in Figure 11.8.8 by the red gradient vectors. Specifically, you can see that length of the gradient vectors increases as you increase \(k\) and the direction of the gradient vectors is always perpendicular to the level surface/sphere. You can also reason that the direction for greatest decrease in \(f\) will be in the direction going toward the origin.
We can verify Key Idea 11.8.6 by looking at tangent points for a few points on these spheres as level surfaces. Let \(S_1\) be the level surface with value 1, \(1=f(x,y,z)=x^2+y^2+z^2\text{.}\) Note that \(P_0=(0,-1,0)\) is on \(S_1\) and \(\nabla f(P_0)=\langle 0,-2,0\rangle\text{.}\) By Key Idea 11.8.6, the tangent plane to \(S_1\) at \(P_0\) is given by
If we consider the point \(P_1=(\frac{\sqrt{2}}{2},0,-\frac{\sqrt{2}}{2}) \text{,}\) which his also on \(S_1\text{,}\) we can apply the same argument. Note that \(\nabla f(P_1)=\langle \sqrt{2},0,-\sqrt{2}\rangle\text{,}\) which means that the tangent plane has equation
Suppose we wish to find an equation for the tangent plane to the hyperboloid of one sheet with equation \(x^2+y^2-z^2 = 1\) at the point \((-1,0,1)\text{.}\) Because this is an implicit surface for which we cannot solve for \(z\) as a function of \(x\) and \(y\text{,}\) the techniques we developed in Section 11.5 do not apply directly. However, we can use the gradient vector as we did in the previous example. To do so, we recognize that the surface is a level surface of the three-variable function \(g(x,y,z) = x^2+y^2-z^2\) for the value \(1\text{.}\) Thus, we know that the gradient vector for \(g\) at the point \((-1,0,1)\) is normal to the surface at that point and can be used as the normal vector for the tangent plane.
We can compute \(\nabla g = \langle 2x,2y,-2z\rangle \text{,}\) which tells us that \(\nabla g(-1,0,1) = \langle -2,0,-2\rangle\) is normal to the hyperboloid of one sheet at \((-1,0,1)\text{.}\) Thus, we can write an equation for the tangent plane to this surface at this point as
A particularly nice aspect of the approach of viewing surfaces in three-dimensional space as level surfaces of functions of three variables is that the method does not change even as the surface changes. To continue with the function \(g\) from the previous part, we saw in Example 11.8.2 that different values of \(k\) for the level surfaces gives rise to different types of surfaces. In particular,
if \(k\lt 0\text{,}\) the level surface is a hyperboloid of two sheets (as we saw in the previous part),
Even as the type of surface changes, the gradient’s algebraic form \(\nabla g = \langle 2x,2y,-2z\rangle \) does not change. If you select the checkbox in Figure 11.8.11 to plot gradient vectors at points along the level surface, you will see that the gradient vectors are perpendicular to the level surface. Use the slider to change the value of the level surface, which changes the shape of the level surface when the sign of \(k\) changes.
To see this in action, we can find a general way to express the tangent plane at a point on these level surfaces. Let \(S_k\) be the level surface with value \(k\text{.}\) In other words, \(g(x,y,z)=k=x^2+y^2-z^2\text{.}\) Let \(P_k=(-1,1,\sqrt{2-k})\) be a point, which you can verify for yourself is on \(S_k\text{.}\) This means that \(\nabla g(P_k)=\langle -2,2,-2\sqrt{2-k}\rangle\text{.}\) Hence by Key Idea 11.8.6, the tangent plane to \(S_k\) at \(P_k\) can be written as
This point, the gradient vector (drawn at half length), and tangent plane are shown in red in Figure 11.8.12. Use the slider to change the value of \(k\) using the slider at the top of Figure 11.8.12 to see how even though the shape of the level surface changes, the gradient vector at \(P_k\) remains orthogonal to the surface and will serves as a normal vector for our tangent plane.
Sketch the level surfaces of \(f\) for the values \(k=\{-2,-1,0,1,2\}\text{.}\) Write a few sentences about the shape of each of these level surfaces and describe how the level surfaces change in terms of the value of \(k\text{.}\)
Sketch the level surfaces of \(g\) for the values \(k=\{-2,-1,0,1,2\}\text{.}\) Write a few sentences about the shape of each of these level surfaces and describe how the level surfaces change in terms of the value of \(k\text{.}\) You may find it helpful to notice that each of the level surfaces can be expressed with \(z\) as a function of \(x\) and \(y\text{.}\)
The level surfaces of the function \(g(x)=z-x^2-y^2\) from the previous activity were of the form \(z=x^2+y^2+C\) for some constant \(C\text{.}\) This means that the gradient of \(g\) gives a convenient way to calculate a vector perpendicular to the surface \(z=x^2+y^2+C\text{.}\) In fact, for any surface of the form \(z=h(x,y)\text{,}\) the same surface will be a level surface of the three variable function \(g(x,y,z)=z-h(x,y)\text{.}\)
The set of points \((x,y,z)\) for which a function of three variables, \(f(x,y,z)\text{,}\) has a constant output, \(k\text{,}\) is called the level surface and a implicit equation of the level surface is \(f(x,y,z)=k\text{.}\)
The partial derivatives for functions of functions three or more variables are calculated by measuring the rate of change in one input variable while holding all other inputs constant. The gradient of a function of three or more variables is a vector-valued, multivariable function where each component is the first partial derivative of with respect to a different coordinate. If \(g(x_1,x_2, \ldots,x_n)\text{,}\) then the gradient of \(g\) has \(n\) components and is given by \(\nabla g = \left\langle \frac{\partial g}{\partial x_1}, \frac{\partial g}{\partial x_2},\ldots,\frac{\partial g}{\partial x_m}\right\rangle\text{.}\)
The directional derivative of a function of three or more variables measures the rate of change of the output when the input variables are changed in a particular direction and can be calculated by \(Dg_{\vu}(P)=\nabla g(P) \cdot \vu\text{.}\)
The gradient of a multivariable function \(g\) at an input \(P\) points in the direction of greatest rate of increase for the output of \(g\text{,}\) which also means that the gradient at \(P\text{,}\)\(\nabla g(P)\) will be perpendicular to the level surface corresponding to the value \(k=g(P)\text{.}\) The direction opposite of the gradient, \(-\nabla g (P)\text{,}\) will be the direction of greatest rate of decrease at \(P\text{.}\) The greatest rate of increase and decrease are \(\vecmag{\nabla g(P)}\) and \(-\vecmag{\nabla g(P)}\text{,}\) respectively.
Your monthly car payment in dollars is \(P = f(P_0,t,r)\text{,}\) where $\(P_0\) is the amount you borrowed, \(t\) is the number of months it takes to pay off the loan, and \(r\) percent is the interest rate.
(For this problem, write our your units in full, writing dollars for $, months for months, percent for %, etc. Note that fractional units generally have a plural numerator and singular denominator.)
(For this problem, write our your units in full, writing dollars for $, months for months, percent for %, etc. Note that fractional units generally have a plural numerator and singular denominator.)