Limits in Several Variables

For a function of one variable, approaching a point means coming in from the left or from the right — only two directions. A function of two variables lives over the plane, and a point in the plane can be approached along infinitely many paths: straight lines at every angle, parabolas, spirals. The limit

\lim_{(x, y) \to (a, b)} f(x, y) = L

means f(x, y) gets arbitrarily close to L as (x, y) gets close to (a, b)no matter how it gets there. That last clause is the whole subtlety of the subject. If two different routes into (a, b) disagree on the approached value, the limit simply does not exist.

Here is why that matters outside a textbook. Imagine hiking towards a mountain hut marked on a map, and your watch reports the elevation. One trail climbs the ridge, another threads the valley, a third scrambles straight up the slope — three completely different roads to the same hut. If your altimeter read 1800\text{ m} arriving by the ridge but 1950\text{ m} arriving by the valley, you would rightly suspect the map itself was broken at that point — "the elevation of the hut" would not really be a single number. A two-variable limit is exactly this demand made precise: every road in, however wild, must report the same destination.

The cautionary tale, step by step

The standard warning example is

f(x, y) = \frac{xy}{x^2 + y^2},

which is defined everywhere except the origin. We ask: does \lim_{(x, y) \to (0, 0)} f(x, y) exist? We test two straight-line approaches.

Step 1 — approach along the x-axis (y = 0). Substitute y = 0 and let x \to 0:

f(x, 0) = \frac{x \cdot 0}{x^2 + 0^2} = \frac{0}{x^2} = 0 \quad\Longrightarrow\quad \lim_{x \to 0} f(x, 0) = 0.

Step 2 — approach along the diagonal (y = x). Substitute y = x and let x \to 0:

f(x, x) = \frac{x \cdot x}{x^2 + x^2} = \frac{x^2}{2x^2} = \frac{1}{2} \quad\Longrightarrow\quad \lim_{x \to 0} f(x, x) = \frac{1}{2}.

Step 3 — compare the two routes. Along the axis the function heads for 0; along the diagonal it sits constantly at \tfrac12. The destination depends on the road taken:

0 = \lim_{x \to 0} f(x, 0) \;\ne\; \lim_{x \to 0} f(x, x) = \frac{1}{2}.

Step 4 — conclude. Because two paths give two different values, no single number L can be the limit along every path. Hence

\lim_{(x, y) \to (0, 0)} \frac{xy}{x^2 + y^2} \ \text{does not exist.}

Notice the trap: each individual path-limit exists and is finite. The failure is in their disagreement. Finding one path that misbehaves is enough to kill a limit; finding several that agree proves nothing — there is always another path you did not try. Drag the approach line below to see the value on the diagonal pull away from the value on the axis.

The subtler trap: every straight line agrees, and it still fails

The example above was disproved with just two lines. But what if a function agrees along every single straight line through the point — all infinitely many of them — and the limit still does not exist? This is the single most instructive counterexample in the whole subject:

f(x, y) = \frac{x^2 y}{x^4 + y^2}.

Step 1 — test a general line y = mx, for any slope m. Substitute and simplify:

f(x, mx) = \frac{x^2 (mx)}{x^4 + m^2 x^2} = \frac{m x^3}{x^2(x^2 + m^2)} = \frac{mx}{x^2 + m^2}.

As x \to 0, the numerator mx \to 0 while the denominator approaches m^2 (a nonzero constant, so long as m \ne 0). Hence \lim_{x \to 0} f(x, mx) = 0 for every slope m — and the vertical line x = 0 gives f(0, y) = 0 outright. Every line through the origin, in every direction, reports 0.

Step 2 — now try a curve instead of a line: the parabola y = x^2. Substitute y = x^2:

f(x, x^2) = \frac{x^2 \cdot x^2}{x^4 + (x^2)^2} = \frac{x^4}{x^4 + x^4} = \frac{x^4}{2x^4} = \frac{1}{2}, \quad \text{for every } x \ne 0.

Step 3 — conclude. Along the parabola the function is constantly \tfrac12, never wavering, so \lim_{x \to 0} f(x, x^2) = \tfrac12 \ne 0. A single curved path overturns the unanimous verdict of every straight line:

\lim_{(x, y) \to (0, 0)} \frac{x^2 y}{x^4 + y^2} \ \text{does not exist.}

The reason is scale: near the origin the parabola y = x^2 hugs the x-axis far more tightly than any straight line does — so tightly that it matches the exact curvature of the denominator's danger zone x^4 + y^2. No straight line is "curved enough" to find that trap; the parabola is. Drag the exponent below (lines vs. the parabola family y = c x^2) and watch the flat line at 0 for every straight approach sit next to a different flat value for every parabola.

This is the classic misconception, and the example above is the classic cure. It feels like checking "every direction" should be exhausting the possibilities — after all, a line can point at any angle. But straight lines are only one special family of paths among infinitely many curved ones, and a function can be tuned (as x^4 in the denominator was) to defeat every line while still failing along some sneakier curve.

Continuity

Once limits are pinned down, continuity is the familiar slogan: f is continuous at (a, b) when the limit exists and equals the value there,

\lim_{(x, y) \to (a, b)} f(x, y) = f(a, b).

Sums, products, quotients (away from zero denominators) and compositions of continuous functions are continuous, so polynomials like x^2 + y^2 are continuous everywhere. The troublemaker above is continuous on all of \mathbb{R}^2 except the origin — and no choice of f(0, 0) can repair it, precisely because the limit there does not exist.

For f : D \subseteq \mathbb{R}^2 \to \mathbb{R} and a point (a, b):

The two-path test can only disprove a limit. To prove one exists you must control every direction at once, and the cleanest tool is the polar substitution x = r\cos\theta, y = r\sin\theta, where r = \sqrt{x^2 + y^2} is the distance to the origin. Approaching (0,0) is exactly r \to 0, for any angle \theta. Consider

g(x, y) = \frac{x^2 y}{x^2 + y^2}.

In polar form the denominator collapses, x^2 + y^2 = r^2, and

g = \frac{(r\cos\theta)^2 (r\sin\theta)}{r^2} = r\,\cos^2\theta\,\sin\theta.

Now |\cos^2\theta\,\sin\theta| \le 1 for every angle, so |g| \le r regardless of \theta. As r \to 0 the bound forces g \to 0 along every path simultaneously — the angle dropped out of the bound, which is the whole point. Hence \lim_{(x, y) \to (0, 0)} g = 0 genuinely exists. (Contrast the bad example: there the polar form is \cos\theta\sin\theta = \tfrac12\sin 2\theta, with no r out front to crush it — the angle survives, so the value depends on direction. And the parabola trap above defeats polar coordinates in a different way: no straight path \theta = \text{const} can trace y = x^2, so a naive "check all angles" polar argument would have missed it too — you must actually bound the expression, not just sample directions.)

This is not an idle worry — it is a genuine bug pattern. Early ray-marching and collision routines in games and physics engines sometimes probed only a handful of grid-aligned directions (up, down, left, right, and the diagonals) when deciding whether a moving object was converging safely onto a target or surface. Numerically it looked fine — every sampled direction agreed — right up until a real trajectory swept in along an untested curve and the simulation glitched. Numerical PDE solvers see the same anisotropic-error phenomenon: a scheme can be perfectly stable along the coordinate axes and misbehave on the diagonal, because "stable along the axes" and "stable in every direction" are, exactly as here, different claims.

Polar coordinates are the mathematician's fix for the same worry: instead of ever having to "try enough directions," the substitution x = r\cos\theta, y = r\sin\theta turns the whole infinite family of straight-line approaches into a single variable r \to 0, with \theta free to be anything — a bound in r alone, uniform in \theta, really does cover every straight direction at once. It just cannot, by itself, cover a curved path like a parabola — which is exactly why the two-path test and the squeeze/polar method are two separate tools, not one.