[Math] If a multivariate function has a gradient at $x$, then it is always differentiable at $x$, right

calculusderivativesmultivariable-calculusreal-analysisvector analysis

By being differentiable, I mean
a function of several real variables $f: \mathbb{R^m}\rightarrow \mathbb{R}$ is said to be differentiable at a point $x_0$ if there exists a linear map $J: \mathbb{R}^m → \mathbb{R}$ such that
$\lim_{\mathbf{h}\to \mathbf{0}} \frac{\|\mathbf{f}(\mathbf{x_0}+\mathbf{h}) – \mathbf{f}(\mathbf{x_0}) – \mathbf{J}\mathbf{(h)}\|}{\| \mathbf{h} \|} = 0.$

By having a gradient at $x_0$, I mean there exists a vector denoted as $\nabla f$ such that its dot product with any unit vector $v$ is the directional derivative of $f$ along $v$ at the point $x_0$. That is,
$$\nabla f \cdot v = D_v f(x_0)$$

We assume all the directional derivative of $f$ at $x_0$ exists, that being said $f$ may or may not be differentiable at $x_0$, if in addition we assume the gradient exists at $x_0$, then $f$ should be differentiable at $x_0$, right?

I think this is simple or well known question, I can visualize it in the following way: if $f$ has a gradient at $x_0$ then all its directional derivative should lie in the same plane defined by $\nabla f$, therefore it should be differentiable using the definition above. But surprisingly I couldn't find any rigorous proof or material discussing this. Is this too simple or too well-known?

Best Answer

Consider the function $$ f(x,y) = \begin{cases} 1, & y=x^2 \wedge x \ne 0; \\ 0, & \mathrm{otherwise}. \end{cases} $$ This function $f$ satisfies your gradient condition at the origin with $\nabla f(0, 0) = (0, 0)$, yet it is not even continuous at $(0,0)$.

If you want a function which is continuous at $(0,0)$ and has a gradient in your sense, but is still not differentiable, instead let $f(x,y) = \sqrt{|x|}$ along the parabola $y=x^2$.