Functions of Three or More Variables
Textbook Reference
| Primary source | OpenStax Calculus Volume 3, Section 4.1: “Functions of Several Variables” |
| Direct link | https://openstax.org/books/calculus-volume-3/pages/4-1-functions-of-several-variables |
| Supplementary | Stewart Calculus (9th ed.), Section 14.1: “Functions of Several Variables,” pp. 982-984 (Examples 14, 15, and 16) |
OpenStax Calculus Volume 3 is free and openly licensed; its fourth objective for this section is to recognize a function of three or more variables and identify its level surfaces. The Stewart definition and worked examples cited below appear on pages 982-984.
Why a fourth axis is not available
You already accept that some quantities depend on more than two things. The temperature in a room depends on where you stand, three position numbers, and on the time, a fourth. The cost of a recipe depends on the amount of each ingredient. Nature does not stop at two inputs, so neither does the idea of a function.
The honest difficulty is that a function of three variables $f(x, y, z)$ cannot be graphed: its graph would need a fourth axis for the output, and a four-dimensional space cannot be drawn. So you trade the graph for the trick you just learned with contour maps. Instead of asking what the graph looks like, you ask “where does the function equal a fixed value $k$.” For a three-variable function that set of points is a level surface $f(x, y, z) = k$, a sheet sitting in ordinary three-dimensional space rather than a curve in the plane. Picture peeling the function apart into a family of nested surfaces, one for each value $k$, the way an onion is a family of nested shells. Each shell is something you can draw, even though the whole four-dimensional object is not.
So the move that saves you is the contour-map move, lifted one dimension. You cannot see the graph, but you can see its level surfaces, and that is enough to understand the function.
Prerequisite Check
Before this lesson, make sure you can do all of the following:
If level curves are shaky, review Level Curves and Contour Maps. If domains are shaky, review Domain Restrictions for Functions of Several Variables.
Quick Reference
Definition (three variables). A function of three variables $f$ is a rule that assigns to each ordered triple $(x, y, z)$ in a domain $D \subseteq \mathbb{R}^3$ a unique real number $f(x, y, z)$.
Definition ($n$ variables). A function of $n$ variables is a rule that assigns a number $z = f(x_1, x_2, \dots, x_n)$ to each $n$-tuple $(x_1, \dots, x_n)$ of real numbers. Using a vector $\mathbf{x} = \langle x_1, \dots, x_n \rangle$, one writes $f(\mathbf{x})$.
Why no graph. The graph of $f(x, y, z)$ would live in four-dimensional space (three for the input, one for the output) and cannot be drawn.
Level surfaces. The level surfaces of $f(x, y, z)$ are the surfaces with equation \[ f(x, y, z) = k, \] where $k$ is a constant. On a level surface the value of $f$ stays fixed at $k$. Level surfaces play the role for three-variable functions that level curves play for two-variable functions.
The procedure (flashcard size).
- To find the domain: locate every risky operation and write its condition (root inside $\ge 0$, logarithm argument $> 0$, denominator $\neq 0$); the domain is a region of space.
- To find level surfaces: set $f(x, y, z) = k$ and identify the surface for several values of $k$ (a plane, a sphere, a paraboloid).
Key Concepts
1. The domain of a three-variable function is a region of space
The domain rules do not change; the region now lives in space rather than in the plane.
Example 1. Find the domain of $f(x, y, z) = \ln(z - y) + xy\sin z$.
Goal. Find the only condition and name the region.
Step 1. The term $xy \sin z$ is defined everywhere, so it imposes no condition. The logarithm requires $z - y > 0$, that is, $z > y$.
Step 2. In space, $z > y$ is everything strictly above the plane $z = y$, a half-space.
\[ \boxed{D = \{(x, y, z) \mid z > y\}, \text{ the half-space above the plane } z = y.} \]
Recap. A three-variable domain is a solid region of space, found by the same risky-operation rules used in the plane. (Source: Stewart 14.1, Example 14, p. 982.)
Inline self-check. Why can the function $f(x, y, z)$ in Example 1 not be graphed?
Show answer
Its input already uses three axes ($x$, $y$, $z$), so plotting the output would require a fourth axis. A four-dimensional space cannot be drawn, so we study the function through its level surfaces instead.
2. Level surfaces are concentric spheres for a sum of squares
Example 2. Find the level surfaces of $f(x, y, z) = x^2 + y^2 + z^2$.
Goal. Set the function equal to each constant and identify the surface.
Step 1. Set $x^2 + y^2 + z^2 = k$ with $k \ge 0$.
Step 2. For each $k > 0$ this is a sphere centered at the origin with radius $\sqrt{k}$. As $(x, y, z)$ moves over such a sphere, the value of $f$ stays fixed at $k$.
\[ \boxed{\text{The level surfaces are concentric spheres of radius } \sqrt{k}.} \]
Recap. The function is “distance from the origin, squared,” so its level surfaces are spheres of constant distance, the three-dimensional version of the concentric-circle level curves of $x^2 + y^2$. (Source: Stewart 14.1, Example 15, pp. 982-983.)
3. Level surfaces name the function’s symmetry
Example 3. Describe the level surfaces of $f(x, y, z) = x^2 - y - z^2$.
Goal. Solve $f = k$ for the surface.
Step 1. Set $x^2 - y - z^2 = k$, that is, $y = x^2 - z^2 - k$.
Step 2. For each $k$ this is a hyperbolic paraboloid (a saddle-shaped surface). Changing $k$ slides the saddle along the $y$-axis.
\[ \boxed{\text{The level surfaces are a family of hyperbolic paraboloids (saddles).}} \]
Recap. The algebraic form of the equation names the surface; a sum of three squares gives spheres, while a mixed-sign combination gives saddles. Reading the level surfaces is how the geometry of a function you cannot graph is recovered. (Source: Stewart 14.1, Example 16, p. 983.)
4. Functions of any number of variables and vector notation
The idea does not stop at three. A function of $n$ variables assigns a number to each $n$-tuple $(x_1, x_2, \dots, x_n)$. For example, if a product uses $n$ ingredients at costs $c_1, \dots, c_n$ per unit and quantities $x_1, \dots, x_n$, the total cost is \[ C = f(x_1, \dots, x_n) = c_1 x_1 + c_2 x_2 + \cdots + c_n x_n. \] Writing $\mathbf{x} = \langle x_1, \dots, x_n \rangle$ and $\mathbf{c} = \langle c_1, \dots, c_n \rangle$, this compresses to a dot product $f(\mathbf{x}) = \mathbf{c} \cdot \mathbf{x}$. A function on $\mathbb{R}^n$ can be viewed three equivalent ways: as a function of $n$ real variables, as a function of a single point, or as a function of a single vector. (Source: Stewart 14.1, pp. 983-984.)
Recap. Two variables was not a special case; it was the first case past one. The same definition runs to any number of inputs, and vector notation keeps it compact.
Common Errors Summary
| Error | Example | Correction |
|---|---|---|
| Trying to graph $f(x, y, z)$ | attempting a surface for a three-input function | A three-input function has no drawable graph; use level surfaces |
| Confusing a level surface with a level curve | calling $f(x,y,z)=k$ a curve | $f(x, y, z) = k$ is a surface in space; $f(x, y) = k$ is a curve in the plane |
| Forgetting the domain is now a solid region | describing $z > y$ as a curve | It is a half-space, a solid region of three-dimensional space |
| Allowing $k$ that the function cannot reach | a level surface $x^2 + y^2 + z^2 = -1$ | A sum of squares is never negative, so $k$ must be $\ge 0$ |
| Thinking more variables means new rules | re-deriving the domain rules for three inputs | The root, logarithm, and denominator rules are unchanged; only the dimension grows |
Common Misconceptions
a function of three variables has a graph that can be drawn in 3D space.
This is the iconic-graph error. The graph of $f(x, y, z)$ would require a fourth axis for the output value $w = f(x,y,z)$, placing it in four-dimensional space, which cannot be visualized directly. The substitute tool is the level surface $f(x, y, z) = k$, a two-dimensional surface in ordinary 3D space. Level surfaces play for three-variable functions the same role that level curves play for two-variable functions.
Leveled Practice
Work each problem fully before revealing the answer.
Level 1 -- Direct Application
Problem 1. Evaluate $f(x, y, z) = x - \sqrt{y - z^2}$ at $(3, 4, 1)$.
Show answer
$f(3, 4, 1) = 3 - \sqrt{4 - 1^2} = 3 - \sqrt{3}$.
Problem 2. Find the domain of $f(x, y, z) = x - \sqrt{y - z^2}$.
Show answer
The square root requires $y - z^2 \ge 0$, that is, $y \ge z^2$.
\[ D = \{(x, y, z) \mid y \ge z^2\}. \]
(There is no condition on $x$, so $x$ is free.) The region is the solid lying on the far side of the parabolic sheet $y = z^2$, for every value of $x$.
Problem 3. What are the level surfaces of $f(x, y, z) = x + y + z$?
Show answer
Set $x + y + z = k$. For each $k$ this is a plane. The level surfaces are a family of parallel planes.
Level 2 -- Level Surfaces
Problem 4. Describe the level surfaces of $f(x, y, z) = x^2 + y^2 + z^2$ for $k = 1, 4, 9$.
Show answer
Set $x^2 + y^2 + z^2 = k$, spheres of radius $\sqrt{k}$ centered at the origin:
$k = 1$: radius $1$. $k = 4$: radius $2$. $k = 9$: radius $3$.
Concentric spheres growing with $k$.
Problem 5. Find the domain of $f(x, y, z) = \ln(16 - 4x^2 - 4y^2 - z^2)$.
Show answer
The logarithm needs a positive argument: $16 - 4x^2 - 4y^2 - z^2 > 0$, that is, $4x^2 + 4y^2 + z^2 < 16$.
\[ D = \{(x, y, z) \mid 4x^2 + 4y^2 + z^2 < 16\}. \]
This is the solid interior of an ellipsoid, boundary excluded.
Level 3 -- Interpretation and Higher Dimensions
Problem 6. A function of four variables gives the cost of a product made from four ingredients used in amounts $x_1, x_2, x_3, x_4$ at unit costs $2, 3, 5, 4$ dollars. Write the cost function, in both coordinate and vector form, and give its domain in context.
Show answer
Coordinate form: \[ C(x_1, x_2, x_3, x_4) = 2x_1 + 3x_2 + 5x_3 + 4x_4. \]
Vector form: with $\mathbf{c} = \langle 2, 3, 5, 4 \rangle$ and $\mathbf{x} = \langle x_1, x_2, x_3, x_4 \rangle$, \[ C(\mathbf{x}) = \mathbf{c} \cdot \mathbf{x}. \]
Domain in context: amounts of ingredients cannot be negative, so $D = \{(x_1, x_2, x_3, x_4) \mid x_i \ge 0 \text{ for each } i\}$.
This shows the same definition working at four inputs, with vector notation keeping it compact. (Based on Stewart 14.1, Exercise 22 generalized.)
Mastery Checklist
You have mastered this skill when you can, without notes:
Mental Model
Think of the level surfaces of $f(x, y, z)$ as the nested shells of an onion.
You cannot see the four-dimensional graph, so picture instead all the points in ordinary space where the function takes one fixed value. For $f = $ distance-squared from the origin, those points form a sphere; let the value grow and the sphere grows, so the function is recorded as a family of nested spherical shells filling space. Each shell carries one value $k$, and the function is recorded in the way the value changes as you pass from one shell to the next.
This is the same trick as a contour map, raised by one dimension. A contour map flattens a surface into labeled curves on a page; level surfaces record an undrawable four-dimensional object as labeled surfaces in space. Where the shells are packed close together the function changes quickly; where they spread apart it changes slowly. Reading the shells is how you understand a function whose graph you can never draw.
Connections
Built from
- Functions of Two Variables: The definition extends directly; two inputs was the first case past one, and three is the next.
- Level Curves and Contour Maps: Level surfaces are the one-dimension-up version of level curves, the same recording trick applied to a function you cannot graph.
Leads to
- Limits of Multivariable Functions: Once functions of several variables are defined, the next question is how they behave as the input approaches a point.
- Partial Derivatives: The differentiation methods in this chapter apply to functions of any number of variables, not just two.
Where these functions appear
Most real models depend on more than two inputs, so functions of three or more variables are the working case, not the exception. A scalar field in physics, such as temperature or electric potential, is a function of three space variables, and its level surfaces are isothermal or equipotential surfaces. In data science a model is a function of many input features, and the level sets of a loss function over those features are the surfaces an optimizer navigates. The dot-product form $f(\mathbf{x}) = \mathbf{c} \cdot \mathbf{x}$ for a linear function of many variables is the entry point to linear algebra and to the gradient as a vector of partial derivatives, which is the central object of the rest of this chapter.
Audience Notes
For students who find math intimidating: You do not have to picture four dimensions. The lesson is built precisely so you never have to: you study a function of three variables by looking at ordinary surfaces in space, one for each value, exactly like reading a contour map.
For students who want depth: A level set $\{f = k\}$ of a smooth function of three variables is, where the gradient is nonzero, a smooth surface of dimension two, an example of the general fact that a level set of a function from $\mathbb{R}^n$ to $\mathbb{R}$ is generically a hypersurface of dimension $n - 1$. The gradient is everywhere normal to the level surface, which is the geometric foundation for directional derivatives, tangent planes to level surfaces, and Lagrange multipliers later in the chapter.
Back to MATH241 Skills | Previous: Level Curves and Contour Maps | Next: Limits of Multivariable Functions