Differentiability in two variables is one of those especially challenging concepts in Multivariable Calculus. Its definition is a challenge even for seasoned mathematicians, much less your typical undergraduate student (this will in fact be the subject of an upcoming post/question for the math folks out there). Moreover, multivariable differentiability seems to subscribe to Finagle’s Law: *Anything that can go wrong, will*.

What is interesting, however, is that many examples of the things that go wrong can be found by playing around with *just one function*, specifically, the function

.

Here’s a graph of :

So what dastardly deeds does this function commit against differentiability? Read on to find out!

**Discussion 1: Limits.** You might recognize this function already, as it often turns up in calculus books during the discussion about limits, since it has the property that while the limit does not exist, the function *does *have a limit at the origin when restricted to any straight line. More precisely, note that

,

which implies that when is restricted to the line passing through the point and the origin, it has a constant value of .

In particular, when restricted to either the or axes (so that either or ), then the limiting value is 0. On the other hand, when restricted to the line (so that ), then the limiting value is 1 (this is the red line on the graph above). In particular, has no limit at the origin.

**Discussion 2: Partial derivatives don’t imply differentiability.** The function also typically turns up during the discussion about partial derivatives. In particular, the existence of both partial derivatives at a point is insufficient to prove that a function is even *continuous* at that point, much less differentiable. To see this, imply note that

,

which implies that

.

Hence, both partial derivatives exist at the origin, but the previous discussion shows that is not continuous there.

(In fact, shows something stronger — it has a pair of well-defined partial derivatives *at every point* in the plane, and yet still is discontinuous at the origin.)

**Discussion 3. Directional derivatives don’t imply differentiability.** Sharp students will often note that the existence of just two “directional derivatives” should be insufficient to conclude differentiability in the same way that just two “directional limits” agreeing should be insufficient to conclude a 2-variable limit exists. This is definitely the case with the function — it does not have a directional derivative in any direction not parallel to one of the axes.

However, consider instead the function , pictured below.

Note that when restricted to the line through the origin and the point , we find

.*

In particular, if is a unit-length vector, then the directional derivative of in the direction at the origin is

if (and equals 0 otherwise). Hence, has directional derivatives at the origin in every direction. Nevertheless, it is still discontinuous, since restricted to the curve has constant value … except at the origin.

* As a bonus, has a second cool property. Observe that

.

In particular, has a limiting value of at the origin when restricted to every *line* passing through the origin, and yet still fails to have a limit at the origin.

**Discussion 4. Directional derivatives and the Chain Rule still don’t imply differentiability. **This might take a moment to explain.

*If*a function is differentiable at a point , then its directional derivative can be determined by the Chain Rule as

.

The directional derivatives of the function from the previous discussion clearly do not satisfy this property, as , but the directional derivatives of are nonzero for any direction not parallel to either axis.

A reasonable hypothesis might be that *if* a function had directional derivatives in all directions at a point *and* they satisfied the Chain Rule, *then* the function would be differentiable. (This is certainly true in one variable!)

Unfortunately, this is not to be… consider the function , pictured below:

As in the previous case, observe that when is restricted to the line through the origin and the point , we find

.

In particular, if is a unit-length vector, then the directional derivative of in the direction at the origin is

.

Hence, has directional derivatives of 0 at the origin in every direction, so it satisfies (rather trivially) the Chain Rule at the origin. Yet is still discontinuous, since when restricted to the curve it has constant value 1… except at the origin.

**Discussion 5. In fact, it’s much, much worse than Discussion 4!** It’s an easy argument to show that the hypothesis in the previous discussion is equivalent to the following statement: “If restricted to any line vanishes at the origin of order 2, then is differentiable at the origin, (necessarily with ). ” Can the hypothesis be strengthened enough to ensure this conclusion?

For example, suppose that vanishes at the origin of order (at least) *3* when restricted to any line, that is, that , where the function is bounded near the origin. Does *this* ensure is differentiable?

No. Just consider the function , pictured below:

This would be the desired counterexample. To prove this, let’s in fact consider something more general.

Define , where is an integer. A simple calculation shows that

,

so that vanishes at the origin of order on any line through the origin. Nevertheless, is discontinuous at the origin, since restricted to the curve has constant value 1 … except at the origin.

But it’s even worse than this! It’s possible for a function to vanish at the origin of *infinite order* when restricted to any line segment and *still* fail to muster even continuity! Consider the function defined as for nonzero , and ; this is shown below.

Note that clearly vanishes to infinite order along the *x*-axis. Moreover, when restricted to the line through the origin and the point off the *x*-axis, becomes

.

Since L’Hospital’s Rule implies that for any integer , it follows that this function vanishes at the origin to any order whatsoever.

Nevertheless, when restricted to the curve , the function has constant value 1, which once again implies that cannot be continuous at the origin.

**Discussion 6.** The differentiability of functions of 2 real variables is intimately connected with the differentiability of functions of *1 complex* variable, in that the former is a necessary, but not sufficient, condition for the latter. A typical example of a function that is differentiable in the real sense, but not in the complex one, is the conjugation function . In proving that this is not complex differentiable, we would compute

.

But setting , a quick calculation shows that

,

where is our favorite counterexample! In particular, this calculation shows that the complex function has no limit as , which means that the conjugation function is not complex differentiable at any point in the plane, despite being (infinitely!) differentiable in terms of the real variables .