# Does the converse of the chain rule hold in general?

I've found the following theorem for single variable real valued functions:

The converse of the chain rule: Suppose that $f,g$ and $u$ are related so that $f(x)=g(u(x))$. If $u$ is continuous at $x_0$, $f'(x_0)$ exists and $g'(u(x_0))$ exists and is non-zero; then $u'(x_0)$ is defined and we have: $$f'(x_0)=g'(u(x_0))u'(x_0)$$

I'm interested in knowing if this "other converse" also holds:

Suppose that $f,g$ and $u$ are related so that $f(x)=g(u(x))$. If $g$ is continuous at $u(x_0)$, $f'(x_0)$ exists and $u'(x_0)$ exists and is non-zero; then $g'(u(x_0))$ is defined and we have: $$f'(x_0)=g'(u(x_0))u'(x_0)$$

If anyone is interested here is the proof of the first one (page 12), I tryed to proved the second one in an analogous way but I didn't succeed. For my immediate purposes I would be happy with knowing it holds, and in case it doesn't some counterexample could be instructive.
I'm also interested in knowing if those statements generalises in the obvious way to functions from $\mathbb{R}^n$ to $\mathbb{R}^m$.

• If $u:\mathbf{R}^{n} \to \mathbf{R}^{n}$, if $Du$ is continuous, and if $\det Du(x_{0}) \neq 0$, then $u$ is invertible in some neighborhood of $x_{0}$. If $v$ denotes an inverse of $u$, then $$g(y) = f(v(y))$$ for all $y$ in some neighborhood of $y_{0} = u(x_{0})$. The ordinary chain rule implies $g$ is differentiable at $y_{0}$, and that $$Dg(y_{0}) = Df(x_{0}) Dv(y_{0}) = Df(x_{0}) Du(x_{0})^{-1},$$ or $Df(x_{0}) = Dg(u(x_{0})) Du(x_{0})$. I don't see offhand how to handle the situation where $Du$ is discontinuous at $x_{0}$. – Andrew D. Hwang Jan 16 '17 at 23:19
• @AndrewD.Hwang what about $u:\mathbb{R}^n \to \mathbb{R}^m$ and $g:\mathbb{R}^m \to \mathbb{R}^p$? I guess in this case we can't use the Inverse Function Theorem – la flaca Jan 16 '17 at 23:29
• I have no idea whether the second converse holds, however, the first converse can be generalized in the obvious way. For a proof, see these notes by Bruce Driver (pages 2, 3): math.ucsd.edu/~bdriver/231-02-03/Lecture_Notes/chap22.pdf (though $X$ and $Y$ are Banach spaces, you may just ignore this fact because nowhere does this matter anyway). – user384138 Jan 17 '17 at 0:21

The answer to the first question has been mentioned by user384138 in the comments.

A counterexample for the second question:

Let $$x_0=0$$, $$g(x)=\begin{cases}x\sin(1/x)&x\ne0\\0&x=0\end{cases}$$, and $$u(x)=\begin{cases}(\pi\lfloor1/\pi x\rfloor)^{-1}&x\ne0\\0&x=0\end{cases}$$, then $$f(x)=(g\circ u)(x)\equiv0$$. We have $$u'(0)=\lim\limits_{x\to0}\,(\pi x\lfloor 1/\pi x\rfloor)^{-1}=1$$, $$g$$ is continuous everywhere, and $$g$$ is not differentiable at $$u(0)=0$$.

Now we prove the following. It can be easily generalised (by taking a path), which is left as an exercise. Edit: it also holds in $$\mathbb{R}^n$$, but I currently do not know an elementary proof.

Suppose $$u$$ is continuous in a neighborhood of $$x_0\in\mathbb{R}$$, $$u'(x_0)$$ exists and is nonzero, $$g$$ is defined in a neighborhood of $$u(x_0)$$, and $$f=g\circ u$$ is differentiable at $$x_0$$. Then $$g$$ is differentiable at $$u(x_0)$$, with $$f'(x_0)=g'(u(x_0))u'(x_0).$$

Proof. Without loss of generality, suppose $$x_0=0$$ and $$u'(0)>0$$. In a neighborhood of $$0$$ we have $$u(x)=u(0)+u'(0)x+\varepsilon(x)x$$ where $$\lim_{x\to0}\varepsilon(x)=\varepsilon(0)=0$$. Choose $$\delta>0$$ such that for $$0, $$|\varepsilon(x)|. For $$0 we have \begin{aligned}u(2x/u'(0))&=u(0)+2x+\varepsilon(2x/u'(0))2x/u'(0)\\&>u(0)+2x-(u'(0)/2)2x/u'(0)\\&=u(0)+x\\\text{and }u(x/2u'(0))&=u(0)+x/2+\varepsilon(x/2u'(0))x/2u'(0)\\& Similarly we may deal with the case $$x<0$$ and conclude that if $$|x|$$ is sufficiently small, by continuity of $$u$$ there exists $$y$$ between $$2x/u'(0)$$ and $$x/2u'(0)$$ such that $$u(y)=u(0)+x$$. We have $$\lim_{x\to0}\frac{g(u(x))-g(u(0))}{u(x)-u(0)}=\lim_{x\to0}\frac{g(u(x))-g(u(0))}{x}\Big/\frac{u(x)-u(0)}{x}=f'(0)/u'(0).$$ For any sequence $$x_n\to0$$ where $$|x_n|<\delta u'(0)/2$$, choose $$y_n$$ between $$x_n/2u'(0)$$ and $$2x_n/u'(0)$$ such that $$u(y_n)=u(0)+x_n$$, then $$y_n\to0$$ and $$\lim_{n\to\infty}\frac{g(u(0)+x_n)-g(u(0))}{x_n}=\lim_{n\to\infty}\frac{g(u(y_n))-g(u(0))}{u(y_n)-u(0)}=f'(0)/u'(0),$$ so $$g$$ is differentiable at $$u(0)$$ with $$g'(u(0))=f'(0)/u'(0)$$. $$\quad\square$$

This is not an answer, but we have several versions of a "chain rule" here and I thought it would be useful to be able to compare them side by side, and this won't fit in a comment.

In particular, it's somewhat annoying that the linked text gives the ordinary Chain Rule and the "converse" of the Chain Rule in different notation, so I start by converting the ordinary Chain Rule to the notation of the "converse" (since the other variants also use this notation).

So we have $$f(x) = g(u(x))$$ for all $$x$$ in a suitable domain, and $$x_0$$ is in that domain.

For the usual Chain Rule, the conditions are:

• $$u$$ is differentiable at $$x_0.$$
• $$g$$ is differentiable at $$u(x_0).$$

The consequences are:

• $$f$$ is differentiable at $$x_0.$$
• $$f'(x_0) = g'(u(x_0)) u'(x_0).$$

(The text also gives a condition about $$u(x_0)$$ being in the interior of the image of $$u$$ that other sources omit. I think it actually is unnecessary.)

For the "converse" of the Chain Rule, the conditions are:

• $$u$$ is continuous at $$x_0.$$
• $$g$$ is differentiable at $$u(x_0).$$
• $$f$$ is differentiable at $$x_0.$$
• $$g'(u(x_0)) \neq 0.$$

The consequences are:

• $$u$$ is differentiable at $$x_0.$$
• $$f'(x_0) = g'(u(x_0)) u'(x_0).$$

It's a "converse" in the sense that one of the conditions in each theorem is a consequence in the other, but the "converse" still requires $$u$$ to be continuous and requires an additional condition that has no role in the original Chain Rule.

For the proposed "other converse" of the Chain Rule, the conditions are:

• $$u$$ is differentiable at $$x_0.$$
• $$g$$ is continuous at $$u(x_0).$$
• $$f$$ is differentiable at $$x_0.$$
• $$u'(x_0) \neq 0.$$

The consequences are:

• $$g$$ is differentiable at $$u(x_0).$$
• $$f'(x_0) = g'(u(x_0)) u'(x_0).$$

For the theorem in Johnson Chen's answer, the conditions are:

• $$u$$ is continuous in a neighborhood of $$x_0.$$
• $$u$$ is differentiable at $$x_0.$$
• $$g$$ is defined in a neighborhood of $$u(x_0).$$
• $$f$$ is differentiable at $$x_0.$$
• $$u'(x_0) \neq 0.$$

The consequences are:

• $$g$$ is differentiable at $$u(x_0).$$
• $$f'(x_0) = g'(u(x_0)) u'(x_0).$$

This introduces conditions that must hold within neighborhoods, whereas the other versions put conditions only on individual points.