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

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

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}(u){g}^{\prime}(x)$

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

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(u)$ , $u$ in turn is a differentiable function of $x$ given by $u=g(x)$ , and $x$ in turn is a differentiable function of $t$ given by $x=h(t)$ , 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}=[f\text{'}(g(h(t))][{g}^{\prime}(h(t))][{h}^{\prime}(t)]$

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

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

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

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