A function non-differentiable at (0,0) but all traces through (0,0) are differentiable


Scroll down to the bottom to view the interactive graph.


Consider the function \[f(x,y) = \begin{cases} -\dfrac{xy^2}{x^2+y^2} & x \neq 0 \\ 0 & x = 0\end{cases}\] Traces along all directions through \((0,0)\) have tangent lines (i.e. are differentiable) at \((0,0)\). However, there is no single plane that contains all these tangent lines. To see this, we can look at a few of these traces.

A trace passing through \((0,0)\) along the direction \(\theta\) (measured from the \(x\)-axis) can be represented by \((x,y) = (t\cos\theta,t\sin\theta)\). By plugging into \(f\) you get \[f(t\cos\theta,t\sin\theta) = -t\cos\theta\sin^2\theta\] after simplification. It follow that \(df/dt = -\cos\theta\sin^2\theta\).

Along the \(x\)-axis (\(y = 0, \theta = 0\)), \[\left.\dfrac{df}{dt}\right|_{t=0} = \left.\dfrac{\partial f}{\partial x}\right|_{(0,0)} = 0.\] Along the \(y\)-axis, (\(x = 0, \theta = \pi /2\)), \[\left.\dfrac{df}{dt}\right|_{t=0} = \left.\dfrac{\partial f}{\partial y}\right|_{(0,0)} = 0.\] Based on these partial derivatives, we may conclude that \(z = 0\) is the tangent plane. However, if we follow the trace along \(\theta = \pi/4\), then we find that the slope of this tangent line is \[\left.\dfrac{df}{dt}\right|_{t=0} = -\dfrac{1}{\sqrt{8}} \neq 0\] at \((0,0)\) and this tangent line certainly does not lie on the plane \(z = 0\).

The following diagram shows the tangent lines through \((0,0)\) along various directions.

Since there is no plane that can contain all these tangent lines, we conclude that a tangent plane at \((0,0)\) does not exist and \(f\) is not differentiable at \((0,0)\) even derivative exists in all directions.

If a function is non-differentiable at a point, then some of the partial derivatives must be discontinuous at that point. This is illustrated in the following diagram. For the above \(f\), \[\dfrac{\partial f}{\partial x} = \begin{cases} \dfrac{y^2(x^2-y^2)}{(x^2+y^2)^2} & (x,y) \neq (0,0) \\ 0 & (x,y) = (0,0)\end{cases}\] Along \(x = 0\), \[\left.\dfrac{\partial f}{\partial x}\right|_{(0,y)} = \begin{cases} -1 & y \neq 0 \\ 0 & y = 0 \end{cases}\] which says \(\partial f/\partial x\) is discontinuous at \((0,0)\).


To view the interactive graph:

  1. Make sure you have the latest version of Java 7 installed in your computer. Tablets and smartphones are not supported.
  2. Download this file, nondifferentiability.ggb.
  3. Click here to open GeoGebra.
  4. After you open GeoGebra, click "File" in the toolbar, then click "Open".
  5. Choose the .ggb file you just downloaded and click the "Open" button.
  6. Now you should be able to view the graph inside GeoGebra.

To rotate the graph, right click and drag.

Joseph Lo