# 3 calculus 3 examples

The function ${f(x,y)=\dfrac{xy}{x^2+y^2}}$ might be the world’s most popular example demonstrating that the existence of partial derivatives does not imply differentiability.

But in my opinion, it is somewhat extreme and potentially confusing, with discontinuity added to the mix. I prefer $\displaystyle f(x,y)=\frac{xy}{\sqrt{x^2+y^2}}$

pictured below.

This one is continuous. In fact, it is Lipschitz continuous because the first-order partials ${f_x}$ and ${f_y}$ are bounded. The restriction of ${f}$ to the line ${y=x}$ is ${f(x,y)=x^2/\sqrt{2x^2} = |x|/\sqrt{2}}$, which is a familiar single-variable example of a nondifferentiable function.

To unify the analysis of such examples, let ${f(x,y)=xy\,g(x^2+y^2)}$. Then $\displaystyle f_x = y g+ 2x^2yg'$

With ${g(t)=t^{-1/2}}$, where ${t=x^2+y^2}$, we get $\displaystyle f_x = O(t^{1/2}) t^{-1/2} + O(t^{3/2})t^{-3/2} = O(1),\quad t\rightarrow 0$

By symmetry, ${f_y}$ is bounded as well.

My favorite example from this family is more subtle, with a deceptively smooth graph:

The formula is $\displaystyle f(x,y)=xy\sqrt{-\log(x^2+y^2)}$

Since ${f}$ decays almost quadratically near the origin, it is differentiable at ${(0,0)}$. Indeed, the first order derivatives ${f_x}$ and ${f_y}$ are continuous, as one may observe using ${g(t)=\sqrt{-\log t}}$ above.

And the second-order partials ${f_{xx}}$ and ${f_{yy}}$ are also continuous, if just barely. Indeed, $\displaystyle f_{xx} = 6xy g'+ 4x^3yg''$

Since the growth of ${g}$ is sub-logarithmic, it follows that ${g'(t)=o(t^{-1})}$ and ${g''(t)=o(t^{-2})}$. Hence, $\displaystyle f_{xx} = O(t) o(t^{-1}) + O(t^{2}) o(t^{-2}) = o(1),\quad t\rightarrow 0$

So, ${f_{xx}(x,y)\rightarrow 0 = f_{xx}(0,0)}$ as ${(x,y)\rightarrow (0,0)}$. Even though the graph of ${f_{xx}}$ looks quite similar to the first example in this post, this one is continuous. Can’t trust these plots.

By symmetry, ${f_{yy}}$ is continuous as well.

But the mixed partial ${f_{xy}}$ does not exist at ${(0,0)}$, and tends to ${+\infty}$ as ${(x,y)\rightarrow (0,0)}$. The first claim is obvious once we notice that ${f_x(0,y)= y\, g(y^2)}$ and ${g}$ blows up at ${0}$. The second one follows from $\displaystyle f_{xy} = g + 2(x^2+y^2) g' + 4x^2y^2 g''$

where ${g\rightarrow\infty}$ while the other two terms tend to zero, as in the estimate for ${f_{xx}}$. Here is the graph of ${f_{xy}}$.

This example is significant for the theory of partial differential equations, because it shows that a solution of the Poisson equation ${f_{xx}+f_{yy} = h }$ with continuous ${h}$ may fail to be in ${C^2}$ (twice differentiable, with continuous derivatives). The expected gain of two derivatives does not materialize here.
The situation is rectified by upgrading the continuity condition to Hölder continuity. Then ${f}$ indeed gains two derivatives: if ${h\in C^\alpha}$ for some ${\alpha\in (0,1)}$, then ${f\in C^{2,\alpha}}$. In particular, the Hölder continuity of ${f_{xx} }$ and ${f_{yy} }$ implies the Hölder continuity of ${f_{xy} }$.