1.5 The Chain Rule

From what has been discussed so far it might be tempting to think that the derivative of a function like \(\sin\,2x\) is simply \(\cos\,2x\), since the derivative of \(\sin\,x\) is \(\cos\,x\). It turns out that is not correct:

\begin{align*} \ddx\,(\sin\,2x) ~&=~ \ddx\,(2\;\sin\,x\;\cos\,x) \quad\text{(by the double-angle formula for sine)}\\[4pt] &=~ 2\;\ddx\,(\sin\,x\;\cos\,x) \quad\text{(by the Constant Multiple Rule)}\\[4pt] &=~ 2\;\left(\sin\,x \cdot \ddx\,(\cos\,x) ~+~ \cos\,x \cdot \ddx\,(\sin\,x)\right) \quad\text{(by the Product Rule)}\\[4pt] &=~ 2\;\left(\sin\,x \cdot (-\sin\,x) ~+~ \cos\,x \cdot \cos\,x\right)\\[4pt] &=~ 2\;\left(\cos^2 x ~-~ \sin^2 x\right)\\[4pt] &=~ 2\;\cos\,2x \quad\text{(by the double-angle formula for cosine)} \end{align*}

So the derivative of \(\sin\,2x\) is \(2\,\cos\,2x\), not \(\cos\,2x\).

In other words, you cannot simply replace \(x\) by \(2x\) in the derivative formula for \(\sin\,x\). Instead, regard \(\sin\,2x\) as a composition of two functions: the sine function and the \(2x\) function. That is, let \(f(u) = \sin\,u\), where the variable \(u\) itself represents a function of another variable \(x\), namely \(u(x) = 2x\). So since \(f\) is a function of \(u\), and \(u\) is a function of \(x\), then \(f\) is a function of \(x\), namely: \(f(x) = \sin\,2x\). Since \(f\) is a differentiable function of \(u\), and \(u\) is a differentiable function of \(x\), then \(\dfdu\) and \(\dudx\) both exist (with \(\dfdu = \cos\,u\) and \(\dudx = 2\)), and multiplying the derivatives shows that \(f\) is a differentiable function of \(x\):

\begin{align*} \frac{\df}{\cancel{\du}} \cdot \frac{\cancel{\du}}{\dx} ~&=~ \dfdx \quad\text{since the infinitesimals $\du$ cancel, so}\\[4pt] (\cos\,u) \cdot 2 ~&=~ \dfdx \quad\Rightarrow\quad \dfdx ~=~ 2\;\cos\,u ~=~ 2\;\cos\,2x \end{align*}

The above argument holds in general, and is known as the Chain Rule:

Theorem 1.11

Chain Rule: If \(f\) is a differentiable function of \(u\), and \(u\) is a differentiable function of \(x\), then \(f\) is a differentiable function of \(x\), and its derivative with respect to \(x\) is:

\[\dfdx ~=~ \dfdu \cdot \dudx\]

Notice how simple the proof is—the infinitesimals \(\du\) cancel.[1]

The Chain Rule should make sense intuitively. For example, if \(\dfdu = 4\) then that means \(f\) is increasing 4 times as fast as \(u\), and if \(\dudx = 3\) then \(u\) is increasing 3 times as fast as \(x\), so overall \(f\) should be increasing \(12 = 4 \cdot 3\) times as fast as \(x\), exactly as the Chain Rule says.

Example 1.9

Find the derivative of \(f(x) = \sin\,(x^2 + x + 1)\).

Solution: The idea is to make a substitution \(u = x^2 + x + 1\) so that \(f(x) = \sin\,u\). By the Chain Rule,

\begin{align*} \dfdx ~&=~ \dfdu \cdot \dudx\\[4pt] &=~ \ddu\,(\sin\,u) \;\cdot\; \ddx\,(x^2 + x + 1)\\[4pt] &=~ (\cos\,u) \cdot (2x + 1)\\[4pt] &=~ (2x + 1)\,\cos\,(x^2 + x + 1) \end{align*}

after replacing \(u\) by its definition as a function of \(x\) in the last step; the final answer for the derivative should be in terms of \(x\), not \(u\).


In the Chain Rule you can think of the function in question as the composition of an “outer” function \(f\) and an “inner” function \(u\); first take the derivative of the “outer” function then multiply by the derivative of the “inner” function. Think of the “inner” function as a box into which you can put any function of \(x\), and the “outer” function being a function of that empty box.

For instance, for the function \(f(x) = \sin\,(x^2 + x + 1)\) in the previous example, think of the “outer” function as \(\sin\,\Box\), where \(\Box = x^2 + x + 1\) is the “inner” function, so that

\begin{align*} f(x) ~&=~ \sin\,(x^2 + x + 1)\\ &=~ \sin\,\Box\\ \dfdx ~&=~ \left(\cos\,\Box\right) \;\cdot\; \ddx\,\Box\\[4pt] &=~ \left(\cos\,\boxed{x^2 + x + 1}\right) \;\cdot\; \ddx\,\boxed{x^2 + x + 1}\\[4pt] &=~ (2x + 1)\,\cos\,(x^2 + x + 1) \end{align*}

Example 1.10

Find the derivative of \(f(x) = (2x^4 - 3\cos\,x)^{10}\).

Solution: Here the “outer” function is \(f(\Box) = \Box^{10}\) and the “inner” function is \(\Box = u = 2x^4 - 3\cos\,x\):

\[\dfdx ~=~ \dfdu \cdot \dudx ~=~ 10\,\Box^9 \;\cdot\; \ddx\,(\Box) ~=~ 10\,(2x^4 - 3\cos\,x)^9 \;(8x^3 + 3\sin\,x)\]

Recall that the composition \(f \circ g\) of two functions \(f\) and \(g\) is defined as \((f \circ g)(x) = f(g(x))\). Using prime notation the Chain Rule can be written as:

Theorem 1.12

Chain Rule: If \(g\) is a differentiable function of \(x\), and \(f\) is a differentiable function on the range of \(g\), then \(f \circ g\) is a differentiable function of \(x\), and its derivative with respect to \(x\) is:

\[(f \circ g)'(x) ~=~ f'(g(x)) \;\cdot\; g'(x)\]

Using the Chain Rule, the Power Rule can be extended to include exponents that are rational numbers:[2]

Theorem 1.13

\[\ddx\,\left(x^r\right) ~=~ r\,x^{r-1} \quad\text{for any rational number $r$}\]

To prove this, let \(r = m/n\), where \(m\) and \(n\) are integers with \(n \ne 0\). Then \(y = x^r = x^{m/n} = \left(x^m\right)^{1/n}\), so that \(y^n = x^m\). Taking the derivative with respect to \(x\) of both sides of this equation gives

\begin{align*} \ddx\,\left(y^n\right) ~&=~ \ddx\,\left(x^m\right) \quad\text{, so evaluating the left side by the Chain Rule gives}\\[4pt] n y^{n-1} \;\cdot\; \dydx ~&=~ m x^{m-1}\\[4pt] n \left(x^{m/n}\right)^{n-1} \;\cdot\; \dydx ~&=~ m x^{m-1}\\[4pt] \dydx ~&=~ \frac{m x^{m-1}}{n x^{m - (m/n)}} ~=~ \frac{m}{n}\,x^{m - 1 - (m - (m/n))} ~=~ \frac{m}{n}\,x^{(m/n) - 1} ~=~ r\,x^{r-1} \quad\checkmark \end{align*}

Example 1.11

Find the derivative of \(f(x) = \sqrt{x}\).

Solution: Since \(\sqrt{x} = x^{1/2}\) then by the Power Rule:

\[\dfdx ~=~ \ddx\,\left(x^{1/2}\right) ~=~ \frac{1}{2}\,x^{1/2 - 1} ~=~ \frac{1}{2}\,x^{-1/2} ~=~ \frac{1}{2\,\sqrt{x}}\]

Example 1.12

Find the derivative of \(f(x) = \frac{2}{3\sqrt{x}}\).

Solution:

\[\dfdx ~=~ \ddx\,\left(\frac{2}{3}\,x^{-1/2}\right) ~=~ \frac{2}{3} \cdot \frac{-1}{2}\,x^{-3/2} ~=~ -\frac{1}{3\,x^{3/2}}\]

Exercises

A

For Exercises 1-18, find the derivative of the given function.

2

  1. \(f(x) ~=~ (1 ~-~ 5x)^4\)

  2. \(f(x) ~=~ 5\,(x^3 ~+~ x ~-~ 1)^4\)

    2

  3. \(f(x) ~=~ \sqrt{1 ~-~ 2x}\vphantom{{(1-x^2)}^{\tfrac{3}{2}}}\)

  4. \(f(x) ~=~ (1 ~-~ x^2 )^{\tfrac{3}{2}}\)

    2

  5. \(f(x) ~=~ \dfrac{\sqrt{x}}{x ~+~ 1}\)

  6. \(f(x) ~=~ \dfrac{\sqrt{x} ~+~ 1}{\sqrt{x} ~-~ 1}\)

    2

  7. \(f(t) ~=~ \left(\dfrac{1 ~-~ t}{1 ~+~ t}\right)^4\vphantom{\left(\dfrac{x^2 ~+~ 1}{x ~-~ 1}\right)^6}\)

  8. \(f(x) ~=~ \left(\dfrac{x^2 ~+~ 1}{x ~-~ 1}\right)^6\)

    2

  9. \(f(x) ~=~ \sin^2 x\)

  10. \(f(x) ~=~ \cos\,\left(\sqrt{x}\right)\)

    2

  11. \(f(x) ~=~ 3 \tan\,(5x)\)

  12. \(f(x) ~=~ A\,\cos\,(\omega x ~+~ \phi)\) (\(A\), \(\omega\), \(\phi\) are constants)

    2

  13. \(f(x) ~=~ \sec\,(x^2)\vphantom{\left(\dfrac{1}{1 - x}\right)}\)

  14. \(f(x) ~=~ \sin^2 \left(\dfrac{1}{1 - x}\right) ~+~ \cos^2 \left(\dfrac{1}{1 - x}\right)\)

    2

  15. \(L(\beta) ~=~ \dfrac{1}{\sqrt{1 ~-~ \beta^2}}\vphantom{\left(1 ~+~ \left(\dfrac{x - l}{s}\right)^2\right)^{-1}}\)

  16. \(f(x) ~=~ \dfrac{1}{\pi s}\left(1 ~+~ \left(\dfrac{x - l}{s}\right)^2\right)^{-1}\) (\(s\), \(l\) are constants)

    2

  17. \(f(x) ~=~ \cos\,(\cos\,x)\)

  18. \(f(x) ~=~ \sqrt{1 ~+~ \sqrt{x}}\)

B

  1. In a certain type of electronic circuit[3] the overall gain \(A_v\) is given by

    \[A_v ~=~ \frac{A_o}{1 ~-~ T}\]

    where the loop gain \(T\) is a function of the open-loop gain \(A_o\).

    1. Show that

      \[\frac{d \negmedspace A_v}{d\!A_o} ~=~ \frac{1}{1 ~-~ T} ~-~ \frac{A_o}{(1 ~-~ T)^2} \frac{d \negmedspace (1 - T)}{d\!A_o} ~.\]
    2. In the case where \(T\) is directly proportional to \(A_o\), use part (a) to show that

      \[\frac{d \negmedspace A_v}{d\!A_o} ~=~ \frac{1}{(1 ~-~ T)^2} ~.\]

      (Hint: First show that \(\;A_o \cdot \frac{d \negmedspace (1 - T)}{d\!A_o} ~=~ -T\).)

  2. Show that the Chain Rule can be extended to 3 functions: if \(u\) is a differentiable function of \(x\), \(v\) is a differentiable function of \(u\), and \(f\) is a differentiable function of \(v\), then

    \[\dfdx ~=~ \dfdv \;\cdot\; \dvdu \;\cdot\; \dudx\]

    so that \(f\) is a differentiable function of \(x\). Notice that the 3 derivatives are linked together as in a chain (hence the name of the rule). The Chain Rule can be extended to any finite number of functions by the above technique.

  3. In an internal combustion engine, as a piston moves downward the connecting rod rotates the crank in the clockwise direction, as shown in Figure 1.5.1 below.[4]

    tikzpicture[every node/.style=font=] [dashed] (0,-7.5) circle (2.5); [fill=white,line width=1pt,rounded corners,rotate around=15.255:(0,0)] (240:0.9) arc (240:-60:0.9) -- ([shift=(0,-5.7)] 37.875:1.1) arc (37.875:-217.875:1.1) -- cycle; [fill=white,line width=1pt,rotate around=53.13:(0,-7.5)] (0,-6.6) -- (2.5,-6.6) arc (90:-90:0.9) -- (0,-8.4) arc (270:90:0.9); [dashed] (0,0) -- (1.5,-5.5) node[black,pos=0.55,sloped,below] connecting rod node[midway,above right] l; [line width=1pt] (0,0) circle (0.6); (0,0) circle (2pt); [above] at (0,0) A; [line width=1pt] (1.5,-5.5) circle (0.6); (1.5,-5.5) circle (2pt); [below] at (1.5,-5.5) B; [line width=1pt] (0,-7.5) circle (0.6); (0,-7.5) circle (2pt); [below] at (0,-7.5) O; [dashed] (0,-7.5) -- (1.5,-5.5) node[sloped,midway,below] crank; [dashed,latex-latex] (-2.5,-7.5) -- (-0.05,-7.5) node[pos=0.4,fill=white] a; [dashed] (0,-7.5) -- (0,0) node[pos=0.5,left] s; [dashed,-latex] (0,-6.4) arc (90:53.13:1.1); at (0.4,-6.25) ; [line width=1pt] (-1.3,1.2) -- (1.3,1.2) -- (1.3,-1) -- (1.7,-1) -- (1.7,2) -- (-1.7,2) -- (-1.7,-1) -- (-1.3,-1) -- cycle; at (0,1.6) piston; [pattern color=black,pattern=north east lines] (-2,2.4) -- (-1.8,2.4) -- (-1.8,-1.4) -- (-2,-1.4) -- cycle; [line width=1pt] (-1.8,2.4) -- (-1.8,-1.4); [pattern color=black,pattern=north east lines] (2,2.4) -- (1.8,2.4) -- (1.8,-1.4) -- (2,-1.4) -- cycle; [line width=1pt] (1.8,2.4) -- (1.8,-1.4); [linecolor,line width=1.5pt,-latex] (0,2.6) -- (0,2.1); [linecolor,line width=1.5pt,-latex] (2.7,-7.5) arc (360:330:2.7); tikzpicture

    Figure 1.5.1

    The point \(A\) can only move vertically, causing the point \(B\) to move around a circle of radius \(a\) centered at the point \(O\), which is directly below the point \(A\) and does not move. As the crank rotates it makes an angle \(\theta\) with the line \(\overline{OA}\). Let \(l = AB\) and \(s = OA\) as in the picture. Assume that all lengths are measured in centimeters, and let the time variable \(t\) be measured in minutes.

    1. Show that \(s ~=~ a \cos\,\theta ~+~ \left(l^2 ~-~ a^2 \sin^2\theta\right)^{1/2}~\) for \(0 \le \theta \le \pi\).

    2. The mean piston speed is \(\bar{S}_p = 2LN\), where \(L = 2a\) is the piston stroke, and \(N\) is the rotational velocity of the crank, measured in revolutions per minute (rpm). The instantaneous piston velocity is \(S_p = \dsdt\). Let \(R = l/a\). Show that for \(0 \le \theta \le \pi\),

      \[\ABS{\frac{S_p}{\bar{S}_p}} ~=~ \frac{\pi}{2}\,\sin\,\theta \left[1 ~+~ \frac{\cos\,\theta}{\left(R^2 - \sin^2\theta\right)^{1/2}}\right] ~~.\]


  1. Some textbooks give dire warnings to not think that \(\du\) is an actual quantity that can be canceled. However, you can safely ignore those warnings, because \(\du\) is just an infinitesimal and hence can be canceled!
  2. It will be shown in Chapter 2 how to define any real number as an exponent. The Power Rule extends to that case as well.
  3. This is an example of a current-differencing negative feedback amplifier. See pp.473-479 in Schilling, D.L. and C. Belove, Electronic Circuits: Discrete and Integrated, 2nd ed., New York: McGraw-Hill, Inc., 1979.
  4. See pp.43-45 in Heywood, J.B., Internal Combustion Engine Fundamentals, New York: McGraw-Hill Inc., 1988.