# Differentiability of composition with every path implies differentiability

I'm struggling with this problem from my book Curso de Analise Vol. 2 by Elon Lages Lima.

Let $U\subseteq \mathbb{R}^n$ be an open set, $a\in U$ and $f:U\to \mathbb{R}$ with the following property: for every $v\in \mathbb{R}^n$ and every path and $g:(-\epsilon,\epsilon)\to U$ with $g(0)=a$ and $g'(0)=v$ the composite map $f\circ g:(-\epsilon,\epsilon)\to R$ satisfies $(f\circ g)'(0)=T(v)$ where $T:\mathbb{R}^n\to\mathbb{R}$ is a fixed linear transformation. Prove that $f$ is differentiable at $a$.

It's clear that one must have $f'(a)=T$ so one has to prove $$\tag 0\lim_{v\to 0}\frac{f(a+v)-f(a)-T(v)}{|v|}=0$$

I can't think of any path other than $t\mapsto a+tv$ but then I'm not using the hypothesis to its full strength. I also tried a proof by negating that limit and trying to construct a path from there, but didn't succeed.

How do I approach the problem? Any hints?

• Are you sure about hypothesis? $(f\circ g)'(0)$ defines directional derivative along $v$, so let's say that you have function $f$ with partial derivative $\partial_x f$. Does it have to be differentiable? Well, no. Mar 4 '17 at 13:06
• @Ennar What do you mean? The derivative $(f\circ g)'(0)$ exists for every path $g$ with those conditions, if you take the path $t\mapsto a+tv$ you get directional derivatives.
– Zero
Mar 4 '17 at 14:18
• Yes, but if I understand correctly, you fixed one $v$ and claim that directional derivative along $v$ exists. Perhaps you mean that for any $v$, directional derivative along $v$ exists? Mar 4 '17 at 14:50
• @Ennar, you are right, I'll clarify.
– Zero
Mar 4 '17 at 17:52
• Related: If you just know that the composition with every differentiable path is differentiable, this would not imply that $f$ is differentiable (see math.stackexchange.com/questions/1111319/…). Thus, you really need the assumption involving the linear map $T$. Mar 4 '17 at 22:36

Hint: Suppose $f$ is not differentiable at $a.$ Then there exists $\epsilon>0$ and a sequence $v_k \to 0$ such that

$$\tag 1\frac{|f(a+ v_k) - f(a) - Tv_k|}{|v_k|} \ge \epsilon$$

for all $k.$ Write $v_k = r_ku_k,$ where $r_k = |v_k|$ and $|u_k|=1.$ Then some subsequence of $u_k,$ which I'll still denote by $u_k,$ converges to some $u, |u|=1.$ Passing to a further subsequence if necessary, we can assume $r_1>r_2 >\cdots.$ The idea is that the sequence $a +v_k = a + r_ku_k$ approaches $a$ tangent to the line $\{a+tu: t \in \mathbb R\}.$ So think of a path $g:\mathbb R \to \mathbb R^n$ such that $g(0)=a$ and $g(r_k) = a+r_ku_k$ for each $k.$ If you do it the right way, you should get $g'(0) = u,$ and because of $(1),$ $(f\circ g)'(0)$ will not exist, giving a contradiction.

I'll accept zhw.'s hint but write the full answer here because the question has received some attention.

Suppose the limit in $(0)$ doesnt exist, then there exists a sequence $v_k$ with $v_k\to 0$ and $v_k\neq 0$ such that

$$\tag 1\frac{|f(a+ v_k) - f(a) - Tv_k|}{|v_k|} \ge \epsilon$$

for all $k$. Write $v_k=r_ku_k$ where $r_k=|v_k|$ and $|u_k|=1$. Then some subsequence of $u_k,$ which I'll still denote by $u_k,$ converges to some $u, |u|=1.$ Passing to a further subsequence if necessary, we can assume $r_1>r_2 >\cdots.$ Now this is the tricky part: how to define $g$. First we define $g$ in $[0,r_1]$. Set $g(0)=a$. For $t\in (0,r_1]$, since $r_k\to 0$ and $r_1>r_2>\cdots$ there is a $k$ such that $t\in[r_{k+1},r_k]$ and we set

$$g(t)=a+r_{k+1}\frac{r_k-t}{r_k-r_{k+1}}u_{k+1}+r_k\frac{t-r_{k+1}}{r_k-r_{k+1}}u_k$$

It's easy to see that $g$ is well defined and $g(r_k)=a+v_k$. Now if $t\in [r_{k+1},r_k]$

$$\frac{g(t)-g(0)}{t}-u=\frac{r_{k+1}(r_k-t)(u_{k+1}-u)+r_k(t-r_{k+1})(u_k-u)}{t(r_k-r_{k+1})}$$

From which one can prove $g_+'(0)=u$. If we set $g(t)=-g(-t)$ for $t\in [-r_1,0]$ we get $g'(0)=u$.

We should have $(f\circ g)'(0)=Tu$, i.e.

$$\tag 2\lim_{t\to 0}\frac{f(g(t))-f(g(0))}{t}=Tu$$

Since $r_k\to 0$, $(2)$ implies that

$$\tag 3\lim_{k\to \infty}\frac{f(g(r_k))-f(g(0))}{r_k}=Tu$$

But $v_k/r_k=u_k\to u$ and $T$ is continuous so

$$\tag 4\lim_{k\to \infty}\frac{1}{r_k}Tv_k=\lim_{k\to \infty}T(\frac{v_k}{r_k})=Tu$$

$(3)$, $(4)$ and the fact that $g(r_k)=a+v_k$, $g(0)=a$ and $|v_k|=r_k$ imply that

$$\lim_{k\to \infty}\frac{f(a+ v_k) - f(a) - Tv_k}{|v_k|}=0$$

contradicting $(1)$.

• In the definition of $g$, should the first $u_k$ be $u_{k+1}$? I also don't understand how to see $g_+^\prime(0)=u$... Jan 24 '18 at 18:33
• @Arrow Yes, that's a typo. I don't recall the details now but the idea was that $g$ is made of straight segments that get arbitrarily small and whose slopes tend to u. I think I did an $\epsilon-\delta$ argument at that time.
– Zero
Jan 28 '18 at 0:15