# Can we have $f$ continuous at $x_0,$ $D_vf(x_0)$ exists for all $v,$ yet $v\to D_vf(x_0)$ is not continuous?

Trying to assimilate the meaning of the differential I have looked for different examples of functions which:

1. Admits all directional derivatives but are not continuous $(f: \mathbb{R}^2 \rightarrow \mathbb{R} \quad ,\quad (x,y) \mapsto \begin{cases} 0 & \text{for } (x,y)=(0,0) \\ \frac{xy^4}{x^4+y^8} & \text{for } (x,y) \neq (0,0) \end{cases})$
2. Admits all directional derivatives and are continuous but not differentiable:$f$ not differentiable at $(0,0)$ but all directional derivatives exist

For what I am looking for now I will use:

Suppose we have a function $f: \mathbb{R}^n \rightarrow \mathbb{R}^m$

that in a point, let say $x_0$, admits all direccional derivatives. Then, we can consider the map

$\phi_{x_{0}}: \mathbb{R}^n \rightarrow \mathbb{R}^m \quad$ $v \mapsto D_{v}f(x_{0}) \quad$ , which sends a vector to its directional derivative in $x_0$.

If I am not mistaken, if this map is linear, it will be the differential of $f$. What I am searching now is:

A function $f: \mathbb{R}^n \rightarrow \mathbb{R}^m$, continuos at $x_0$, which admits all directional derivatives at this point, but in which $\phi_{x_{0}}$ is not continuous.

I don´t know if this would be possible. In the example 2, the function $\phi_{(0,0)}$ is smooth (continuous, although non linear) and I can´t imagine how you could "break" the smoothness without breaking the continuity of $f$ too (that happens in the example 1). I would appreciate if the example is in 2 dimensions ($f: \mathbb{R}^2 \rightarrow \mathbb{R}$) for it to be possible to visualize.

• @Masacroso I don't see how this applies to the OP's question. We only have information at one point $x_0.$ – zhw. Sep 6 '17 at 15:08

Define the function $f:\mathbb{R}^2 \to \mathbb{R}$ such that $f(0) = 0$ and

$$f(r\cos\theta, r\sin\theta) = r \left| \cos\theta \right|^{1/r}.$$

Then $f$ is continuous everywhere and satisfies

$$D_v f(0) = \begin{cases} |v|, & \text{if } v = (v_1, 0) \\ 0, & \text{otherwise} \end{cases}$$

This behavior is transparent from its graph:

$\hspace{5.5em}$

• Great example, thank you – Acas Sep 10 '17 at 12:01

The function $f(x,y)= \text { sgn }(x)\sqrt {x^2+y^2}$ is continuous at $(0,0),$ but $D_u f(0,0) = 1$ for all unit vectors $u$ except for $u =(0,1),(0,-1),$ in which case $D_u f(0,0) = 0.$