10.6 The chain rule

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

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

and it’s possible to find this just by known the derivatives of y(u)y(u) and u(x)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

dydx=dydududx\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx} (10.34)
Example 10.6.1

Find the derivative of

f(x)=1x+2f(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 1some variable\frac{1}{\text{some variable}}, and also x+2\sqrt{x}+2 but not

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

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

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

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

dfdx=ddu(1u)×ddx(x+2)\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

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

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

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

Therefore we get that overall

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