# continuity and existence of all directional derivatives implies differentiable?

Let $$A\subseteq \mathbb{R}^n$$ be an open subset, and let $$f : A \to \mathbb R$$ be continuous. Assume that all directional derivatives exists. Must $$f$$ be differentiable?

I think $$f$$ doesn't have to be differentiable, but I can't find a counterexample.

You are correct. Consider $$f(x, y) = \begin{cases} \frac{x^3}{x^2+y^2} & \textrm{if}\ (x,y)\neq (0,0) \\ 0 & \textrm{if}\ (x,y) = (0,0) \end{cases}$$ It's continuous at $(0, 0)$, since $$\left|\frac{x^3}{x^2+y^2}\right|=\left|x\right|\frac{x^2}{x^2+y^2}\leq\left|x\right|\to 0$$ for $(x,y)\to (0,0)$. Directional derivatives exist everywhere, including $(0,0)$: $$D_{(u,v)}f(0,0) = \lim_{t\to 0}\frac{1}{t}\left(f(0+tu, 0+tv) - f(0, 0)\right)= \lim_{t\to 0}\frac{t^3u^3}{t\cdot t^2(u^2+v^2)}=\frac{u^3}{u^2+v^2}$$ But were $f$ differentiable, we'd have $$D_{(u,v)}f=\left(D_x\,f\right)\,u + \left(D_y\,f\right)\,v$$ that is, linear with respect to $u$, $v$. As this is clearly not the case, it follows that $f$ is not differentiable at $(0,0)$, even though it's continuous and has directional derivatives.
• I tried to edit your answer, but it seems that my edit was not accepted. $u^2+v^2=1$, since $(u,v)$ is a unit vector. So, the result simplifies to $u^3$. It does not affect your conclusion, of course. Commented Jul 31, 2018 at 17:41