As in the title: If $f\colon\mathbb{R}^n\to\mathbb{R}$ is continuous in $x$ and has directional derivatives $\partial_vf(x)=L(v)\,\forall v\in\mathbb{R}^n$, where $L$ is linear, does this imply that $f$ is totally differentiable?
-
notice the criteria "linear" is important. I think there exist sick examples where the directional derivatives exist in all directions, however, they don't glue together nicely. Linearity forces continuity hence the result. For example: http://math.stackexchange.com/questions/372070/f-not-differentiable-at-0-0-but-all-directional-derivatives-exist?rq=1 – James S. Cook Jul 19 '13 at 04:40
-
yes, you're correct, my (now deleted) post assumed the partials exist near the point, in fact, that calculation shows that bounded partials existing near a point imply continuity at the point (which is interesting). However, the question you ask is different, I'm sure someone will address it soon. – James S. Cook Jul 19 '13 at 05:07
-
2If all partial derivatives of a continuous function exist and at most one is not continuous, the map is differentiable. And this result is optimal. – astro Jul 07 '20 at 20:54
-
I thought of this example before searching on MSE: $$f(x,y)=\sqrt{x^2+y^2}\exp\left(-\left(\frac{y-x^2}{x^3}\right)^2\right)$$ But I prefer John's answer. – mr_e_man May 02 '23 at 06:07
2 Answers
The answer is "no".
Let $f:\mathbb R^2\to\mathbb R$ be defined by $f(x,x^2)=x$ for all $x\in \mathbb R$ and $f(x,y)=0$ if $y\neq x^2$. This function $f$ is continuous at $0$ with $f(0)=0$. For any fixed direction $v$, we have $f(tv)=0$ if $t$ is small enough; so $\partial_v f(0)$ exists with $\partial_vf(0)=0$. But $f$ is not differentiable at $0$ because the only possible (total) differential is $L=0$ and we don't have $f(x,y)=o(\Vert (x,y)\Vert)$ as $(x,y)\to 0$.
- 13,636
-
You are right, thanks. Could my conjecture be saved by adding continuity everywhere? – Bananach Jul 19 '13 at 14:04
-
-
3@Bananach I don't think that adding continuity fixes it, I conjecture you could smooth out the discontinuity hence obtaining an example which is continuous everywhere yet still possesses the non-differentiability at (0,0) with all directional derivatives existing. I'm thinking of using a bump function with a width which decreases to zero as you approach the origin, yet has finite width as you travel along $y=x^2$ for finite distance away from $(0,0)$. I haven't worked out the details... but, does this make sense? – James S. Cook Jul 20 '13 at 19:40
-
1@JamesS.Cook Your idea works. $U = {(x,y) : \frac{1}{2}x^2 < y < 2x^2}$ is open. $F = {(x,x^2) : -1 \le x \le 1}$ is closed. Define a function on $U^c \cap F$ to be $x$ on $(x,x^2)$ and $0$ elsewhere. This is continuous. By the Tietze extension theorem, we may extend this to a continuous function on $\mathbb{R}^2$. By the same argument, it cannot be differentiable, but all directional derivatives will exist. – user3281410 May 20 '17 at 12:09
-
@Bananach If you require that the function is locally lipschitz at the point where the directional derivatives are defined, then your conjecture works. – user3281410 May 20 '17 at 12:10
-
@user3281410 thank you for adding to the discussion here. Most appreciated. – James S. Cook May 20 '17 at 13:53
-
@user3281410 I think you meant the union of F and $ U^{c}$. Thanks for the input. Is there a short argument why Lipschitz does the trick? – Bananach May 20 '17 at 18:35
-
@Bananach Yes you were right about what I meant to type, but I can't edit it now. The argument is similar to the last step in one proof of Rademacher's theorem, which states that locally Lipschitz functions on an open subset of $R^n$ are almost everywhere differentiable. It's not that long, but it won't fit into this box. – user3281410 May 21 '17 at 17:10
-
2@Bananach It is probably no longer relevant to you, but may be to others (myself included) who found this thread: a proof of the statement for Lipschitz functions can be found in [Cui, Pang – Modern Nonconvex Nondifferentiable Optimization, Proposition 4.1.1]. – bongobums Nov 17 '22 at 12:07
The answer is "no."
Let $f: R^2 \to R$ be defined by $f(x,y)= \frac{x^3y}{x^4+y^2}$ for $(x,y) \neq (0,0)$ and $f(0,0) = 0$. This function is continuous; its directional derivative is defined at each point in every direction; and at each point its directional derivative is a linear function of the direction. But, you can check that $f$ is not differentiable at $(0,0)$ by approaching $(0,0)$ along $y=x^2$.
See Foundations of Modern Analysis by Dieudonne, Vol. 1 Chapter VIII Section 4.
- 52,188
- 101