# Can we prove the chain rule without using an artificial trick?

THEOREM 9(THE CHAIN RULE)
If $$g$$ is differentiable at $$a$$, and $$f$$ is differentiable at $$g(a)$$, then $$f\circ g$$ is differentiable at $$a$$, and $$(f\circ g)^{'}(a)=f^{'}(g(a))\cdot g^{'}(a).$$

My proof of this theorem is here:

(1) First consider the case in which for any positive real number $$\epsilon$$, there exists $$h$$ such that $$0<|h|<\epsilon$$ and $$g(a+h)-g(a)=0$$.
In this case, $$\lim_{h\to 0} \frac{g(a+h)-g(a)}{h}=0$$ since $$g'(a)$$ exists and there exists $$h$$ such that $$0<|h|<\epsilon$$ and $$g(a+h)-g(a)=0$$ for any positive real number $$\epsilon$$.
Let $$\phi(h):= \frac{f(g(a+h))-f(g(a))}{g(a+h)-g(a)}$$ if $$g(a+h)-g(a)\neq 0$$.
Let $$\phi(h):=f'(g(a))$$ if $$g(a+h)-g(a) = 0$$.
Then $$\phi$$ is continuous at $$h=0$$ since $$f$$ is differentiable at $$g(a)$$.
$$\frac{f(g(a+h))-f(g(a))}{h} = \phi(h) \cdot \frac{g(a+h)-g(a)}{h}\to f'(g(a))\cdot 0 = f'(g(a))\cdot g'(a) \,\,(h\to 0)$$.

(2) Second consider the case in which there exists a positive real number $$\epsilon$$ such that $$0<|h|<\epsilon\implies g(a+h)-g(a)\neq 0.$$
In this case $$\frac{f(g(a+h))-f(g(a))}{h} = \frac{f(g(a+h))-f(g(a))}{g(a+h)-g(a)} \cdot \frac{g(a+h)-g(a)}{h}\to f'(g(a))\cdot g'(a) \,\,(h\to 0)$$.

I don't like the function $$\phi$$ because it is artificial.
Can we prove the chain rule without using an artificial trick?

• If I attempt to provide an argument that $\phi$ is "natural" and not "aritificial", will this be acceptable? I'd start by saying that it models the "very natural" derivative of a function "with respect to another" in the form of $\frac{d(f \circ g)}{dg}(x)$. Commented Nov 20, 2022 at 6:38
• Do the linear approximation proof that you learned in the multivariable setting. Commented Nov 20, 2022 at 7:13
• The chain rule is super intuitive. A differentiable function is locally linear, which means that if the input to $f$ changes from $x$ to $x+\Delta x$ then the output changes by approximately $f’(x) \Delta x$. Now suppose $f = g \circ h$ and the input changes from $x$ to $x + \Delta x$. The output of $h$ changes by approximately $h’(x) \Delta x$, and so the output of $g$ changes by approximately $g’(h(x)) h’(x) \Delta x$. This reveals that $f’(x) = g’(h(x)) h’(x)$. Keep track of the error terms in these approximations to obtain a rigorous proof. Commented Nov 20, 2022 at 7:33
• There is simply no need of $\phi$ in first case (whether the use is natural or not I can't say, that's personal taste of author). For values of $h$ with $g(a+h) =g(a)$ we have the ratio $(f(g(a+h)) - f(g(a))) /h=0$ and for other values of $h$ the ratio can be written as a product of two ratios one of which is near $f'(g(a))$ and the other one is near $0$ so that $(f\circ g) '(a) =0$. See math.stackexchange.com/a/1853088/72031 Commented Nov 21, 2022 at 2:15
– Stef
Commented Nov 21, 2022 at 13:13

A function $$f: I\to\mathbb R$$ on a set $$I\subseteq \mathbb R$$ is differentiable at $$a\in I$$ if and only if there is $$\varphi:I\to \mathbb R$$ which is continuous at $$a$$ and satisfies $$f(x)-f(a)=\varphi(x)(x-a)$$. Then $$\varphi(a)=f'(a)$$.

If $$f$$ is differentiable at $$a$$ with correspondig function $$\varphi$$ and $$g:f(I)\to\mathbb R$$ is differentiable at $$f(a)$$ with corresponding function $$\gamma$$, we get $$g(f(x))-g(f(a))=\gamma(f(x)) (f(x)-f(a))=\gamma(f(x))\varphi(x)(x-a).$$ Since compostions and products of continuous functions are continuous we get that $$g\circ f$$ is differentiable at $$a$$ with corresponding function $$\gamma(f(x))\varphi(x)$$ whose value at $$a$$ is $$g'(f(a))f'(a)$$.

• And just to make it super obvious to OP and future readers, the function $\phi$ is given by $\phi(x)=\frac{f(x)-f(a)}{x-a}$ if $x\neq a$, and $\phi(a):=f'(a)$. This is a very intuitive thing to try because when $x\neq a$, it is the usual difference quotient, while at $x=a$, we're just "filling in" the removable discontinuity of the difference quotient and making a continuous function (at $a$) out of it (it is removable if and only if $f$ is differentiable at $a$ of course). Commented Nov 20, 2022 at 8:31
• Does this proof generalise to higher dimensions? Commented Nov 21, 2022 at 12:49
• Very good point, @user1551. Unfortunately, it does not so easily. Dealing with the affine-linear approximations provided by the definition of differentiability in higher dimensions requires some more care. Commented Nov 21, 2022 at 13:44
• @user1551 For $\mathbb R^n \rightarrow \mathbb R$, the existence of the derivative at the origin would require that for each vector $v$, there is $\phi_v$ such that $f(tv) = \phi_v(t)f(v)$. There would then have to be linearity, so for any scalars $a,b$ and vectors $v,w$, $\phi_{av+bw}(t) = a\phi_v(t)+b\phi_w(t)$. The gradient is then $[\phi_{e1}(0)...\phi_{en}(0)]$ where $e_i$ are the elementary vectors. For the derivative at other points, you'd have to translate these equations. Commented Nov 22, 2022 at 4:37

If $$f,g$$ are continuously differentiable, then it is possible to prove directly.
Here is an argument:
Using mean value theorem: $$g(a+h) = g(a) + g'(x) h$$ with $$x \in [a,a+h]$$, $$\lim_{h \rightarrow 0} \frac{f(g(a+h))-f(g(a))}{h} = \lim_{h \rightarrow 0} \frac{f(g(a)+g'(x)h)-f(g(a))}{h}$$ Again using mean value theorem, now in $$f$$: $$f(g(a)+h) = f(g(a)) + f'(y) h$$ with $$y \in [g(a),g(a)+h]$$, $$= \lim_{h \rightarrow 0} \frac{f(g(a)) + f'(y) g'(x) h - f(g(a))}{h} = \lim_{h \rightarrow 0} \frac{f'(y)g'(x)h}{h} = f'(g(a)) g'(a)$$

The last step: $$\lim_{h \rightarrow 0} f'(y)g'(x) = f'(g(a)) g'(a)$$ uses the fact that derivatives are continuous.