### Chain Rule

Let $y=f\left(u\right)$  be a differentiable function of $u$ and $u=g\left(x\right)$  be a differentiable function of $x$. Then $y=f\left(g\left(x\right)\right)$  is a diffferentiable function of $x$. And,

$\frac{dy}{dx}={f}^{\prime }\left(g\left(x\right)\right)\cdot {g}^{\prime }\left(x\right)$

This is called the chain rule. To see that it is indeed true, we try to find the derivative of $y$  with respect to $x$ using the definition of the derivative.

$\frac{dy}{dx}=\underset{\Delta x\to 0}{\mathrm{lim}}\frac{\Delta y}{\Delta x}$

$=\underset{\Delta x\to 0}{\mathrm{lim}}\frac{\Delta y}{\Delta u}\frac{\Delta u}{\Delta x}$

$=\left(\underset{\Delta x\to 0}{\mathrm{lim}}\frac{\Delta y}{\Delta u}\right)\left(\underset{\Delta x\to 0}{\mathrm{lim}}\frac{\Delta u}{\Delta x}\right)$

$=\left(\underset{\Delta u\to 0}{\mathrm{lim}}\frac{\Delta y}{\Delta u}\right)\left(\underset{\Delta x\to 0}{\mathrm{lim}}\frac{\Delta u}{\Delta x}\right)$

This is because since $u$   is a differentiable function of $x$  , we have $\Delta u\to 0$  whenever $\Delta x\to 0$

$=\frac{dy}{du}\frac{du}{dx}$

$={f}^{\prime }\left(u\right){g}^{\prime }\left(x\right)$

$={f}^{\prime }\left(g\left(x\right)\right){g}^{\prime }\left(x\right)$

Note that we have

$\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx}$

This is another way to write the chain rule. And it helps to write down the chain rule when we are dealing with a chain of function as below.

Suppose $y$   is a differentiable function of $u$   given by $y=f\left(u\right)$ , $u$   in turn is a differentiable function of $x$   given by $u=g\left(x\right)$ , and $x$   in turn is a differentiable function of $t$   given by $x=h\left(t\right)$  , then $y$  is a differentiable function of $t$  and

$\frac{dy}{dt}=\frac{dy}{du}\frac{du}{dx}\frac{du}{dt}$

This is much easier to write than the more complex looking form below

$\frac{dy}{dt}=\left[f\text{'}\left(g\left(h\left(t\right)\right)\right]\left[{g}^{\prime }\left(h\left(t\right)\right)\right]\left[{h}^{\prime }\left(t\right)\right]$

Note that both are same written in different form as you can see from below.

$\frac{dy}{du}={f}^{\prime }\left(u\right)={f}^{\prime }\left(g\left(x\right)\right)={f}^{\prime }\left(g\left(h\left(t\right)\right)\right)$

$\frac{du}{dx}={g}^{\prime }\left(x\right)={g}^{\prime }\left(h\left(t\right)\right)$

$\frac{dx}{dt}={h}^{\prime }\left(t\right)$