A calculus of the absurd

10.5 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

\begin{equation} \frac {dy}{dx} = \frac {dy}{du} \frac {du}{dx} \end{equation}

  • Example 10.5.1 Find the derivative of

    \begin{equation} f(x) = \frac {1}{\sqrt {x} + 2} \end{equation}

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

\begin{equation} f(x) = \frac {1}{\sqrt {x} + 2}. \end{equation}

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

\begin{equation} f(x) = \frac {1}{u} \end{equation}

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

\begin{align} \frac {df}{dx} = \frac {d}{du} \left (\frac {1}{u}\right ) \times \frac {d}{dx} (\sqrt {x} + 2) \end{align}

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

\begin{align} \frac {d}{du} \left (\frac {1}{u}\right ) &= \frac {d}{du} \left (u^{-1}\right ) \\ &= -u^{-2} \\ &= -\frac {1}{u^2} \\ &= -\frac {1}{(\sqrt {x} + 2)^2}. \end{align}

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

\begin{equation} \frac {1}{2} \frac {1}{\sqrt {x}} \end{equation}

Therefore we get that overall

\begin{equation} \frac {df}{dx} = -\frac {1}{2} \times \frac {1}{\sqrt {x}} \times \frac {1}{(\sqrt {x} + 2)^2} \end{equation}