Functions of Two 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. 972-975 |
OpenStax Calculus Volume 3 is free and openly licensed; its first objective for this section is to recognize a function of two variables and identify its domain and range. The Stewart definition and worked examples cited below appear on pages 972-975.
Key idea
You already meet two-variable relationships every day, even if no one called them functions. The temperature outside depends on both where you are and what time it is. The volume of a soda can depends on both its radius and its height: $V = \pi r^2 h$. In each case one output is decided by two inputs working together. A function of two variables just gives that idea a name and a notation.
Picture the input not as a single slider but as a single dot placed on a flat floor, the $xy$-plane. The two numbers $(x, y)$ are the dot’s address. The function is a rule that reads the address and returns one number, written $z = f(x, y)$. Before any graph or surface, hold this picture: a rule that turns a point on the floor into a single height. Everything in this section, the domain, the graph, the level curves, is a different way of looking at that one rule.
So a function of two variables is not a strange new object. It is the familiar idea “output depends on input” with the input upgraded from one number to a pair.
Prerequisite Check
Before this lesson, make sure you can do all of the following:
If domains or regions are shaky, review Domain Restrictions for Functions of Several Variables and Regions, Lines, and Circles in the Plane.
Quick Reference
Definition. A function of two variables is a rule that assigns to each ordered pair $(x, y)$ in a set $D$ a unique real number, denoted $f(x, y)$. The set $D$ is the domain (the allowed input pairs); the range is the set of values $f$ takes (the outputs it produces).
We often write $z = f(x, y)$. Here $x$ and $y$ are the independent variables (the inputs you choose) and $z$ is the dependent variable (the output you read off). The domain is a subset of $\mathbb{R}^2$ (the plane of input pairs); the range is a subset of $\mathbb{R}$ (a set of single numbers).
Four ways to present a function (Stewart lists these at the start of the section): verbally (a description in words), numerically (a table of values), algebraically (a formula), and visually (a graph or level curves).
Domain rule when none is stated. If a function is given by a formula with no domain specified, its domain is the set of all pairs $(x, y)$ for which the formula produces a real number.
The procedure for evaluating and finding a domain (flashcard size).
- To evaluate $f(a, b)$: substitute $x = a$ and $y = b$ into the formula and simplify.
- To find the domain: locate every square root, logarithm, and denominator, write the matching condition for each, and combine with “and.”
- To find the range: ask what output values are reachable as $(x, y)$ ranges over the domain.
Key Concepts
1. Evaluating a function of two variables
Evaluating is pure substitution: replace $x$ and $y$ with the two given numbers.
Example 1. For $f(x, y) = \dfrac{\sqrt{x + y + 1}}{x - 1}$, evaluate $f(3, 2)$ and find the domain.
Goal. Substitute for the value, then read the domain off the risky operations.
Step 1 (value). Put $x = 3$, $y = 2$: \[ f(3, 2) = \frac{\sqrt{3 + 2 + 1}}{3 - 1} = \frac{\sqrt{6}}{2}. \]
Step 2 (domain). The square root requires $x + y + 1 \ge 0$; the denominator requires $x - 1 \neq 0$, that is, $x \neq 1$. Combine: \[ \boxed{f(3,2) = \frac{\sqrt{6}}{2}, \qquad D = \{(x, y) \mid x + y + 1 \ge 0, \; x \neq 1\}.} \]
Recap. Evaluation is substitution; the domain is the region on and above the line $y = -x - 1$ with the vertical line $x = 1$ removed. (Source: Stewart 14.1, Example 1, p. 972.)
2. Finding the domain and range together
Example 2. Find the domain and range of $g(x, y) = \sqrt{9 - x^2 - y^2}$.
Goal. Get the domain from the square root, then reason about which outputs are possible.
Step 1 (domain). Require $9 - x^2 - y^2 \ge 0$, that is, $x^2 + y^2 \le 9$, the closed disk of radius $3$ centered at the origin.
Step 2 (range). Since the output is a square root, $z \ge 0$. Because $9 - x^2 - y^2 \le 9$ on the domain, $z = \sqrt{9 - x^2 - y^2} \le 3$. Both extremes are reached: $z = 3$ at the origin and $z = 0$ on the boundary circle. So the range is $[0, 3]$.
\[ \boxed{D = \{(x, y) \mid x^2 + y^2 \le 9\}, \qquad \text{range} = [0, 3].} \]
Recap. The domain is a region in the plane; the range is a set of single numbers. (A common error is to swap them and call $[0, 3]$ the domain; the domain is the disk of inputs, the range is the interval of outputs.) (Source: Stewart 14.1, Example 2, p. 973.)
Inline self-check. What is the domain of $h(x, y) = \ln(x + y)$?
Show answer
A logarithm requires a positive argument, so $x + y > 0$, that is, $y > -x$. The domain is the open half-plane above the line $y = -x$, boundary excluded.
3. A function can be given by a table, not a formula
Not every function of two variables comes from a formula. The wind-chill index $W = f(T, v)$ depends on the actual temperature $T$ and the wind speed $v$, and it is published as a table of measured values rather than an equation. Reading $f(-5, 50) = -15$ off that table says that at $-5^\circ\text{C}$ with a $50$ km/h wind, the air feels as cold as a windless $-15^\circ\text{C}$.
The lesson is that “function” means a definite rule, not necessarily a formula. A table that returns one output for each input pair is a perfectly good function of two variables. (Source: Stewart 14.1, Example 3, pp. 973-974.)
4. A real model: the Cobb-Douglas production function
Economists Charles Cobb and Paul Douglas modeled the output of an economy as a function of two inputs, labor $L$ and capital $K$: \[ P(L, K) = bL^{a}K^{1-a}, \qquad \text{fitted as} \qquad P(L, K) = 1.01\,L^{0.75}K^{0.25}. \] Because $L$ and $K$ are amounts of labor and capital, they are never negative, so the domain is $\{(L, K) \mid L \ge 0, K \ge 0\}$. Evaluating the model at recorded values of $L$ and $K$ reproduces historical production figures closely, which is why this two-variable function became a standard tool in economics. (Source: Stewart 14.1, Example 4, pp. 974-975.)
Recap. A function of two variables is the natural language for any quantity that genuinely depends on two others, which is why this idea opens the multivariable course.
Common Errors Summary
| Error | Example | Correction |
|---|---|---|
| Swapping domain and range | calling $[0, 3]$ the domain of $\sqrt{9 - x^2 - y^2}$ | The domain is the disk of inputs; the range is the interval of output values |
| Dropping a domain condition | giving the half-plane but forgetting $x \neq 1$ | Every risky operation contributes a condition; combine all with “and” |
| Assuming a function must be a formula | rejecting the wind-chill table as “not a function” | A rule that returns one output per input pair is a function, formula or not |
| Evaluating in the wrong order | substituting $y$ for $x$ | The first slot is $x$, the second is $y$: $f(a, b)$ means $x = a$, $y = b$ |
| Forgetting the output is a single number | writing $f(x, y)$ as a pair | Output $z = f(x, y)$ is one real number, the height above the point $(x, y)$ |
Common Misconceptions
the domain of a function of two variables is a list of allowed $x$-values and a separate list of allowed $y$-values.
This is the input-output-confusion error. The domain of $f(x,y)$ is a set of ordered pairs $(x,y)$, typically a region in the plane, not two independent intervals. For $f(x,y) = \sqrt{x - y}$, the domain is the half-plane $x \geq y$, which cannot be described by restricting $x$ and $y$ independently. Any pair in the region is valid; the constraint links the two variables together.
Leveled Practice
Work each problem fully before revealing the answer.
Level 1 -- Direct Application
Problem 1. For $f(x, y) = x^2 y - 3y$, evaluate $f(2, 1)$ and $f(-1, 4)$.
Show answer
$f(2, 1) = (2)^2(1) - 3(1) = 4 - 3 = 1$.
$f(-1, 4) = (-1)^2(4) - 3(4) = 4 - 12 = -8$.
Problem 2. Find the domain of $f(x, y) = \sqrt{x - 2} + \sqrt{y - 1}$.
Show answer
Each square root needs a nonnegative inside: $x - 2 \ge 0$ and $y - 1 \ge 0$, so $x \ge 2$ and $y \ge 1$.
\[ D = \{(x, y) \mid x \ge 2, \; y \ge 1\}. \]
This is the closed region to the right of $x = 2$ and above $y = 1$.
Problem 3. Find the domain of $g(x, y) = \dfrac{x - y}{x + y}$.
Show answer
The only restriction is the denominator: $x + y \neq 0$, that is, $y \neq -x$.
\[ D = \{(x, y) \mid y \neq -x\}. \]
The domain is the whole plane with the line $y = -x$ removed.
Level 2 -- Domain and Range
Problem 4. Find the domain and range of $f(x, y) = \sqrt{16 - x^2 - y^2}$.
Show answer
Domain: $16 - x^2 - y^2 \ge 0$, that is, $x^2 + y^2 \le 16$, the closed disk of radius $4$ centered at the origin.
Range: the output is a nonnegative square root, so $z \ge 0$; and $16 - x^2 - y^2 \le 16$ gives $z \le 4$. Both extremes occur ($z = 4$ at the origin, $z = 0$ on the boundary), so the range is $[0, 4]$.
Problem 5. Find the domain of $g(x, y) = \ln(9 - x^2 - y^2)$.
Show answer
The logarithm needs a positive argument: $9 - x^2 - y^2 > 0$, that is, $x^2 + y^2 < 9$, the open disk of radius $3$, boundary excluded.
\[ D = \{(x, y) \mid x^2 + y^2 < 9\}. \]
Level 3 -- Interpretation
Problem 6. A simple model for the surface area of a human body is $S = f(w, h) = 0.1091\,w^{0.425}h^{0.725}$, where $w$ is weight in pounds, $h$ is height in inches, and $S$ is in square feet. What is the domain in this context, and why?
Show answer
Mathematically the powers $w^{0.425}$ and $h^{0.725}$ require nonnegative bases, so $w \ge 0$ and $h \ge 0$. In context, weight and height are positive quantities, so the meaningful domain is \[ D = \{(w, h) \mid w > 0, \; h > 0\}. \]
This is an example of a context narrowing a domain: the formula would accept $w = 0$, but no real body has zero weight, so the modeling domain uses strictly positive inputs. (Based on Stewart 14.1, Exercise 17.)
Mastery Checklist
You have mastered this skill when you can, without notes:
Mental Model
Think of a function of two variables as an elevation rule for a map.
Spread a map flat on a table. Each location on the map is an input pair $(x, y)$. The function is a rule that stamps a single elevation $z = f(x, y)$ on each location. The domain is the part of the map where the rule actually applies, the region you are allowed to stand on. The range is the full set of elevations the rule produces, from the lowest to the highest stamp.
This is why the four presentations all describe the same thing. A formula computes the elevation; a table lists elevations at sampled locations; a verbal description explains the elevation rule; and a graph or a contour map draws the elevations. Hold the elevation-rule picture, and the rest of the section is just four ways of seeing it.
Connections
Built from
- Domain Restrictions for Functions of Several Variables: Finding the domain of a two-variable formula is the day-zero skill this lesson puts to work.
- Regions, Lines, and Circles in the Plane: Every domain found here is one of those regions.
Leads to
- Graphs of Functions: The graph lifts each elevation stamp into space as a surface.
- Level Curves and Contour Maps: A contour map draws the locations that share an elevation.
- Limits of Multivariable Functions: Once a function of two variables is defined, the next question is how it behaves as the input approaches a point.
Where this shows up
A function of two variables is the basic object of this entire course. Partial derivatives measure how the elevation changes as you step in one compass direction; double integrals measure the volume between the elevation surface and the map; optimization finds the highest and lowest stamps. Outside mathematics, the same object is a heat map, a topographic elevation model, a pricing surface that depends on two market factors, or a loss surface that a learning algorithm walks downhill. Anytime one quantity genuinely depends on two others, this is the language used.
Audience Notes
For students who find math intimidating: You already understand “output depends on input.” The only change is that the input is now two numbers instead of one, like a street address that needs both a row and a column. Evaluating is still just substitution.
For students who want depth: A function of two variables is a map from a subset of $\mathbb{R}^2$ to $\mathbb{R}$. The same definition extends to maps from $\mathbb{R}^n$ to $\mathbb{R}$, and using vector notation $\mathbf{x} = \langle x_1, \dots, x_n \rangle$, a linear example can be written compactly as a dot product $f(\mathbf{x}) = \mathbf{c} \cdot \mathbf{x}$. This viewpoint, a function as a rule on a vector input, is the bridge to linear algebra and to the derivative as a linear map.
Back to MATH241 Skills | Previous: 3D Coordinates and the Plane Equation | Next: Graphs of Functions