# If a multivariate function has a gradient at $x$, then it is always differentiable at $x$, right?

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?

• That’s not the usual meaning that I’ve seen for “having a gradient at $x_0$.” What I’ve always seen it mean in textbooks is only that $\nabla f(x_0)$ exists, i.e., that all of the partial derivatives at $x_0$ exist. That’s not enough to guarantee differentiability, nor is existence of all directional derivatives.
– amd
Commented Apr 18, 2019 at 2:08
• I know the existence of all the partial derivatives does NOT guarantee differentiability. My definition of having a gradient at $x_0$ is from wikipedia. en.wikipedia.org/wiki/Gradient#Definition. I don't know if I should assume the uniqueness of the gradient, but I think it should be the same, you can not have two different gradient vectors which are consistent with all the directional derivatives at the same point.
– Pew
Commented Apr 18, 2019 at 2:13
• If it exists, then how can it not be unique? If $u\cdot v=u\cdot w$ for all $u$, then $v=w$.
– amd
Commented Apr 18, 2019 at 2:15
• Yes, that is the point I realized the same thing.
– Pew
Commented Apr 18, 2019 at 2:18

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$$.
• The definition of gradient linked from that page essentially requires that the function satisfies the definition of differentiability with $J(\mathbf{h}) = \nabla f(\mathbf{x}) \cdot \mathbf{h}$, which is stronger from your definition of gradient. Commented Apr 18, 2019 at 2:38
• Ok, thanks, but I didn't find the requirement $J(h) = \nabla f(x) \cdot h$, where is the link for that requirement?
• The "Formal epsilon-delta definition" section of calculus.subwiki.org/wiki/Gradient_vector is equivalent to $\lim_{\bar h\to 0} \frac{\lVert f(\bar c + \bar h) - f(\bar c) - \bar v \cdot \bar h \rVert}{\lVert \bar h \rVert} = 0$, if you expand that limit in terms of an epsilon-delta definition and then "substitute" $\bar h = \bar x - \bar c$. Commented Apr 18, 2019 at 2:58