Functions of Several Variables: Explained with Examples
A function of several variables assigns a single output to each combination of inputs, written f(x, y) or f(x, y, z). The temperature at a point on a map depends on both latitude and longitude; the volume of a box depends on length, width, and height. One input is no longer enough.
These functions matter because the real world is multivariable: weather depends on position and time, profit depends on price and advertising, and a machine-learning model depends on thousands of parameters. Calculus of several variables is the language of all of them.
Key Concepts
- Notation and evaluation: f(x, y) = x² + 3xy − y² means substitute the given numbers for x and y and compute; f(2, −1) is a single number.
- Domain: the set of input pairs for which the formula makes sense. Watch for division by zero and square roots of negative numbers, which now carve regions out of the plane rather than intervals off a line.
- Graph as a surface: z = f(x, y) graphs as a surface in three-dimensional space, with hills, valleys, and saddle points.
- Level curves: the curves f(x, y) = c, for constants c, are the contour lines of the surface, exactly like elevation contours on a topographic map.
- Traces: fixing one variable, such as y = 2, reduces f to an ordinary single-variable function whose graph is a slice of the surface.
How It Works
- Check the domain: find all (x, y) where the formula is defined, excluding divisions by zero and negative square roots.
- Evaluate by substituting numbers directly into the formula.
- Sketch level curves by setting f(x, y) = c for several constants c to reveal the shape of the surface.
- Examine traces by holding one variable fixed to see cross-sections.
Worked Example
Consider f(x, y) = x² + 3xy − y².
- Evaluate at (2, −1): f(2, −1) = (2)² + 3(2)(−1) − (−1)² = 4 − 6 − 1 = −3.
- Domain: the formula uses only addition, subtraction, and multiplication, which are always defined, so the domain is the entire xy-plane.
- Contrast with a restricted function: g(x, y) = √(x² + y² − 4) needs x² + y² − 4 ≥ 0, so its domain is the region on or outside the circle of radius 2 centred at the origin.
- Level curve example: setting f(x, y) = 0 gives x² + 3xy − y² = 0, a pair of straight lines through the origin, which are the contour lines at height zero.
Common Misconceptions
- The domain is an interval. In two variables the domain is a region of the plane, such as a disk or the area outside a circle, not a single interval.
- You can "solve" f(x, y) for one variable. A function value is an output, not an equation; f(x, y) = −3 is one equation in two unknowns with infinitely many solutions.
- Level curves live on the surface. They are drawn in the flat xy-plane below it, like contour lines on a paper map representing a 3D landscape.
Real-World Applications
- Geography: elevation, temperature, and rainfall maps are functions of two position variables with contour lines.
- Economics: production functions take labour and capital as inputs; utility functions take quantities of goods.
- Physics: temperature, pressure, and electric potential fields vary across space and time.
- Machine learning: loss functions depend on thousands of parameters, and training navigates that high-dimensional surface.
Functions of several variables take whole tuples as input and return one output, with domains that are regions, graphs that are surfaces, and level curves that map the terrain. Evaluate by direct substitution, respect domain restrictions, and read contour lines the way you read a topographic map.
Related blogs
- Partial Derivatives: Rules and Examples Fully Explained
- Higher-Order Partial Derivatives Explained Simply
- Total Differential: Definition, Approximation, Chain Rule
- Chain Rule for Several Variables: Explained with Examples
- Jacobians in Calculus: Definition, Formula and Examples
- Maxima and Minima of Two Variables: A Complete Guide