# Continuous function with linear directional derivatives=>Total differentiability?

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: math.stackexchange.com/questions/372070/… – James S. Cook Jul 19 '13 at 4: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 5:07

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$.

• You are right, thanks. Could my conjecture be saved by adding continuity everywhere? – Bananach Jul 19 '13 at 14:04
• This, I don't know... – Etienne Jul 19 '13 at 14:09
• @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
• @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

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$.