A function of several variables takes a point as its input. The first job is to find which points are allowed. We can then study the function through its graph, level sets, and limits.
Domains and graphs
For a function f:R2→R, the domain is the set of pairs (x,y) for which the formula makes sense. Its graph is the surface
z=f(x,y)
in R3.
Example: combine two domain restrictions
Consider
f(x,y)=1−x2−y2+ln(y+21).
The square root requires
1−x2−y2≥0⟺x2+y2≤1.
The logarithm requires a strictly positive input:
y+21>0⟺y>−21.
Both conditions must hold at once, so
Dom(f)={(x,y)∈R2:x2+y2≤1 and y>−21}.
This is the part of the closed unit disk above y=−1/2. The circular boundary is included wherever it also satisfies the logarithm condition. The horizontal chord at y=−1/2 is excluded.
The domain is an intersection of two restrictions
Level curves and contour maps
A level curve of f(x,y) is a set of inputs where the function has one fixed value:
f(x,y)=c.
On the graph z=f(x,y), this comes from the horizontal trace at height z=c. The trace is a curve in the plane z=c; the level curve records the same (x,y) coordinates in the input plane. For more background on traces, see Distance and Quadric Surfaces.
A collection of level curves is called a contour map. It shows how the output changes without requiring a three-dimensional surface drawing.
Example: the contours of xy
Let
f(x,y)=xy.
The square root is real when xy≥0. Thus the domain is
(x≥0 and y≥0)or(x≤0 and y≤0).
It consists of quadrants I and III together with the coordinate axes.
Because a principal square root is nonnegative, a level value must satisfy c≥0. The equation f(x,y)=c becomes
xy=c⟺xy=c2.
For the first few levels:
c=0c=1c=2:x=0 or y=0,:xy=1,:xy=4.
For c>0, the level curve is a hyperbola with one branch in quadrant I and one in quadrant III. Larger values of c lie farther from the axes.
Contour map for the square root of xy
Functions of three variables
For a function f:R3→R, the full graph
w=f(x,y,z)
lives in R4, so we cannot draw it directly in ordinary space. We can still study the three-dimensional level surfaces
f(x,y,z)=c.
For example, take
f(x,y,z)=1000−x2−y2−z2.
The level equation is
x2+y2+z2=1000−c.
This gives
c=0c=500c=1000:x2+y2+z2=1000,:x2+y2+z2=500,:x2+y2+z2=0,a sphere of radius 1000,a sphere of radius 500,the single point (0,0,0).
The last level set is a degenerate sphere of radius 0. A level set need not be an ordinary surface; it can collapse to a point or even be empty.
From one-variable limits to two variables
For a one-variable function, the statement
x→alimf(x)=L
means that every requested output tolerance ε>0 can be met by choosing an input tolerance δ>0 such that
0<∣x−a∣<δ⟹∣f(x)−L∣<ε.
In two variables, replace the one-dimensional distance ∣x−a∣ with the Euclidean distance between (x,y) and (a,b):
∥(x,y)−(a,b)∥=(x−a)2+(y−b)2.
Formal definition
Let f:D→R, where D⊆R2, and let (a,b) be an accumulation point of D. We write
(x,y)→(a,b)limf(x,y)=L
if, for every ε>0, there is a δ>0 such that every (x,y)∈D satisfies
0<(x−a)2+(y−b)2<δ⟹∣f(x,y)−L∣<ε.
The input condition describes a punctured disk: points within radius δ of (a,b), with the center removed. The output condition requires the corresponding heights to lie in the band
L−ε<f(x,y)<L+ε.
A punctured input disk controls an output band
The puncture matters. A limit depends on nearby values, not on the value at the center. The function may have a different value at (a,b) or be undefined there.
A warning from a surface
The function
g(x,y)=x2+y2x2−y2
is undefined at (0,0). Its graph near the origin suggests that approaching from different directions may produce incompatible values, so a single limit should not be assumed from a picture. A proof of nonexistence must exhibit the contradiction formally; that argument comes after the definition-based example below.
Example: prove a limit from the definition
We will prove
(x,y)→(0,0)limx2+y23x2y=0.
The expression is undefined at the origin, but the punctured-neighborhood condition excludes that point.
To determine how small δ must be for a given ε, first bound the error in terms of the distance x2+y2. For (x,y)=(0,0),
x2+y23x2y−0=3∣y∣x2+y2x2≤3∣y∣≤3x2+y2.
The first inequality uses 0≤x2/(x2+y2)≤1. The second uses y2≤x2+y2.
Now let ε>0 and choose
δ=3ε.
If
0<x2+y2<δ,
then
x2+y23x2y−0≤3x2+y2<3δ=ε.
This is exactly the implication required by the definition. Therefore,
(x,y)→(0,0)limx2+y23x2y=0.
The squeeze theorem
The estimate in the previous proof also fits a general principle. Suppose that, for all points sufficiently close to (a,b) except possibly the point itself,
g(x,y)≤f(x,y)≤h(x,y).
If
(x,y)→(a,b)limg(x,y)=(x,y)→(a,b)limh(x,y)=L,
then the squeeze theorem gives
(x,y)→(a,b)limf(x,y)=L.
For the function in the previous example,
−3∣y∣≤x2+y23x2y≤3∣y∣.
Both bounding functions tend to 0 as (x,y)→(0,0), so the middle function does too. This proves the same limit without choosing particular paths.
Continuity
A function f:D→R, where D⊆R2, is continuous at(a,b)∈D when
(x,y)→(a,b)limf(x,y)=f(a,b).
The function is continuous on a set when it is continuous at every point of that set. Saying simply that a function is continuous usually means that it is continuous throughout its domain.
Polynomials are continuous everywhere. Sums, differences, products, and compositions of continuous functions remain continuous wherever the resulting expression is defined. A quotient of continuous functions is continuous wherever its denominator is nonzero. For example, if p and q are polynomials and q(a,b)=0, then
(x,y)→(a,b)limq(x,y)p(x,y)=q(a,b)p(a,b).
This is why direct substitution works for rational and other elementary expressions at points in their domains.
Limits of compositions
Suppose
(x,y)→(a,b)limg(x,y)=L
and the one-variable function h is continuous at L. Then
(x,y)→(a,b)limh(g(x,y))=h(L).
This lets us reduce some multivariable limits to familiar one-variable limits.
Example: a continuous extension
Consider
f(x,y)=xysin(xy),
which is originally defined only when xy=0. Set t=xy. From one-variable calculus,
t→0limtsint=1.
Define the continuous one-variable extension
h(t)=⎩⎨⎧tsint,1,t=0,t=0.
Because (x,y)↦xy and h are continuous, their composition is continuous on all of R2. The extended two-variable function is
F(x,y)=⎩⎨⎧xysin(xy),1,xy=0,xy=0.
The second case fills in both coordinate axes, since xy=0 exactly when x=0 or y=0.
Proving that a limit does not exist
If a full two-variable limit exists, every curve approaching the point must give the same value. More precisely, suppose
(x,y)→(a,b)limf(x,y)=L
and r(t)=⟨x(t),y(t)⟩ approaches (a,b) as t→t0. Assume that r(t) stays in the domain of f and does not equal (a,b) for nearby t=t0. Then
t→t0limf(r(t))=L.
The contrapositive is the useful test: if two valid paths approach the same point but give different limits, then the full multivariable limit does not exist.
Example: two coordinate axes are enough
Return to
g(x,y)=x2+y2x2−y2.
Along the x-axis, use the path r1(t)=⟨t,0⟩:
t→0limg(t,0)=t→0limt2t2=1.
Along the y-axis, use r2(t)=⟨0,t⟩:
t→0limg(0,t)=t→0limt2−t2=−1.
The path limits disagree, so
(x,y)→(0,0)limx2+y2x2−y2 does not exist.
Agreement along every line is still not a proof
Checking paths is decisive when two limits disagree. Agreement along a collection of paths does not prove that the full limit exists, even if the collection contains every straight line through the point.
For example, let
f(x,y)=x2+y4xy2.
Along an arbitrary nonvertical line y=cx, where c is fixed,
f(x,cx)=x2+(cx)4x(cx)2=1+c4x2c2x⟶0.
The vertical line x=0 also gives 0. Nevertheless, along the parabola x=y2,
f(y2,y)=y4+y4y4=21
for y=0. Thus
(x,y)→(0,0)limx2+y4xy2 does not exist.
Straight lines missed the curved approach on which the function tends to 1/2.
Partial derivatives
A partial derivative measures change in one input direction while the other inputs are held fixed. For a function f(x,y), the partial derivative with respect to x is
fx(x,y)=∂x∂f(x,y)=h→0limhf(x+h,y)−f(x,y),
provided the limit exists. Here y stays fixed. Similarly,
fy(x,y)=∂y∂f(x,y)=h→0limhf(x,y+h)−f(x,y),
with x fixed.
Coordinate traces and tangent slopes
For the graph z=f(x,y), fixing y=b produces the coordinate trace
z=f(x,b).
Its tangent slope at x=a is fx(a,b). Fixing x=a instead produces
z=f(a,y),
whose tangent slope at y=b is fy(a,b). Thus the two first partials record the slopes of the surface along the two coordinate directions.
Example: differentiate one variable at a time
Let
f(x,y)=x−xy2+y3.
Holding y fixed while differentiating with respect to x gives
fx(x,y)=1−y2.
Holding x fixed while differentiating with respect to y gives
fy(x,y)=−2xy+3y2.
The variable being held fixed behaves like a constant during that calculation.
Implicit partial differentiation
Partial derivatives can also be found when z=z(x,y) is defined by an equation rather than an explicit formula. Consider
zy2=x3+xz2+z3.
To find zx=∂z/∂x, hold y fixed and treat every occurrence of z as a function of x. Differentiating both sides gives
In this example the two mixed partials are equal. Clairaut's theorem explains when that agreement is guaranteed: if fxy and fyx exist and are continuous on a disk around (a,b), then
fxy(a,b)=fyx(a,b).
The continuity-near-the-point hypothesis matters. Without suitable regularity, mixed partials can exist at a point and still be unequal there. With sufficiently continuous higher partial derivatives, the same principle allows the order of differentiation to be rearranged for more variables and higher orders.
Choose the easier order
Clairaut's theorem can save work. Suppose
f(x,y)=g(x)+x2y3,
where g is twice continuously differentiable. The term g(x) may have a complicated derivative, but it disappears when we differentiate with respect to y. Thus
fy=3x2y2,fyx=6xy2,fxy=fyx=6xy2.
For instance, g(x)=ex2sin(tan(x2+x)+x) is smooth on any open region where the tangent is defined. We do not need to expand its derivatives to find the mixed partial. Check the theorem's hypotheses before changing the order.
Equations involving derivatives
A differential equation relates an unknown function to its derivatives. If the function depends on a single variable, its derivatives are ordinary derivatives. For example, a population p(t) with constant per-capita growth rate c satisfies
dtdp=cp(t),p(0)=p0,p(t)=p0ect.
This is an ordinary differential equation, or ODE. Differentiating the proposed solution verifies the equation, and setting t=0 verifies the initial value.
If the unknown depends on several inputs, partial derivatives let the equation describe change in each input separately. For a rod heated at one end and cooled at the other, let u(x,t) be the temperature at position x and time t. A normalized one-dimensional heat equation is
∂t∂u=∂x2∂2u.
Here ut measures temperature change with time at a fixed position, while uxx measures the spatial curvature of the temperature profile at a fixed time. This is a partial differential equation, or PDE. Its unknown is the whole function u(x,t), rather than a single number. We are identifying the equation and its derivatives here, not solving a heat-flow problem.
Partial derivatives also supply the candidate slopes for a tangent plane. To justify that approximation, we must control the error for all directions of approach.