3.4 The Chain Rule

The chain rule is a rule for differentiating composite functions. Colloquially, it says that if you want to differentiate a composite function, you differentiate the ``outside’’ function first while leaving the “inside” function alone and then you multiply that by the derivative of the inside function.

Theorem (The Chain Rule): Suppose \(f\) and \(g\) are both differentiable functions.

  1. If \(F(x) = f(g(x))\), then the derivative of \(F\) is given by \[F^{\prime}(x) = f^{\prime}(g(x))g^{\prime}(x).\]
  2. If \(y = f(u)\) and \(u = g(x)\), then the derivative of \(y\) is given by \[\dfrac{dy}{dx} = \dfrac{dy}{du}\dfrac{du}{dx}.\]

Example: Find the derivative of \(\sqrt{3x + 5}\).

Solution: In this example, the outside function is \(( )^{1/2}\) while the inside function is \(3x + 5\). One might write \(f(x) = x^{1/2}\) and \(g(x) = 3x+5\) with a goal of finding the derivative of \(F(x) = f(g(x))\). According to the chain rule, the derivative here would be \[F^{\prime}(x) = f^{\prime}(g(x))g^{\prime}(x).\] We know that \(f^{\prime}(x) = \dfrac{1}{2}x^{-1/2}\) and \(g^{\prime}(x) = 3\). Therefore, by the chin rule, \[F^{\prime}(x) = \dfrac{1}{2}(3x+5)^{-1/2}(3) = \dfrac{3}{2\sqrt{3x+5}}.\]

Notice the pattern of the previous answer. We took the outside function and differentiated it. We left the inside function alone (inside the derivative of the outside function) then multiplied everything by the derivative of the inside function.

Example: Find the derivative of \(\sin(3^x)\).

Solution: Here, the outside function is \(f(x) = \sin(x)\) and the inside function is \(g(x) = 3^x\). According to the chain rule, the derivative of \(F(x) = f(g(x))\) is \[F^{\prime}(x) = f^{\prime}(g(x))g^{\prime}(x).\] We know that \(f^{\prime}(x) = \cos(x)\) and \(g^{\prime}(x) = 3^x\ln3\). Therefore, by the chin rule, \[F^{\prime}(x) = \cos(3^x)3^x\ln3.\]

Example: Find the derivative of \(y = e^{5x}\).

Solution: Using Leibnitz notation, we have \(y = f(u) = e^u\) and \(u(x) = 5x\). The derivatives are \(\dfrac{dy}{du} = e^u\) and \(\dfrac{du}{dx} = 5\). Therefore, \[\begin{align*} \dfrac{dy}{dx} &= \dfrac{dy}{du}\dfrac{du}{dx}\\ &=e^u(5)\\ &=5e^{5x}. \end{align*}\] Therefore, the derivative of \(y = e^{5x}\) is \[\dfrac{dy}{dx} = 5e^{5x}.\]

Example: Find the derivative of \(f(x) = e^{4\tan(x)}\).

Solution: The outside function is \(e^x\) while the inside function is \(4\tan(x)\). So, we know that \[f^{\prime}(x) = e^{4\tan(x)}(4\sec^2(x)).\]

Practice Problems

  1. Differentiate.
  • \(y = \cos(2x - 5)\)
  • \(y = (3x + 5)^{50}\)
  • \(y = e^{4x^2 + 3x + 2}\)
  • \(y = \sec(4x - 2)\)
  • \(y = \sin^5(x) + \sin(x^5)\)
  • \(y = (x^3 + 4x + 1)^{500}\)
  • \(y = \sin(4x)\)
  • \(y = \dfrac{1}{(3x + 5)^8}\)
  • \(y = \csc(1/x^2)\)
  • \(y = \sqrt{\sqrt{x} + x}\)
  • \(y = e^{\sin(x)}\)
  • \(y = 5^{e^x}\)
  1. Differentiate.
  • \(y = (2x+4)^9\sec(2x+1)\)
  • \(y = \cot(4^x)e^{3x}\)
  • \(y = (x^3 + 9\sin(x))^5\csc(x)\)
  • \(y = (8x^5 + \sin(x)2^x)\cot(5x)\)
  • \(y = (7x^2 + x\sin(5x) + 1)\sec(8x)\)
  • \(y = e^{4x-1}(\csc(4x) + 6\cot(3x))\)
  • \(y = \dfrac{5\sec(x)}{2^{4x+1}}\)
  • \(y = \dfrac{x}{4\csc^3(x)}\)
  • \(y = \dfrac{4e^x}{\cot^2(x) + \sin(5x)}\)
  • \(y = \dfrac{\cos^6(x) + 3x}{\csc(8x)}\)
  • \(y = \dfrac{\sin(4x)}{2\cot^3(x) + 1}\)
  • \(y = \dfrac{4\sqrt{3^x}}{\sec(5x)}\)

Proof of The Chain Rule

In this section, we prove the chain rule.

Theorem (The Chain Rule): Suppose \(f\) and \(g\) are both differentiable functions.

  1. If \(F(x) = f(g(x))\), then the derivative of \(F\) is given by \[F^{\prime}(x) = f^{\prime}(g(x))g^{\prime}(x).\]
  2. If \(y = f(u)\) and \(u = g(x)\), then the derivative of \(y\) is given by \[\dfrac{dy}{dx} = \dfrac{dy}{du}\dfrac{du}{dx}.\]

Proof: Define \(u = g(x)\). We need to prove \[\dfrac{d}{dx} f(u) = f^{\prime}(u)\dfrac{du}{dx}.\] We begin by determining the derivative of \(u\). Since \(u = g(x)\), we know that \(u\) is a function of \(x\). So, \[u^{\prime}(x) = \lim_{h \rightarrow 0} \dfrac{u(x+h) - u(x)}{h}.\] We also know that \[\mathop {\lim }\limits_{h \to 0} \left( {\frac{{u\left( {x + h} \right) - u\left( x \right)}}{h} - u'\left( x \right)} \right) = \mathop {\lim }\limits_{h \to 0} \frac{{u\left( {x + h} \right) - u\left( x \right)}}{h} - \mathop {\lim }\limits_{h \to 0} u'\left( x \right) = u'\left( x \right) - u'\left( x \right) = 0.\] Define \[v\left( h \right) = \left\{ {\begin{array}{*{20}{l}}{\displaystyle \frac{{u\left( {x + h} \right) - u\left( x \right)}}{h} - u'\left( x \right)}&{{\mbox{ if }}h \ne 0}\\0&{{\mbox{ if }}h = 0}\end{array}} \right.\] Note that \(\displaystyle\lim_{h \rightarrow 0} v(h) = 0 = v(0)\) so that \(v(h)\) is continuous at \(h = 0\).

If \(h \not = 0\), we can rewrite \(v(h)\) to get \(u(x+h) = u(x) + h(v(h) + u^{\prime}(x))\). We note that this expression for \(u(x+h)\) is valid even if we allow \(h = 0\) and so is valid for all \(h\).

Now, since \(f\) is differentiable, we define \(w\) as a function of \(k\) in the following way: \[w\left( k \right) = \left\{ {\begin{array}{*{20}{l}}{\displaystyle \frac{{f\left( {z + k} \right) - f\left( z \right)}}{k} - f'\left( z \right)}&{{\mbox{ if }}k \ne 0}\\0&{{\mbox{ if }}k = 0}\end{array}} \right.\] and a similar argument to the one above shows that \(w(k)\) is continuous at \(k = 0\) and that \[f(z+k) = f(z) + k(w(k) + f^{\prime}(z)).\]

At this point, we need to be able to evaluate \[\dfrac{d}{dx} f(u(x)) = \lim_{h \rightarrow 0} \dfrac{f(u(x+h)) - f(u(x))}{h}.\] Using the results above, we note that \[f(u(x+h)) - f(u(x)) = f(u(x) + h(v(h) + u^{\prime}(x))) - f(u(x)).\] Let \(z = u(x)\) and \(k = h(v(h) + u^{\prime}(x))\), our previous result gives us \[\begin{align*}f\left[ {u\left( {x + h} \right)} \right] - f\left[ {u\left( x \right)} \right] & = f\left[ {u\left( x \right) + h\left( {v\left( h \right) + u'\left( x \right)} \right)} \right] - f\left[ {u\left( x \right)} \right]\\ & = f\left[ {u\left( x \right)} \right] + h\left( {v\left( h \right) + u'\left( x \right)} \right)\left( {w\left( k \right) + f'\left[ {u\left( x \right)} \right]} \right) - f\left[ {u\left( x \right)} \right]\\ & = h\left( {v\left( h \right) + u'\left( x \right)} \right)\left( {w\left( k \right) + f'\left[ {u\left( x \right)} \right]} \right).\end{align*}\] Thus, we have \[\begin{align*}\frac{d}{{dx}}\left[ {f\left[ {u\left( x \right)} \right]} \right] & = \mathop {\lim }\limits_{h \to 0} \frac{{h\left( {v\left( h \right) + u'\left( x \right)} \right)\left( {w\left( k \right) + f'\left[ {u\left( x \right)} \right]} \right)}}{h}\\ & = \mathop {\lim }\limits_{h \to 0} \left( {v\left( h \right) + u'\left( x \right)} \right)\left( {w\left( k \right) + f'\left[ {u\left( x \right)} \right]} \right).\end{align*}\] Next, since \(k = h(v(x) + u^{\prime}(x))\), we have \[\mathop {\lim }\limits_{h \to 0} k = \mathop {\lim }\limits_{h \to 0} h\left( {v\left( h \right) + u'\left( x \right)} \right) = 0.\] So, by the definition of \(w\) and the fact that \(w\) is continuous for all \(k\), we know that \[\mathop {\lim }\limits_{h \to 0} w\left( k \right) = w\left( {\mathop {\lim }\limits_{h \to 0} k} \right) = w\left( 0 \right) = 0.\] Moreover, recall that \(\displaystyle\lim_{h \rightarrow 0}v(h) = 0\). Therefore, \[\begin{align*}\frac{d}{{dx}}\left[ {f\left[ {u\left( x \right)} \right]} \right] & = \mathop {\lim }\limits_{h \to 0} \left( {v\left( h \right) + u'\left( x \right)} \right)\left( {w\left( k \right) + f'\left[ {u\left( x \right)} \right]} \right)\\ & = u'\left( x \right)f'\left[ {u\left( x \right)} \right]\\ & = f'\left[ {u\left( x \right)} \right]\frac{{du}}{{dx}},\end{align*}\] which is exactly what we needed to prove.

Practice Problems

  1. Let \(F(x) = f(g(x))\) with \(g(2) = -2\), \(g^{\prime}(2) = 7\) and \(f^{\prime}(-2) = 7\). Find \(F^{\prime}(2)\).

  2. Let \(F(x) = f(f(x))\) with \(f^{\prime}(13) = 11\), \(f^{\prime}(5) = 8\) and \(f(5) = 13\). Find \(F^{\prime}(5)\).

  3. Find all values of \(x\) on the interval \([0,2\pi]\) where the function \(f(x) = 2\cos(x) + \sin^2(x)\) has a horizontal tangent line.

  4. Let \(H\) be a function satisfying \(H^{\prime}(x) = \dfrac{2}{x}\) for all \(x > 0\). Find an expression for the derivative of \(F(x) = [H(x)]^3\).

  5. Let \(H\) be a function satisfying \(H^{\prime}(x) = \dfrac{2}{x}\) for all \(x > 0\). Find an expression for the derivative of \(F(x) = H(x^3)\).