# How do you prove the chain rule?

Sep 1, 2016

see below

#### Explanation:

i'm gonna make this up on the spot so mea culpa if it's messy but I find Taylor expansions really useful in these sorts of situations

if we start with function$f \left(g \left(x\right)\right)$

and by definition we have

$\frac{\mathrm{df}}{\mathrm{dx}} = {\lim}_{h \to 0} \frac{f \left(g \left(x + h\right)\right) - f \left(g \left(x\right)\right)}{h}$

Using Taylor, we're gonna expand the first bit as follows:

$g \left(x + h\right) = g \left(x\right) + h g ' \left(x\right) + O \left({h}^{2}\right)$

So to clarify, we have
$\frac{\mathrm{df}}{\mathrm{dx}} = {\lim}_{h \to 0} \frac{f \textcolor{red}{\left(g \left(x\right) + h g ' \left(x\right) + O \left({h}^{2}\right)\right)} - f \left(g \left(x\right)\right)}{h}$

now to simplify a little we set: $\eta \left(x\right) = g ' \left(x\right) + O \left(h\right)$

$\frac{\mathrm{df}}{\mathrm{dx}} = {\lim}_{h \to 0} \frac{f \left(g \left(x\right) + h \eta \left(x\right)\right) - f \left(g \left(x\right)\right)}{h} q \quad \square$

And now we're gonna expand $f \left(g \left(x\right) + \eta \left(x\right)\right)$ by the same process

$f \left(g \left(x\right) + h \eta \left(x\right)\right) = f \left(g \left(x\right)\right) + h \eta \left(x\right) f ' \left(g \left(x\right)\right) + O \left({h}^{2}\right)$

$= f \left(g \left(x\right)\right) + h \left(g ' \left(x\right) + O \left(h\right)\right) f ' \left(g \left(x\right)\right) + O \left({h}^{2}\right)$

$= f \left(g \left(x\right)\right) + h f ' \left(g \left(x\right)\right) g ' \left(x\right) + O \left({h}^{2}\right)$

We can put that in $\square$

$\frac{\mathrm{df}}{\mathrm{dx}} = {\lim}_{h \to 0} \frac{f \left(g \left(x\right)\right) + h f ' \left(g \left(x\right)\right) g ' \left(x\right) + O \left({h}^{2}\right) - f \left(g \left(x\right)\right)}{h}$

$\frac{\mathrm{df}}{\mathrm{dx}} = {\lim}_{h \to 0} \frac{h f ' \left(g \left(x\right)\right) g ' \left(x\right) + O \left({h}^{2}\right)}{h}$

$= {\lim}_{h \to 0} f ' \left(g \left(x\right)\right) g ' \left(x\right) + O \left(h\right)$

$= f ' \left(g \left(x\right)\right) g ' \left(x\right)$