# Necessary and sufficient condition for differentiability

1. Jan 4, 2016

### Local

Alright, so now that I think have some more "mathematical maturity", I have decided to go back and review/re-learn multivariable calculus. I've just started, and have gotten to differentiation.

From what I have seen, most books state the following sufficient condition for differentiability:
A function $f: \mathbb{R}^n \rightarrow \mathbb{R}^m$ is differentiable at a point $x$ if all the partial derivatives of all the component functions of $f$ exist and are continuous at $x$, i.e. if $f$ is $C^1$ at $x$.

Many books also seem to state the following necessary condition for differentiability:
If a function $f: \mathbb{R}^n \rightarrow \mathbb{R}^m$ is differentiable at a point $x$, then all directional derivatives of $f$ at $x$ exist.

Neither of these two conditions are both necessary AND sufficient, however, and I have seen examples showing this.

What I have not seen in any book, is a condition that is BOTH necessary AND sufficient. So, I was thinking about how to weaken the above sufficient condition, or strengthen the above necessary condition, in order to get something both necessary and sufficient.

Let me introduce some notation now. Let $Df(x)$ be the derivative of $f$ at $x$, and let $D_{v}f(x)$ be the direction derivative of $f$ at $x$ in the direction $v$.

I know that if a function $f$ is differentiable at $x$, then the $D_{v}f(x) = Df(x) v$. In particular then, it is not enough for the directional derivatives of $f$ at $x$ to exist, but also we need the map $v \rightarrow D_{v}f(x)$ to be linear.

So I thought maybe a necessary and sufficient condition for differentiability is that all directional derivatives must exist, AND that the map $v \rightarrow D_{v}f(x)$ must be linear.

Is this true? I tried searching for this online but was unable to find what I was looking for. I have tried proving this myself, but I am having trouble with the proof. I also have not thought of a counterexample, either.

I have to go now, but I can indicate where I am getting stuck in my proof sometime tomorrow. In the meantime though, if anyone can answer my question and maybe suggest a hint, I'd appreciate it. Thanks for reading all of that!

2. Jan 4, 2016

### Staff: Mentor

It is almost true: continuous partial differentiable ⇒ total differentiable ⇒ differentiable in any direction ⇒ partial differentiable, none of it holds in the other direction. What's missing is that the difference of function values to the differential along $v$ must converge of higher order than 1, i.e. $(f(x+v) - f(x) - D_v f(x)) / ||v|| → 0$ with $||v|| → 0$

3. Jan 5, 2016

### suremarc

Linearity in $v\rightarrow D_vf(x)$ by itself yields a linear map which is the differential of $f$, and hence is a necessary and sufficient condition for differentiability.

4. Jan 5, 2016

### Staff: Mentor

Wikipedia lists the following function as one which has all directional derivatives which are all linear but there is no total differential at $(0,0)$ for $\lim_{h→0} ( f(h^2,h) - f(0,0) - D_{(h^2,h)} f ) / ||(h^2,h)|| = 1/2$.
$$f(x,y) = \bigg\{ \begin{array}{*{20}{c}} { \frac{xy^3}{x^2+y^4} } &, (x,y) ≠ 0 \\ {0} &, (x,y) = 0 \end{array}$$
It might be the case that I haven't understood whether there is a difference between differentiability and total differentiability or I haven't seen a mistake in the article. I just wanted to mention.

5. Jan 5, 2016

### Local

fresh 42, that example answers my question. Thanks. I had overlooked the fact that the zero function is linear.

All the directional derivatives of the function $f$ at the origin exist and are equal to zero. To see this, let $v = (v_1,v_2)$ be any direction. Then
$$D_vf(0) = \lim_{t \rightarrow 0} \frac{f(0+tv) - f(0)}{t} = \lim_{t \rightarrow 0} \frac{t^3 v_1 v_2}{t^2 (v_1^2 + t^2 v_2 ^2)} = 0.$$
So this function satisfies the property that all directional derivatives exist, and that the map $v \rightarrow D_vf(x)$ is linear, and yet the function is not differentiable. So the condition is necessary but still not sufficient. Interesting. Thanks again for your help.

6. Jan 5, 2016

### Staff: Mentor

If you don't mind the language (although it shouldn't be that tough) and concentrate on the functions, here you can find all counter examples:
https://de.wikipedia.org/wiki/Differenzierbarkeit#Gegenbeispiele
(All you perhaps need are: direction = Richtung, continuous = stetig, derivation = Ableitung, twosided = beidseitig)

7. Jan 5, 2016

### suremarc

My apologies, you are correct--next time I'll think twice before skipping the pen and paper.