# 10.6 The chain rule

The chain rule is used to find the derivatives of "functions of a function". Mathematically, these are written as

$\frac{d}{dx}[y(u(x))]$

and it’s possible to find this just by known the derivatives of $y(u)$ and $u(x)$.

The proof is a little involved, so for the moment you can find it at http://kruel.co/math/chainrule.pdf.

The result we’re after is that

$\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx}$ (10.34)
###### Example 10.6.1

Find the derivative of

$f(x)=\frac{1}{\sqrt{x}+2}$ (10.35)

What is the first thing to do when approaching a question (well after having considered that the chain rule might be relevant)? We must find the nested functions. I find it helpful to think about the parts I find hard to differentiate. For example, in our example, I know how to differentiate $\frac{1}{\text{some variable}}$, and also $\sqrt{x}+2$ but not

$f(x)=\frac{1}{\sqrt{x}+2}.$ (10.36)

Therefore, it is not unreasonable to create a variable $u:=\sqrt{x}+2$ and try to use the chain rule. We can write

$f(x)=\frac{1}{u}$ (10.37)

This can be a little confusing, because $x$ no longer seems to appear in the function, but in reality $u$ is implicitly a function of $x$ (i.e. we know that $u$ depends on $x$). Applying the chain rule we know that

 $\displaystyle\frac{df}{dx}=\frac{d}{du}\left(\frac{1}{u}\right)\times\frac{d}{% dx}(\sqrt{x}+2)$ (10.38)

We now know how to differentiate all the individual pieces. First we know that

 $\displaystyle\frac{d}{du}\left(\frac{1}{u}\right)$ $\displaystyle=\frac{d}{du}\left(u^{-1}\right)$ (10.39) $\displaystyle=-u^{-2}$ (10.40) $\displaystyle=-\frac{1}{u^{2}}$ (10.41) $\displaystyle=-\frac{1}{(\sqrt{x}+2)^{2}}.$ (10.42)

Then we can also differentiate $\sqrt{x}+2$ with respect to $x$, which is just

$\frac{1}{2}\frac{1}{\sqrt{x}}$ (10.43)

Therefore we get that overall

$\frac{df}{dx}=-\frac{1}{2}\times\frac{1}{\sqrt{x}}\times\frac{1}{(\sqrt{x}+2)^% {2}}$ (10.44)