# Non differentiable function at a point with continuous partial derivatives at that point. Is it possible?

There is a theorem that says: if a function $$f$$ has continuous partial derivatives at a point $$x$$; and existing partial derivatives in a neighborhood of that point $$x$$; then the function is differentiable in $$x$$.

Let’s define this function: $$f:R^2\rightarrow R$$; $$f(x,y)=1$$ if $$xy≠0$$, $$f(x,y)=0$$ if $$xy=0$$.

$$f$$ is clearly not continuous at $$(0,0)$$ (and hence not differentiable), but according to some definitions it’s first partial derivatives are still continuous at $$(0,0)$$.

This shouldn’t be a problem since it’s partial derivatives are not defined in every point in a neighborhood of $$(0,0)$$, so the theorem hypothesis are not met.

1. Is there any example of a function similar to this one (meaning it has continuous partial derivatives at a point $$x$$, but is not differentiable at that point $$x$$ because it’s partials are not defined in a neighborhood of $$x$$) but is also continuous at $$x$$?

Moreover, on Wikipedia they say $$C^1(U) \subset C^0(U)$$ for an open set $$U$$.

1. Having defined $$U=\{(x,y):xy≠0\}\cup(0,0)$$; Surely $$f \notin C^0(U)$$ because it’s not continuous at $$(0,0)$$, but it’s partial derivatives are still continuous in $$U$$, so $$f \in C^1(U)$$, is this possible only because $$U$$ is not an open set?

Please correct me if any of my statements are wrong. Thank you

• Partials does not exist at a point $(0, 0)$ and therefore not continuous at $(0, 0)$. Jun 29 at 15:56
• Your example does not have partial derivatives at $(0,0)$. Moreover, your $U$ is not open. Jun 29 at 15:56
• @Didier could you explain why partials do not exist in $(0,0)$? $f(x,0)=0$, so shouldn’t it’s derivative be 0 for all $x$? Jun 29 at 16:07
• The partial derivatives at $(0,0)$ certainly exist and are $0$. However, $\partial f/\partial y \,(x,0)$ does not exist for $x\ne 0$, and $\partial f/\partial x\,(0,y)$ does not exist for $y\ne 0$. Jun 29 at 19:52
• @MarcoRudelli You're right. I had my geometer's glasses on and forgot that "partial derivatives exists" does not mean "in all directions" but "in the direction of the axes". Sorry about that. Jun 30 at 12:20

The theorem is usually stated in the form: A $$C^1$$ function (on an open set) is differentiable; $$C^1$$ indicates that the function and its partial derivatives are continuous. (A function is $$C^k$$ if all partial derivatives of order $$\le k$$ exist and are continuous. This means that $$f$$ is continuous when we talk about partial derivatives of order $$0$$.)

If you look at the usual proof of the theorem, it is based on two applications of the one-variable Mean Value Theorem. This, in particular, necessitates knowing that the function is continuous on the appropriate horizontal and vertical line segments. But this is a consequence of the existence of the partial derivatives on those segments. So, in fact, continuous partial derivatives on a neighborhood guarantees horizontal and vertical continuity, and this is enough to prove differentiability. But we know that differentiability implies continuity. Interesting, eh?

• Thank you, may I ask if the concept of the proof is the same for the theorem as I stated it, meaning if we relax the hypothesis to just the existence (not continuity) of partials in the neighborhood of the point and continuity of partials at that point? Jun 30 at 15:05
• Yes, that should be fine. Jun 30 at 15:58

To answer the direct question, no it is not possible for a function to simultaneously have defined, continuous partial derivatives and to not be differentiable at any given point. Suppose that we were to take some surface defined by a function $$z = f(x,y)$$, then, in the spirit of Calc 1, we might define an incrementation of $$z$$ at a point $$(x_0,y_0)$$ as follows:

$$\delta z = f(x_0 + \delta x,y_0 + \delta y) - f(x_0,y_0).$$

We can then say that a function $$f$$ is differentiable at a point $$(x_0,y_0)$$ if the incrementation $$\delta z$$ can be written as

$$\delta z = f_x(x_0,y_0)\delta x + f_y(x_0,y_0)\delta y + \varepsilon_1 \delta x + \varepsilon_2 \delta y$$

where the $$\varepsilon_i\rightarrow 0$$ as $$(\delta x, \delta y) \rightarrow 0$$. From this, it should be pretty immediately clear that, if the partial derivatives are defined and continuous at a point, then the function is necessarily differentiable at that point.

At a higher level, we might say that a function $$F:V\rightarrow W$$ between finite dimensional vector spaces (e.g. $$\mathbb{R}^n$$) is differentiable at a point $$p\in U\subseteq V$$ if there is a linear map $$A:V\rightarrow W$$ such that

$$\lim_{v\rightarrow 0}\frac{|F(p + v) - F(p) - Av|}{|v|} = 0$$

(note that this is just a suped-up version of the Calc I definition of derivative. Indeed, whenever you try to define a derivative, you almost always use a definition of this form). The linear map $$A$$ satisfying this relationship is called the total derivative of $$F$$, commonly denoted $$DF$$. When we take $$V,W=\mathbb{R}^n$$ this map is just the Jacobian matrix. For example, if we were to take $$F:\mathbb{R}^2 \rightarrow \mathbb{R}^2:(x,y)\mapsto (F_1(x,y),F_2(x,y)) = (x^2y, \sin(y)),$$ then the total derivative may be given by

$$DF = \begin{pmatrix}DF_1\\DF_2\end{pmatrix} = \begin{pmatrix}\frac{\partial F_1}{\partial x} & \frac{\partial F_1}{\partial y}\\\frac{\partial F_2}{\partial x} & \frac{\partial F_2}{\partial y}\end{pmatrix} = \begin{pmatrix}2xy & x^2 \\ 0 & \cos(y)\end{pmatrix}.$$

Now, the question, as posed, only concerns a map $$G:\mathbb{R}^2\rightarrow \mathbb{R}$$, so we might just take $$G = F_1$$, but note that regardless of the space we are working in, we defined a function to be differentiable so long as the total derivative for the function exists (and is continuous)! So, as long as the components of $$DF$$ are defined and continuous near the point $$p$$, the function is necessarily differentaible.

• I can’t really get this, talking about your first paragraph... where do you use the continuity of the partials hypothesis? To me it seems that what you wrote just shows that the existence of the partials in the point is required (but not sufficient) for differentiability at that point. Jun 29 at 18:30