Calculus · Functions of several variables

Limits and Continuity in Several Variables: When "Approaching a Point" Gets Complicated

The temperature in a room depends on three coordinates; the price of a product on dozens of factors. To do calculus with such functions we first need to know what "close" means in many dimensions, and what a limit is when a point can be approached from infinitely many directions. This post builds that foundation: the space \(\mathbb R^n\), convergence, level curves, limits, continuity and uniform continuity.

1. The space \(\mathbb R^n\)

Definition · The real n-dimensional space \(\mathbb R^n\) is the set of ordered \(n\)-tuples of real numbers, \[ \mathbb R^n = \{(\xi_1, \xi_2, \dots, \xi_n) : \xi_i \in \mathbb R\}, \] whose elements are called vectors or points. For \(x = (\xi_1, \dots, \xi_n)\) and \(y = (\eta_1, \dots, \eta_n)\), addition and multiplication by a real number \(\lambda\) are defined coordinate by coordinate: \[ x + y = (\xi_1 + \eta_1, \dots, \xi_n + \eta_n), \qquad \lambda x = (\lambda\xi_1, \dots, \lambda\xi_n). \] With the distance \[ d(x, y) = \sqrt{(\xi_1 - \eta_1)^2 + (\xi_2 - \eta_2)^2 + \cdots + (\xi_n - \eta_n)^2}, \] \(\mathbb R^n\) is the n-dimensional real metric space.

For \(n = 2\) and \(n = 3\) this is just the plane and ordinary space with the coordinate operations from the post on vectors, and \(d\) is the familiar Pythagorean distance. For larger \(n\) we lose the picture but keep the formulas. A point of \(\mathbb R^{10}\) might be the ten measurements describing a patient, a state of a mechanical system, or the ten parameters of a model.

The distance has the three properties we expect from "distance":

With a distance we can talk about neighbourhoods. The \(\delta\)-neighbourhood of a point \(x_0\) is the set of points with \( d(x, x_0) < \delta \): an interval on the line, a disc in the plane, a ball in space. That is all we need to define limits.

2. Convergence of points

Definition A sequence of points \( x_m = \big(\xi_1^{(m)}, \xi_2^{(m)}, \dots, \xi_n^{(m)}\big) \) converges to the point \( x = (\xi_1, \dots, \xi_n) \) if for every \(\varepsilon > 0\) there is a number \(N\) such that \[ d(x_m, x) < \varepsilon \qquad \text{whenever } m > N. \]

This is the definition from one variable, with \(|x_m - x|\) replaced by the distance. In practice there is a simple test:

Coordinatewise convergence \( x_m \to x \) in \(\mathbb R^n\) if and only if each coordinate converges: \( \xi_i^{(m)} \to \xi_i \) for \( i = 1, \dots, n \).

Why: each coordinate difference is at most the distance, \( |\xi_i^{(m)} - \xi_i| \le d(x_m, x) \); and conversely, if all \(n\) coordinate differences are less than \(\frac{\varepsilon}{\sqrt n}\), the distance is less than \(\varepsilon\).

Example 1 \( x_m = \Big(\frac1m,\ 1 + \frac{(-1)^m}{m},\ \big(1 + \frac1m\big)^m\Big) \to (0, 1, e) \) in \(\mathbb R^3\), since each coordinate converges.

3. Level curves and level surfaces

A function \( u = f(x) = f(\xi_1, \xi_2, \dots, \xi_n) \) of \(n\) independent variables assigns a number to each point of a set \(D \subset \mathbb R^n\). For two variables its graph \( z = f(x, y) \) is a surface in space, a landscape whose height above the point \((x, y)\) is \(f(x, y)\). Drawing surfaces is hard; there is a better way to see such a function.

Definition · Level sets The set of points \(x\) for which \( f(x) = c \) (\(c\) a constant) is called the level set of \(u = c\). For \(n = 2\) the level sets are level curves; for \(n = 3\) they are level surfaces.

A level curve is a horizontal slice through the landscape at height \(c\), projected onto the plane. You have seen them many times: contour lines on a hiking map (equal altitude), isobars on a weather map (equal pressure), isotherms (equal temperature). Where the curves are crowded, the function changes fast (a steep slope); where they are far apart, it changes slowly.

y x c = 1 c = 4 x² + y² = c y x c = 1 c = −1 xy = c
Figure 1. Level curves. Left: \( f(x, y) = x^2 + y^2 \), concentric circles \( x^2 + y^2 = c \), a bowl seen from above (the circles get closer together as \(c\) grows: the bowl gets steeper). Right: \( f(x, y) = xy \), hyperbolas \( xy = c \) (blue for \(c > 0\), red for \(c < 0\)), a saddle seen from above.
Example 2 · Level surfaces For \( u = x^2 + y^2 + z^2 \), the level surfaces \( u = c \) (\(c > 0\)) are spheres of radius \(\sqrt c\) centred at the origin. For \( u = x + 2y + 3z \) they are parallel planes. If \(u\) is the temperature in a room, the level surfaces are the surfaces of equal temperature.

4. The limit of a function of several variables

Definition We say that \[ \lim_{x\to x_0} f(x) = A \] if for every \(\varepsilon > 0\) there is a number \( \delta(\varepsilon, x_0) > 0 \) such that \[ |f(x) - A| < \varepsilon \qquad \text{whenever} \qquad 0 < d(x, x_0) < \delta. \]

Word for word, this is the definition from one variable, with \( |x - x_0| \) replaced by the distance \( d(x, x_0) \). The condition \( 0 < d \) means the value at \(x_0\) itself plays no role (it may not even be defined); \(x_0\) only needs to be a point that can be approached by points of the domain.

In two variables, the definition reads: for \(x = (x, y)\) close to \(x_0 = (a, b)\), that is, inside a small disc around \((a, b)\), the values \(f(x, y)\) are close to \(A\). We write \( \lim_{(x, y)\to(a, b)} f(x, y) = A \).

The usual limit rules carry over: limits of sums, products and quotients (with nonzero denominator) are sums, products and quotients of limits. So for "nice" expressions you can simply substitute:

\[ \lim_{(x, y)\to(1, 2)}\frac{x^2 + xy}{x + y} = \frac{1 + 2}{3} = 1. \]

The interesting cases, as in one variable, are the indeterminate forms such as \(\frac00\).

5. Why one direction is not enough

On the real line a point can be approached only from the left or the right. In the plane there are infinitely many paths: along every line through the point, along parabolas, spirals, zig-zags... The limit exists only if \(f\) approaches the same value \(A\) along all of them at once, since the definition only looks at the distance \(d(x, x_0)\), not at the direction. This gives a practical test for non-existence:

Two-path test If \(f(x)\) tends to different values along two different paths to \(x_0\) (or has no limit along one of them), then \( \lim_{x\to x_0} f(x) \) does not exist.
Example 3 · Different lines, different limits \( f(x, y) = \dfrac{xy}{x^2 + y^2} \) at \((0, 0)\). Along the line \( y = kx \): \[ f(x, kx) = \frac{kx^2}{x^2 + k^2x^2} = \frac{k}{1 + k^2}. \] Along \(y = 0\) the value is \(0\), along \(y = x\) it is \(\frac12\), along \(y = -x\) it is \(-\frac12\). The function is constant on each line through the origin, but with a different constant on each. The limit does not exist.
All lines can agree, and the limit still fail \( f(x, y) = \dfrac{x^2y}{x^4 + y^2} \) at \((0, 0)\).

Along every line \(y = kx\): \( f = \frac{kx^3}{x^4 + k^2x^2} = \frac{kx}{x^2 + k^2} \to 0 \); along the \(y\)-axis, \(f = 0\). So the limit along every straight line is \(0\).

But along the parabola \( y = x^2 \): \( f(x, x^2) = \frac{x^4}{2x^4} = \frac12 \). The limit does not exist. Checking straight lines can prove that a limit does not exist, but it can never prove that it does.

Iterated limits are not the double limit For Example 3, letting first \(y \to 0\) and then \(x \to 0\) gives \( \lim_{x\to0}\big(\lim_{y\to0}f\big) = \lim_{x\to0}0 = 0 \), and the other order also gives \(0\). Yet the limit as \((x, y) \to (0, 0)\) does not exist. The iterated limits approach the point along very special L-shaped paths. This mirrors the post on double series, where summing by rows, by columns and by rectangles were different things.

6. Proving that a limit exists: polar coordinates

To prove that a limit at the origin exists, we need an estimate that works for all directions at once. A convenient tool is to switch to polar coordinates, \( x = r\cos\varphi \), \( y = r\sin\varphi \), with \( r = \sqrt{x^2 + y^2} = d\big((x, y), (0, 0)\big) \).

Polar coordinate criterion If \[ |f(r\cos\varphi, r\sin\varphi) - A| \le g(r) \qquad \text{with} \qquad g(r) \to 0 \ \text{ as } r \to 0, \] where the bound \(g\) does not depend on \(\varphi\), then \( \lim_{(x, y)\to(0, 0)} f(x, y) = A \).

The key words are "does not depend on \(\varphi\)": the estimate must be uniform in the direction. (The function in the warning box above fails exactly this: in polar form it is \( \frac{r\cos^2\varphi\sin\varphi}{r^2\cos^4\varphi + \sin^2\varphi} \), which equals \(\frac12\) whenever \( \sin\varphi = r\cos^2\varphi \), however small \(r\) is.)

Example 4 \( \lim_{(x, y)\to(0, 0)}\dfrac{x^2y}{x^2 + y^2} \). In polar coordinates: \[ \left|\frac{r^3\cos^2\varphi\sin\varphi}{r^2}\right| = r\,|\cos^2\varphi\sin\varphi| \le r \longrightarrow 0. \] So the limit is \(0\). Compare with Example 3: there the numerator had the same degree as the denominator (\(2\)), and the \(r\)'s cancelled completely, leaving only \(\varphi\). Here the numerator has a higher degree, and a factor \(r\) survives.
Example 5 · Reducing to one variable \( \lim_{(x, y)\to(0, 0)}\dfrac{\sin(x^2 + y^2)}{x^2 + y^2} \). The function depends on \(x\) and \(y\) only through \( t = x^2 + y^2 = r^2 \to 0 \), so the limit equals \( \lim_{t\to0}\frac{\sin t}{t} = 1 \).

7. Continuity

Definition The function \(f(x)\) is continuous at the point \(x_0\) if \[ \lim_{x\to x_0} f(x) = f(x_0). \] It is continuous in the region \(D\) if it is continuous at every point of \(D\).

Three conditions are hidden in the definition: \(f(x_0)\) is defined, the limit exists, and the two are equal. As in one variable, sums, products, quotients (where the denominator is nonzero) and compositions of continuous functions are continuous. So all polynomials in \(x_1, \dots, x_n\) are continuous everywhere, and expressions like \( e^{xy}\sin(x + z) \) or \( \frac{\ln(1 + x^2)}{1 + y^2} \) are continuous wherever they are defined.

Continuous in each variable is not continuous Let \( f(x, y) = \frac{xy}{x^2 + y^2} \) for \((x, y) \ne (0, 0)\) and \( f(0, 0) = 0 \). For every fixed \(y\), \(f\) is a continuous function of \(x\) (and vice versa); in particular \( f(x, 0) = f(0, y) = 0 \). Yet \(f\) is not continuous at the origin, because \( \lim_{(x, y)\to(0,0)} f \) does not exist (Example 3). Continuity in several variables is a condition on all directions of approach simultaneously, not just along the coordinate axes.
Example 6 · Removing a discontinuity The function \( \frac{x^2y}{x^2 + y^2} \) is undefined at the origin, but its limit there is \(0\) (Example 4). Defining \( f(0, 0) = 0 \) makes it continuous everywhere.

Continuous functions on bounded and closed sets (sets that contain their boundary, such as a closed disc or a closed cube) keep the important properties from one variable. In particular, such a function attains a largest and a smallest value there (Weierstrass' theorem), which is what makes the search for extrema in several variables meaningful.

8. Uniform continuity

Definition The function \(f(x)\) is uniformly continuous in the region \(D\) if for every \(\varepsilon > 0\) there is a \(\delta > 0\) depending only on \(\varepsilon\), such that for any two points \(x', x'' \in D\) \[ |f(x') - f(x'')| < \varepsilon \qquad \text{whenever} \qquad d(x', x'') < \delta. \]

Compare with ordinary continuity: there, \(\delta\) may depend on both \(\varepsilon\) and the point \(x_0\). Uniform continuity asks for one \(\delta\) that works everywhere in \(D\). It's the same idea as the uniform convergence from earlier posts: the change from "for each point there is a \(\delta\)" to "there is a \(\delta\) for all points".

Example 7 · Uniform and not uniform
  • \( f(x, y) = x + y \) is uniformly continuous on all of \(\mathbb R^2\): \( |f(x') - f(x'')| \le |\Delta x| + |\Delta y| \le \sqrt2\,d(x', x'') \), so \( \delta = \frac{\varepsilon}{\sqrt2} \) works everywhere.
  • \( f(x, y) = x^2 + y^2 \) is continuous on \(\mathbb R^2\) but not uniformly: far from the origin the bowl is so steep that a fixed small step changes \(f\) by a lot. (Along the \(x\)-axis, \( (x + \delta)^2 - x^2 = 2x\delta + \delta^2 \) grows without bound.)
  • \( f(x, y) = \frac{1}{x^2 + y^2} \) is continuous on the punctured disc \( 0 < x^2 + y^2 \le 1 \) but not uniformly: near the origin it blows up.

In both counterexamples the trouble comes from the set being unbounded, or not closed (the missing origin). Remove that trouble, and uniform continuity comes for free:

Theorem (Cantor) If \(f(x)\) is continuous in a bounded and closed region, then it is uniformly continuous in that region.

For example, \( x^2 + y^2 \) is uniformly continuous on any closed disc, even though it isn't on the whole plane. This theorem is used, for instance, to prove that continuous functions are integrable, which will matter for double and triple integrals.

9. Summary

ConceptDefinition / rule
Distance in \(\mathbb R^n\)\( d(x, y) = \sqrt{\sum(\xi_i - \eta_i)^2} \)
Convergence \(x_m \to x\)\( d(x_m, x) \to 0 \) \(\iff\) every coordinate converges
Level set\( \{x : f(x) = c\} \): curves for \(n = 2\), surfaces for \(n = 3\)
Limit\( |f(x) - A| < \varepsilon \) whenever \( 0 < d(x, x_0) < \delta \)
Limit does not existtwo paths give different values
Limit exists (at origin)\( |f - A| \le g(r) \to 0 \), \(g\) independent of \(\varphi\)
Continuity at \(x_0\)\( \lim_{x\to x_0}f(x) = f(x_0) \)
Uniform continuityone \(\delta(\varepsilon)\) for all pairs of points in \(D\)
Cantor's theoremcontinuous on bounded closed set \(\Rightarrow\) uniformly continuous

Strategy for a limit at a point:

  1. Try substituting. If there's no indeterminate form, you're done.
  2. Try a few paths (lines \(y = kx\), parabolas \(y = kx^2\), the axes). If two give different values, the limit does not exist.
  3. If all paths agree, try to prove the limit: polar coordinates, a known one-variable limit, or an inequality.

10. Practice problems

Try each one before opening the solution. More solved problems from this topic are in Limits.

Problem 1: Find the distance between \( (1, 2, 3, 4) \) and \( (2, 4, 6, 0) \) in \(\mathbb R^4\).

\( \sqrt{1 + 4 + 9 + 16} = \sqrt{30} \).

Problem 2: Describe the level curves of \( f(x, y) = y - x^2 \).

\( y = x^2 + c \): congruent parabolas, shifted vertically.

Problem 3: Describe the level surfaces of \( u = x^2 + y^2 - z^2 \).

\(c > 0\): one-sheeted hyperboloids; \(c = 0\): a double cone; \(c < 0\): two-sheeted hyperboloids.

Problem 4: Does \( \displaystyle\lim_{(x, y)\to(0, 0)}\frac{x^2 - y^2}{x^2 + y^2} \) exist?

Along \(y = kx\): \( \frac{1 - k^2}{1 + k^2} \), which depends on \(k\) (\(1\) on the \(x\)-axis, \(-1\) on the \(y\)-axis). It does not exist.

Problem 5: Compute \( \displaystyle\lim_{(x, y)\to(0, 0)}\frac{xy^2}{x^2 + y^2} \).

Polar: \( |r\cos\varphi\sin^2\varphi| \le r \to 0 \). The limit is \(0\).

Problem 6: Is \( f(x, y) = \dfrac{x^3 + y^3}{x^2 + y^2} \), \( f(0, 0) = 0 \), continuous at the origin?

Yes: \( |f| = r\,|\cos^3\varphi + \sin^3\varphi| \le 2r \to 0 = f(0, 0) \).

Problem 7: For \( f(x, y) = \dfrac{x - y}{x + y} \), compute both iterated limits at \((0, 0)\). Does the double limit exist?

\( \lim_{x\to0}\lim_{y\to0}f = \lim_{x\to0}\frac xx = 1 \); \( \lim_{y\to0}\lim_{x\to0}f = \lim_{y\to0}\frac{-y}{y} = -1 \). The iterated limits differ, so the double limit does not exist.

Problem 8: Show that \( \displaystyle\lim_{(x, y)\to(0, 0)}\frac{x^2y}{x^4 + y^2} \) does not exist, even though its limit along every line through the origin is \(0\).

Along \( y = x^2 \) the function equals \(\frac12\) (see Section 5). Paths that are curves matter too.

Problem 9: Find the limit of the sequence \( x_m = \Big(\frac{m}{m + 1},\ \frac{\sin m}{m},\ e^{-m}\Big) \) in \(\mathbb R^3\).

Coordinatewise: \( (1, 0, 0) \).

Final thoughts

Moving from one variable to several changes surprisingly little in the definitions: replace \(|x - x_0|\) by the distance \(d(x, x_0)\), and limits, continuity and uniform continuity read the same. What changes is the geometry: a point can now be approached along infinitely many paths, and a limit has to be the same along all of them. That single fact explains every surprise in this post, and it is the lens through which partial derivatives, differentials and extrema of functions of several variables should be read in the posts to come.

Next in the series: partial derivatives and the total differential.