Continuity of f(x,y)=xy^2/(x^2 + y^2) at (0,0) with f(0,0)=0

continuitymultivariable-calculus

$$ f(x,y) = \begin{cases} \dfrac{xy^2}{x^2 + y^2} & \text{ if } (x,y) \neq (0,0) \\ 0 & \text{ if } (x,y) = (0,0)\end{cases} $$

(i) Is $f$ continuous at $(0,0)$?

At $(x,y) \neq (0,0)$ this function is continuous, but we needed to check if it is at $(x,y) = (0,0)$. I said:

$$\lim_{r \to 0} \frac{r^3\cos(\theta)\sin^2(\theta)}{r^2(1)} = 0$$

However folks in an IRC said I couldn't use polar coordinates or spherical coordinates and that this was wrong. I don't understand why though.

Best Answer

I'll try to be more elaborate on the point I was trying to get across on the IRC earlier today.

Let's consider the following function, defined in the polar coordinates: $f: [0, \infty) \times (0, 2\pi] \to \mathbb{R}$, $$ f(r, \theta) = \frac{r}{\theta} $$ This is well defined, because our angle argument, $\theta$, varies in $(0, 2\pi]$, and not in $[0, 2\pi)$ as usual. Obviously this does not matter at all, because $2\pi$ determines the same angle as $0$. This function determines a function $\mathbb{R}^2 \to \mathbb{R}$ in a natural way, and I will denote that function by $f$ as well, using $x, y$ coordinates instead of $r, \theta$, hoping that will not cause any confusion. Also, $f(0) = 0$ (because the point $(0, 0) \in \mathbb{R}^2$ is represented in polar coordinates as $(0, \theta)$ for any choice of $\theta$, and $f(0, \theta) = \frac{0}{\theta} = 0$).

So, what's the limit: $$ \lim_{(x, y) \to (0, 0)} f(x, y) = \;? $$

Let's try to solve it using your approach: $$ \lim_{(x, y) \to (0, 0)} f(x, y) = \lim_{r \to 0} \frac{r}{\theta} = 0 $$

Easy, wasn't it? And the resulting value does not depend on $\theta$. Let's conclude thus that the limit is $0$ and call it a day.

Right? Wrong! Consider a sequence (in polar coordinates): $$ x_n = \left(r_n, \theta_n\right) = \left(\frac{1}{n}, \frac{\pi}{n}\right) $$ Basically, we start with $x_1$ which is $(-1, 0)$ in cartesian coordinates, and we go clockwise, approaching half a turn, and going closer and closer to $(0, 0)$ in process. It's obvious that as a sequence of point in a plane, this sequence tends to $(0, 0)$ (because, well, in cartesian coordinates it's $x_n = (r_n \cos \theta_n, r_n \sin \theta_n) = (\frac{1}{n} \cos(\frac{\pi}{n}), \frac{1}{n} \sin(\frac{\pi}{n}))$, and obviously each component tends to $0$ as $n \to \infty$).

Now, if $\lim_{(x, y) \to (0, 0)} f(x, y)$ was in fact $0$, then we would also have $\lim f(x_n) = 0$, because $x_n \to (0, 0)$. But, surprisingly: $$ \lim f(x_n) = \lim f(r_n, \theta_n) = \frac{\frac{1}{n}}{\frac{\pi}{n}} = \frac{1}{\pi} \ne 0 $$

What happened? It turns out, that $\lim_{r \to 0} f(r, \theta) = 0$ does not imply that $\lim_{(x, y) \to (0, 0)} f(x, y) = 0$. When we consider the limit as $r \to 0$, we keep $\theta$ fixed, so we only take a limit along a single straight line passing through the origin. This only implies that if we restrict the our function to any such straight line $L$, and consider a function $f|_L: L \to \mathbb{R}$ it will in fact be continuous at $0$. The problem is that the fact that the restricted function $f|_L: L \to \mathbb{R}$ is continuous at origin for every $L$ passing through origin, it's not enough to conclude that our function is in fact continuous at origin.