Skip to main content

Section 2.5 The chain rule

In addition to learning how to differentiate a variety of basic functions, we have also been developing our ability to use rules to differentiate certain algebraic combinations of them.

State the rule(s) to find the derivative of each of the following combinations of \(f(x) = \sin(x)\) and \(g(x) = x^2\text{:}\)

\begin{equation*} s(x) = 3x^2 - 5\sin(x)\text{,} \end{equation*}
\begin{equation*} p(x) = x^2 \sin(x), \text{and} \end{equation*}
\begin{equation*} q(x) = \frac{\sin(x)}{x^2}\text{.} \end{equation*}
Solution

Finding \(s'\) uses the sum and constant multiple rules, because \(s(x) = 3g(x) - 5f(x)\text{.}\) Determining \(p'\) requires the product rule, because \(p(x) = g(x) \cdot f(x)\text{.}\) To calculate \(q'\) we use the quotient rule, because \(q(x) =\frac{f(x)}{g(x)}\text{.}\)

There is one more natural way to combine basic functions algebraically, and that is by composing them. For instance, let's consider the function

\begin{equation*} C(x) = \sin(x^2)\text{,} \end{equation*}

and observe that any input \(x\) passes through a chain of functions. In the process that defines the function \(C(x)\text{,}\) \(x\) is first squared, and then the sine of the result is taken. Using an arrow diagram,

\begin{equation*} x \longrightarrow x^2 \longrightarrow \sin(x^2)\text{.} \end{equation*}

In terms of the elementary functions \(f\) and \(g\text{,}\) we observe that \(x\) is the input for the function \(g\text{,}\) and the result is used as the input for \(f\text{.}\) We write

\begin{equation*} C(x) = f(g(x)) = \sin(x^2) \end{equation*}

and say that \(C\) is the composition of \(f\) and \(g\text{.}\) We will refer to \(g\text{,}\) the function that is first applied to \(x\text{,}\) as the inner function, while \(f\text{,}\) the function that is applied to the result, is the outer function.

Given a composite function \(C(x) = f(g(x))\) that is built from differentiable functions \(f\) and \(g\text{,}\) how do we compute \(C'(x)\) in terms of \(f\text{,}\) \(g\text{,}\) \(f'\text{,}\) and \(g'\text{?}\) In the same way that the rate of change of a product of two functions, \(p(x) = f(x) \cdot g(x)\text{,}\) depends on the behavior of both \(f\) and \(g\text{,}\) it makes sense intuitively that the rate of change of a composite function \(C(x) = f(g(x))\) will also depend on some combination of \(f\) and \(g\) and their derivatives. The rule that describes how to compute \(C'\) in terms of \(f\) and \(g\) and their derivatives is called the chain rule.

But before we can learn what the chain rule says and why it works, we first need to be comfortable decomposing composite functions so that we can correctly identify the inner and outer functions, as we did in the example above with \(C(x) = \sin(x^2)\text{.}\)

Preview Activity 2.5.1.

For each function given below, identify its fundamental algebraic structure. In particular, is the given function a sum, product, quotient, or composition of basic functions? If the function is a composition of basic functions, state a formula for the inner function \(g\) and the outer function \(f\) so that the overall composite function can be written in the form \(f(g(x))\text{.}\) If the function is a sum, product, or quotient of basic functions, use the appropriate rule to determine its derivative.

  1. \(h(x) = \tan(2^x)\)

  2. \(p(x) = 2^x \tan(x)\)

  3. \(r(x) = (\tan(x))^2\)

  4. \(m(x) = e^{\tan(x)}\)

  5. \(w(x) = \sqrt{x} + \tan(x)\)

  6. \(z(x) = \sqrt{\tan(x)}\)

Subsection 2.5.1 The chain rule

Often a composite function cannot be written in an alternate algebraic form. For instance, the function \(C(x) = \sin(x^2)\) cannot be expanded or otherwise rewritten, so it presents no alternate approaches to taking the derivative. But some composite functions can be expanded or simplified, and these provide a way to explore how the chain rule works.

Let \(f(x) = -4x + 7\) and \(g(x) = 3x - 5\text{.}\) Determine a formula for \(C(x) = f(g(x))\) and compute \(C'(x)\text{.}\) How is \(C'\) related to \(f\) and \(g\) and their derivatives?

Solution

By the rules given for \(f\) and \(g\text{,}\)

\begin{align*} C(x) =\mathstrut \amp f(g(x))\\ =\mathstrut \amp f(3x-5)\\ =\mathstrut \amp -4(3x-5) + 7\\ =\mathstrut \amp -12x + 20 + 7\\ =\mathstrut \amp -12x + 27\text{.} \end{align*}

Thus, \(C'(x) = -12\text{.}\) Noting that \(f'(x) = -4\) and \(g'(x) = 3\text{,}\) we observe that \(C'\) appears to be the product of \(f'\) and \(g'\text{.}\)

It may seem that Example 2.5.2 is too elementary to illustrate how to differentiate a composite fuction. Linear functions are the simplest of all functions, and composing linear functions yields another linear function. While this example does not illustrate the full complexity of a composition of nonlinear functions, at the same time we remember that any differentiable function is locally linear, and thus any function with a derivative behaves like a line when viewed up close. The fact that the derivatives of the linear functions \(f\) and \(g\) are multiplied to find the derivative of their composition turns out to be a key insight.

We now consider a composition involving a nonlinear function.

Let \(C(x) = \sin(2x)\text{.}\) Use the double angle identity to rewrite \(C\) as a product of basic functions, and use the product rule to find \(C'\text{.}\) Rewrite \(C'\) in the simplest form possible.

Solution

Using the double angle identity for the sine function, we write

\begin{equation*} C(x) = \sin(2x) = 2\sin(x)\cos(x)\text{.} \end{equation*}

Applying the product rule and simplifying, we find

\begin{equation*} C'(x) = 2\sin(x)(-\sin(x)) + \cos(x)(2\cos(x)) = 2(\cos^2(x) - \sin^2(x))\text{.} \end{equation*}

Next, we recall that the double angle identity for the cosine,

\begin{equation*} \cos(2x) = \cos^2(x) - \sin^2(x)\text{.} \end{equation*}

Substituting this result into our expression for \(C'(x)\text{,}\) we now have that

\begin{equation*} C'(x) = 2 \cos(2x)\text{.} \end{equation*}

In Example 2.5.3, if we let \(g(x) = 2x\) and \(f(x) = \sin(x)\text{,}\) we observe that \(C(x) = f(g(x))\text{.}\) Now, \(g'(x) = 2\) and \(f'(x) = \cos(x)\text{,}\) so we can view the structure of \(C'(x)\) as

\begin{equation*} C'(x) = 2\cos(2x) = g'(x) f'(g(x))\text{.} \end{equation*}

In this example, as in the example involving linear functions, we see that the derivative of the composite function \(C(x) = f(g(x))\) is found by multiplying the derivatives of \(f\) and \(g\text{,}\) but with \(f'\) evaluated at \(g(x)\text{.}\)

It makes sense intuitively that these two quantities are involved in the rate of change of a composite function: if we ask how fast \(C\) is changing at a given \(x\) value, it clearly matters how fast \(g\) is changing at \(x\text{,}\) as well as how fast \(f\) is changing at the value of \(g(x)\text{.}\) It turns out that this structure holds for all differentiable functions 1  as is stated in the Chain Rule.

Like other differentiation rules, the Chain Rule can be proved formally using the limit definition of the derivative.
Chain Rule.

If \(g\) is differentiable at \(x\) and \(f\) is differentiable at \(g(x)\text{,}\) then the composite function \(C\) defined by \(C(x) = f(g(x))\) is differentiable at \(x\) and

\begin{equation*} C'(x) = f'(g(x)) g'(x)\text{.} \end{equation*}

As with the product and quotient rules, it is often helpful to think verbally about what the chain rule says: “If \(C\) is a composite function defined by an outer function \(f\) and an inner function \(g\text{,}\) then \(C'\) is given by the derivative of the outer function evaluated at the inner function, times the derivative of the inner function.”

It is helpful to identify clearly the inner function \(g\) and outer function \(f\text{,}\) compute their derivatives individually, and then put all of the pieces together by the chain rule.

Determine the derivative of the function

\begin{equation*} r(x) = (\tan(x))^2\text{.} \end{equation*}
Solution

The function \(r\) is composite, with inner function \(g(x) = \tan(x)\) and outer function \(f(x) = x^2\text{.}\) Organizing the key information involving \(f\text{,}\) \(g\text{,}\) and their derivatives, we have

\(f(x) = x^2\) \(g(x) = \tan(x)\)
\(f'(x) = 2x\) \(g'(x) = \sec^2(x)\)
\(f'(g(x)) = 2\tan(x)\)

Applying the chain rule, we find that

\begin{equation*} r'(x) = f'(g(x))g'(x) = 2\tan(x) \sec^2(x)\text{.} \end{equation*}

As a side note, we remark that \(r(x)\) is usually written as \(\tan^2(x)\text{.}\) This is common notation for powers of trigonometric functions: \(\cos^4(x)\text{,}\) \(\sin^5(x)\text{,}\) and \(\sec^2(x)\) are all composite functions, with the outer function a power function and the inner function a trigonometric one.

Activity 2.5.2.

For each function given below, identify an inner function \(g\) and outer function \(f\) to write the function in the form \(f(g(x))\text{.}\) Determine \(f'(x)\text{,}\) \(g'(x)\text{,}\) and \(f'(g(x))\text{,}\) and then apply the chain rule to determine the derivative of the given function.

  1. \(h(x) = \cos(x^4)\)

  2. \(p(x) = \sqrt{ \tan(x) }\)

  3. \(s(x) = 2^{\sin(x)}\)

  4. \(z(x) = \cot^5(x)\)

  5. \(m(x) = (\sec(x) + e^x)^9\)

Hint
  1. The outer function is \(f(x) = \cos(x)\text{.}\)

  2. The outer function is \(f(x) = \sqrt{x}\text{.}\)

  3. The outer function is \(f(x) = 2^x\text{.}\)

  4. The outer function is \(f(x) = x^5\text{.}\)

  5. The outer function is \(f(x) = x^9\text{.}\)

Answer
  1. \(h'(x) = -4x^3\sin(x^4)\text{.}\)

  2. \(h'(x) = \frac{\sec^2(x)}{2\sqrt{\tan(x)}}\text{.}\)

  3. \(h'(x) = 2^{\sin(x)}\ln(2)\cos(x)\text{.}\)

  4. \(h'(x) = -5\cot^4(x) \csc^2(x)\text{.}\)

  5. \(h'(x) = 9(\sec(x)+e^x)^8 (\sec(x)\tan(x) + e^x)\text{.}\)

Solution
  1. The outer function is \(f(x) = \cos(x)\text{,}\) while the inner function is \(g(x) = x^4\text{,}\) and we know that

    \begin{equation*} f'(x) = -\sin(x), g'(x) = 4x^3, \ \text{and} \ f'(g(x)) = -\sin(x^4)\text{.} \end{equation*}

    Hence, by the chain rule,

    \begin{equation*} h'(x) = f'(g(x))g'(x) = -4x^3\sin(x^4)\text{.} \end{equation*}
  2. The outer function is \(f(x) = \sqrt{x}\text{,}\) while the inner function is \(g(x) = \tan(x)\text{,}\) and we know that

    \begin{equation*} f'(x) = \frac{1}{2\sqrt{x}}, g'(x) = \sec^2(x), \ \text{and} \ f'(g(x)) = \frac{1}{2\sqrt{\tan(x)}}\text{.} \end{equation*}

    Hence, by the chain rule,

    \begin{equation*} h'(x) = f'(g(x))g'(x) = \frac{\sec^2(x)}{2\sqrt{\tan(x)}}\text{.} \end{equation*}
  3. The outer function is \(f(x) = 2^x\text{,}\) while the inner function is \(g(x) = \sin(x)\text{,}\) and we know that

    \begin{equation*} f'(x) = 2^x \ln(2), g'(x) = \cos(x), \ \text{and} \ f'(g(x)) = 2^{\sin(x)}\ln(2)\text{.} \end{equation*}

    Hence, by the chain rule,

    \begin{equation*} h'(x) = f'(g(x))g'(x) = 2^{\sin(x)}\ln(2)\cos(x)\text{.} \end{equation*}
  4. The outer function is \(f(x) = x^5\text{,}\) while the inner function is \(g(x) = \cot(x)\text{,}\) and we know that

    \begin{equation*} f'(x) = 5x^4, g'(x) = -\csc^2(x), \ \text{and} \ f'(g(x)) = 5\cot^4(x)\text{.} \end{equation*}

    Hence, by the chain rule,

    \begin{equation*} h'(x) = f'(g(x))g'(x) = -5\cot^4(x) \csc^2(x)\text{.} \end{equation*}
  5. The outer function is \(f(x) = x^9\text{,}\) while the inner function is \(g(x) = \sec(x) + e^x\text{,}\) and we know that

    \begin{equation*} f'(x) = 9x^8, g'(x) = \sec(x)\tan(x) + e^x, \ \text{and} \ f'(g(x)) = 9(\sec(x)+e^x)^8\text{.} \end{equation*}

    Hence, by the chain rule,

    \begin{equation*} h'(x) = f'(g(x))g'(x) = 9(\sec(x)+e^x)^8 (\sec(x)\tan(x) + e^x)\text{.} \end{equation*}

Subsection 2.5.2 Using multiple rules simultaneously

The chain rule now joins the sum, constant multiple, product, and quotient rules in our collection of techniques for finding the derivative of a function through understanding its algebraic structure and the basic functions that constitute it. It takes practice to get comfortable applying multiple rules to differentiate a single function, but using proper notation and taking a few extra steps will help.

Find a formula for the derivative of \(h(t) = 3^{t^2 + 2t}\sec^4(t)\text{.}\)

Solution

We first observe that \(h\) is the product of two functions: \(h(t) = a(t) \cdot b(t)\text{,}\) where \(a(t) = 3^{t^2 + 2t}\) and \(b(t) = \sec^4(t)\text{.}\) We will need to use the product rule to differentiate \(h\text{.}\) And because \(a\) and \(b\) are composite functions, we will need the chain rule. We therefore begin by computing \(a'(t)\) and \(b'(t)\text{.}\)

Writing \(a(t) = f(g(t)) = 3^{t^2 + 2t}\text{,}\) and finding the derivatives of \(f\) and \(g\text{,}\) we have

\(f(t) = 3^t\) \(g(t) = t^2 + 2t\)
\(f'(t) = 3^t \ln(3)\) \(g'(t) = 2t+2\)
\(f'(g(t)) = 3^{t^2 + 2t}\ln(3)\)

Thus, by the chain rule, it follows that \(a'(t) = f'(g(t))g'(t) = 3^{t^2 + 2t}\ln(3) (2t+2)\text{.}\)

Turning next to \(b\text{,}\) we write \(b(t) = r(s(t)) = \sec^4(t)\) and find the derivatives of \(r\) and \(s\text{.}\)

\(r(t) = t^4\) \(s(t) = \sec(t)\)
\(r'(t) = 4t^3\) \(s'(t) = \sec(t)\tan(t)\)
\(r'(s(t)) = 4\sec^3(t)\)

By the chain rule,

\begin{equation*} b'(t) = r'(s(t))s'(t) = 4\sec^3(t)\sec(t)\tan(t) = 4 \sec^4(t) \tan(t)\text{.} \end{equation*}

Now we are finally ready to compute the derivative of the function \(h\text{.}\) Recalling that \(h(t) = 3^{t^2 + 2t}\sec^4(t)\text{,}\) by the product rule we have

\begin{equation*} h'(t) = 3^{t^2 + 2t} \frac{d}{dt}[\sec^4(t)] + \sec^4(t) \frac{d}{dt}[3^{t^2 + 2t}]\text{.} \end{equation*}

From our work above with \(a\) and \(b\text{,}\) we know the derivatives of \(3^{t^2 + 2t}\) and \(\sec^4(t)\text{,}\) and therefore

\begin{equation*} h'(t) = 3^{t^2 + 2t} 4\sec^4(t) \tan(t) + \sec^4(t) 3^{t^2 + 2t}\ln(3) (2t+2)\text{.} \end{equation*}
Activity 2.5.3.

For each of the following functions, find the function's derivative. State the rule(s) you use, label relevant derivatives appropriately, and be sure to clearly identify your overall answer.

  1. \(p(r) = 4\sqrt{r^6 + 2e^r}\)

  2. \(m(v) = \sin(v^2) \cos(v^3)\)

  3. \(h(y) = \frac{\cos(10y)}{e^{4y}+1}\)

  4. \(s(z) = 2^{z^2 \sec (z)}\)

  5. \(c(x) = \sin(e^{x^2})\)

Hint
  1. Use the constant multiple rule first, followed by the chain rule.

  2. Observe that \(m\) is fundamentally a product of composite functions.

  3. Note that \(h\) is a quotient of composite functions.

  4. The function \(s\) is a composite function with outer function \(2^z\text{.}\)

  5. It is possible for a function to be a composite function with more than two functions in the chain.

Answer
  1. \(p'(r) = \frac{4(6r^5 + 2e^r)}{2\sqrt{r^6 + 2e^r}}\text{.}\)

  2. \(m'(v) = -3v^2 \sin(v^2)\sin(v^3) + 2v \cos(v^3)\cos(v^2)\text{.}\)

  3. \(h'(y) = \frac{(e^{4y}+1) [-10\sin(10y)] - \cos(10y) [4e^{4y}]}{(e^{4y}+1)^2}\text{.}\)

  4. \(s'(z) = 2^{z^2\sec(z)} \ln(2) [z^2 \sec(z)\tan(z) + \sec(z) \cdot 2z]\text{.}\)

  5. \(c'(x) = \cos(e^{x^2}) [e^{x^2}\cdot 2x]\text{.}\)

Solution
  1. By the constant multiple rule, \(p'(r) = 4\frac{d}{dr}[\sqrt{r^6 + 2e^r}]\text{.}\) Using the chain rule to complete the remaining derivative, we see that

    \begin{equation*} p'(r) = 4 \frac{1}{2\sqrt{r^6 + 2e^r}} \frac{d}{dr}[r^6 + 2e^r] = \frac{4(6r^5 + 2e^r)}{2\sqrt{r^6 + 2e^r}}\text{.} \end{equation*}
  2. Observe that by the product rule, \(m'(v) = \sin(v^2) \frac{d}{dv}[\cos(v^3)] + \cos(v^3) \frac{d}{dv}[\sin(v^2)]\text{.}\) Applying the chain rule to differentiate \(\cos(v^3)\) and \(\sin(v^2)\text{,}\) we see that

    \begin{equation*} m'(v) = \sin(v^2) [-\sin(v^3) \cdot 3v^2] + \cos(v^3) [\cos(v^2) \cdot 2v] = -3v^2 \sin(v^2)\sin(v^3) + 2v \cos(v^3)\cos(v^2)\text{.} \end{equation*}
  3. By the quotient rule,

    \begin{equation*} h'(y) = \frac{(e^{4y}+1) \frac{d}{dy}[\cos(10y)] - \cos(10y) \frac{d}{dy}[e^{4y}+1]}{(e^{4y}+1)^2}\text{.} \end{equation*}

    Applying the chain rule to differentiate \(\cos(10y)\) and \(e^{4y}\text{,}\) it follows

    \begin{equation*} h'(y) = \frac{(e^{4y}+1) [-10\sin(10y)] - \cos(10y) [4e^{4y}]}{(e^{4y}+1)^2}\text{.} \end{equation*}
  4. By the chain rule, \(s'(z) = 2^{z^2\sec(z)} \ln(2) \frac{d}{dz}[z^2 \sec(z)]\text{.}\) Then by the product rule, we find that

    \begin{equation*} s'(z) = 2^{z^2\sec(z)} \ln(2) [z^2 \sec(z)\tan(z) + \sec(z) \cdot 2z]\text{.} \end{equation*}
  5. If we first apply the chain rule to the outer function (the sine function), note that

    \begin{equation*} c'(x) = \cos(e^{x^2}) \frac{d}{dx}[e^{x^2}]\text{.} \end{equation*}

    Next, we again apply the chain rule, but this time to \(e^{x^2}\text{,}\) and get

    \begin{equation*} c'(x) = \cos(e^{x^2}) [e^{x^2}\cdot 2x]\text{.} \end{equation*}

The chain rule now adds substantially to our ability to compute derivatives. Whether we are finding the equation of the tangent line to a curve, the instantaneous velocity of a moving particle, or the instantaneous rate of change of a certain quantity, if the function under consideration is a composition, the chain rule is indispensable.

Activity 2.5.4.

Use known derivative rules, including the chain rule, as needed to answer each of the following questions.

  1. Find an equation for the tangent line to the curve \(y= \sqrt{e^x + 3}\) at the point where \(x=0\text{.}\)

  2. If \(\displaystyle s(t) = \frac{1}{(t^2+1)^3}\) represents the position function of a particle moving horizontally along an axis at time \(t\) (where \(s\) is measured in inches and \(t\) in seconds), find the particle's instantaneous velocity at \(t=1\text{.}\) Is the particle moving to the left or right at that instant?

  3. At sea level, air pressure is 30 inches of mercury. At an altitude of \(h\) feet above sea level, the air pressure, \(P\text{,}\) in inches of mercury, is given by the function \(P = 30 e^{-0.0000323 h}\text{.}\) Compute \(dP/dh\) and explain what this derivative function tells you about air pressure, including a discussion of the units on \(dP/dh\text{.}\) In addition, determine how fast the air pressure is changing for a pilot of a small plane passing through an altitude of \(1000\) feet.

  4. Suppose that \(f(x)\) and \(g(x)\) are differentiable functions and that the following information about them is known:

    \(x\) \(f(x)\) \(f'(x)\) \(g(x)\) \(g'(x)\)
    \(-1\) \(2\) \(-5\) \(-3\) \(4\)
    \(2\) \(-3\) \(4\) \(-1\) \(2\)
    Table 2.5.6. Data for functions \(f\) and \(g\text{.}\)

    If \(C(x)\) is a function given by the formula \(f(g(x))\text{,}\) determine \(C'(2)\text{.}\) In addition, if \(D(x)\) is the function \(f(f(x))\text{,}\) find \(D'(-1)\text{.}\)

Hint
  1. Let \(f(x) = \sqrt{e^x + 3}\text{.}\) Find \(f'(x)\) and \(f'(0)\text{.}\)

  2. Recall that \(s'(t)\) tells us the instantaneous velocity at time \(t\text{.}\)

  3. Note that the units on \(dP/dh\) are inches of mercury per foot.

  4. Since \(C(x) = f(g(x))\text{,}\) it follows \(C'(x) = f'(g(x))g'(x)\text{.}\) What is \(C'(2)\text{?}\)

Answer
  1. \(y - 2 = \frac{1}{4}(x-0)\text{.}\)

  2. \(P'(1000) = 30 e^{-0.0323} (-0.0000323) \approx -0.000938\) inches of mercury per foot.

  3. \(C'(2) = -10 \text{;}\) \(D'(-1) = -20\text{.}\)

Solution
  1. Let \(f(x) = \sqrt{e^x + 3}\text{.}\) By the chain rule \(f'(x) = \frac{e^x}{2\sqrt{e^x + 3}}\text{,}\) and thus \(f'(0) = \frac{1}{4}\text{.}\) Note further that \(f(0) = \sqrt{1 + 3} = 2\text{.}\) The tangent line is therefore the line through \((0,2)\) with slope \(1/4\text{,}\) which is

    \begin{equation*} y - 2 = \frac{1}{4}(x-0)\text{.} \end{equation*}
  2. Observe that \(s(t) = (t^2 + 1)^{-3}\text{,}\) and thus by the chain rule, \(s'(t) = -3(t^2 + 1)^{-4}(2t)\text{.}\) We therefore see that \(s'(1) = -\frac{6}{16} = -\frac{3}{8}\) inches per second, so the particle is moving left at the instant \(t = 1\text{.}\)

  3. First, \(P'(h) = \frac{dP}{dh} = 30 e^{-0.0000323h} (-0.0000323)\text{.}\) Therefore, \(P'(1000) = 30 e^{-0.0323} (-0.0000323) \approx -0.000938\) inches of mercury per foot. This tells us that the barometric pressure is dropping very slightly for each additional foot of elevation gain.

  4. Since \(C(x) = f(g(x))\text{,}\) it follows \(C'(x) = f'(g(x))g'(x)\text{.}\) Therefore, \(C'(2) = f'(g(2))g'(2)\text{.}\) From the given table, \(g(2) = -1\text{,}\) so applying this result and using additional given information,

    \begin{equation*} C'(2) = f'(-1) g'(2) = (-5)(2) = -10\text{.} \end{equation*}

    For \(D(x) = f(f(x))\text{,}\) the chain rule tells us that \(D'(x) = f'(f(x))f'(x)\text{,}\) so \(D'(-1) = f'(f(-1))f'(-1)\text{.}\) Using the given table, it follows

    \begin{equation*} D'(-1) = f'(2)f'(-1) = (4)(-5) = -20\text{.} \end{equation*}

Subsection 2.5.3 The composite version of basic function rules

As we gain more experience with differention, we will become more comfortable in simply writing down the derivative without taking multiple steps. This is particularly simple when the inner function is linear, since the derivative of a linear function is a constant.

Use the chain rule to differentiate each of the following composite functions whose inside function is linear:

\begin{equation*} \frac{d}{dx} \left[ (5x+7)^{10} \right] = 10(5x+7)^9 \cdot 5\text{,} \end{equation*}
\begin{equation*} \frac{d}{dx} \left[ \tan(17x) \right] = 17\sec^2(17x), \ \text{and} \end{equation*}
\begin{equation*} \frac{d}{dx} \left[ e^{-3x} \right] = -3e^{-3x}\text{.} \end{equation*}

More generally, following is an excellent exercise for getting comfortable with the derivative rules. Write down a list of all the basic functions whose derivatives we know, and list the derivatives. Then write a composite function with the inner function being an unknown function \(u(x)\) and the outer function being a basic function. Finally, write the chain rule for the composite function. The following example illustrates this for two different functions.

To determine

\begin{equation*} \frac{d}{dx}[\sin(u(x))]\text{,} \end{equation*}

where \(u\) is a differentiable function of \(x\text{,}\) we use the chain rule with the sine function as the outer function. Applying the chain rule, we find that

\begin{equation*} \frac{d}{dx}[\sin(u(x))] = \cos(u(x)) \cdot u'(x)\text{.} \end{equation*}

This rule is analogous to the basic derivative rule that \(\frac{d}{dx}[\sin(x)] = \cos(x)\text{.}\)

Similarly, since \(\frac{d}{dx}[a^x] = a^x \ln(a)\text{,}\) it follows by the chain rule that

\begin{equation*} \frac{d}{dx}[a^{u(x)}] = a^{u(x)} \ln(a) \cdot u'(x)\text{.} \end{equation*}

This rule is analogous to the basic derivative rule that \(\frac{d}{dx}[a^{x}] = a^{x} \ln(a)\text{.}\)

Subsection 2.5.4 Summary

  • A composite function is one where the input variable \(x\) first passes through one function, and then the resulting output passes through another. For example, the function \(h(x) = 2^{\sin(x)}\) is composite since \(x \longrightarrow \sin(x) \longrightarrow 2^{\sin(x)}\text{.}\)

  • Given a composite function \(C(x) = f(g(x))\) where \(f\) and \(g\) are differentiable functions, the chain rule tells us that

    \begin{equation*} C'(x) = f'(g(x)) g'(x)\text{.} \end{equation*}

Exercises 2.5.5 Exercises

1. Mixing rules: chain, product, sum.
2. Mixing rules: chain and product.
3. Using the chain rule repeatedly.
4. Derivative involving arbitrary constants \(a\) and \(b\).
5. Chain rule with graphs.
6. Chain rule with function values.
7. A product involving a composite function.
8.

Consider the basic functions \(f(x) = x^3\) and \(g(x) = \sin(x)\text{.}\)

  1. Let \(h(x) = f(g(x))\text{.}\) Find the exact instantaneous rate of change of \(h\) at the point where \(x = \frac{\pi}{4}\text{.}\)

  2. Which function is changing most rapidly at \(x = 0.25\text{:}\) \(h(x) = f(g(x))\) or \(r(x) = g(f(x))\text{?}\) Why?

  3. Let \(h(x) = f(g(x))\) and \(r(x) = g(f(x))\text{.}\) Which of these functions has a derivative that is periodic? Why?

Answer
  1. \(h'\left( \frac{\pi}{4} \right) = \frac{3}{2\sqrt{2}}\text{.}\)

  2. \(r'(0.25) = \cos(0.25^3) \cdot 3(0.25)^2 \approx 0.1875 \gt h'(0.25) = 3\sin^2(0.25) \cdot \cos(0.25) \approx 0.1779\text{;}\) \(r\) is changing more rapidly.

  3. \(h'(x)\) is periodic; \(r'(x)\) is not.

Solution
  1. Since \(h(x) = f(g(x))\text{,}\) by the chain rule we know that \(h'(x) = f'(g(x)) \cdot g'(x)\text{.}\) Using the facts that \(f(x)=x^3\) and \(g(x) = \sin(x)\text{,}\) it follows \(f'(x) = 3x^2\) and \(f'(g(x)) = 3\sin^2(x)\text{,}\) and \(g'(x) = \cos(x)\text{.}\) Therefore,

    \begin{equation*} h'(x) = 3\sin^2(x) \cdot \cos(x) \end{equation*}

    and \(h'\left( \frac{\pi}{4} \right) = 3 \left( \frac{1}{\sqrt{2}} \right)^2 \cdot \frac{1}{\sqrt{2}} = \frac{3}{2\sqrt{2}}\text{.}\)

  2. Note that \(r'(x) = g'(f(x)) \cdot f'(x) = \cos(x^3) \cdot 3x^2\text{.}\) Thus, we have \(r'(0.25) = \cos(0.25^3) \cdot 3(0.25)^2 \approx 0.1875\text{,}\) while using our work from (a), \(h'(0.25) = 3\sin^2(0.25) \cdot \cos(0.25) \approx 0.1779\text{,}\) so since \(|h'(0.25) \lt r'(0.25)|\text{,}\) we see that \(r\) is changing more rapidly.

  3. We have observed in (a) and (b) that \(h'(x) = 3\sin^2(x) \cdot \cos(x)\) and \(r'(x) = \cos(x^3) \cdot 3x^2\text{.}\) Because both parts of the product in \(h'(x)\) are periodic functions, \(h'(x)\) is periodic (with period \(2\pi\)). However, \(r'(x)\) is not periodic, since \(3x^2\) grows without bound as \(x\) increases.

9.

Let \(u(x)\) be a differentiable function. For each of the following functions, determine the derivative. Each response will involve \(u\) and/or \(u'\text{.}\)

  1. \(p(x) = e^{u(x)}\)

  2. \(q(x) = u(e^x)\)

  3. \(r(x) = \cot(u(x))\)

  4. \(s(x) = u(\cot(x))\)

  5. \(a(x) = u(x^4)\)

  6. \(b(x) = u^4(x)\)

Answer
  1. \(p'(x) = e^{u(x)} \cdot u'(x)\text{.}\)

  2. \(q'(x) = u'(e^x) \cdot e^x\text{.}\)

  3. \(r'(x) = -\csc^2(u(x) \cdot u'(x)\text{.}\)

  4. \(s'(x) = u'(\cot(x)) \cdot (-\csc^2(x))\text{.}\)

  5. \(a'(x) = u'(x^4) \cdot 4x^3\text{.}\)

  6. \(b'(x) = 4(u(x))^3 \cdot u'(x)\text{.}\)

Solution
  1. By the chain rule, \(p'(x) = e^{u(x)} \cdot u'(x)\text{.}\)

  2. By the chain rule, \(q'(x) = u'(e^x) \cdot e^x\text{.}\)

  3. By the chain rule, \(r'(x) = -\csc^2(u(x) \cdot u'(x)\text{.}\)

  4. By the chain rule, \(s'(x) = u'(\cot(x)) \cdot (-\csc^2(x))\text{.}\)

  5. By the chain rule, \(a'(x) = u'(x^4) \cdot 4x^3\text{.}\)

  6. By the chain rule, \(b'(x) = 4(u(x))^3 \cdot u'(x)\text{.}\)

10.

Let functions \(p\) and \(q\) be the piecewise linear functions given by their respective graphs in Figure 2.5.9. Use the graphs to answer the following questions.

Figure 2.5.9. The graphs of \(p\) (in blue) and \(q\) (in green).
  1. Let \(C(x) = p(q(x))\text{.}\) Determine \(C'(0)\) and \(C'(3)\text{.}\)

  2. Find a value of \(x\) for which \(C'(x)\) does not exist. Explain your thinking.

  3. Let \(Y(x) = q(q(x))\) and \(Z(x) = q(p(x))\text{.}\) Determine \(Y'(-2)\) and \(Z'(0)\text{.}\)

Answer
  1. \(C'(0) = 0\) and \(C'(3) = -\frac{1}{2}\text{.}\)

  2. Consider \(C'(1)\text{.}\) By the chain rule, we'd expect that \(C'(1) = p'(q(1)) \cdot q'(1)\text{,}\) but we know that \(q'(1)\) does not exist since \(q\) has a corner point at \(x = 1\text{.}\) This means that \(C'(1)\) does not exist either.

  3. Since \(Y(x) = q(q(x))\text{,}\) the chain rule implies that \(Y'(x) = q'(q(x)) \cdot q'(x)\text{,}\) and thus \(Y'(-2) = q'(q(-2)) \cdot q'(-2) = q'(-1) \cdot q'(-2)\text{.}\) But \(q'(-1)\) does not exist, so \(Y'(-2)\) also fails to exist. Using \(Z(x) = q(p(x))\) and the chain rule, we have \(Z'(x) = q'(p(x)) \cdot p'(x)\text{.}\) Therefore \(Z'(0) = q'(p(0)) \cdot p'(0) = q'(-0.5) \cdot p'(0) = 0 \cdot 0.5 = 0\text{.}\)

Solution
  1. By the chain rule, \(C'(x) = p'(q(x)) \cdot q'(x)\text{,}\) so \(C'(0) = p'(q(0)) \cdot q'(0)\) and \(C'(3) = p'(q(3)) \cdot q'(3)\text{.}\) From the graph, we see that \(q(0) = 2\text{,}\) and thus \(C'(0) = p'(2) \cdot q'(0)\text{.}\) Reading the slopes of the lines from the graph, it follows \(C'(0) = 2 \cdot 0 = 0\text{.}\) Similarly, \(q(3) = 0\text{,}\) so \(C'(3) = p'(0) \cdot q'(3) = \frac{1}{2} \cdot (-1) = -\frac{1}{2}\text{.}\)

  2. Consider \(C'(1)\text{.}\) By the chain rule, we'd expect that \(C'(1) = p'(q(1)) \cdot q'(1)\text{,}\) but we know that \(q'(1)\) does not exist since \(q\) has a corner point at \(x = 1\text{.}\) This means that \(C'(1)\) does not exist either.

  3. Since \(Y(x) = q(q(x))\text{,}\) the chain rule implies that \(Y'(x) = q'(q(x)) \cdot q'(x)\text{,}\) and thus \(Y'(-2) = q'(q(-2)) \cdot q'(-2) = q'(-1) \cdot q'(-2)\text{.}\) But \(q'(-1)\) does not exist, so \(Y'(-2)\) also fails to exist. Using \(Z(x) = q(p(x))\) and the chain rule, we have \(Z'(x) = q'(p(x)) \cdot p'(x)\text{.}\) Therefore \(Z'(0) = q'(p(0)) \cdot p'(0) = q'(-0.5) \cdot p'(0) = 0 \cdot 0.5 = 0\text{.}\)

11.

If a spherical tank of radius 4 feet has \(h\) feet of water present in the tank, then the volume of water in the tank is given by the formula

\begin{equation*} V = \frac{\pi}{3} h^2(12-h)\text{.} \end{equation*}
  1. At what instantaneous rate is the volume of water in the tank changing with respect to the height of the water at the instant \(h = 1\text{?}\) What are the units on this quantity?

  2. Now suppose that the height of water in the tank is being regulated by an inflow and outflow (e.g., a faucet and a drain) so that the height of the water at time \(t\) is given by the rule \(h(t) = \sin(\pi t) + 1\text{,}\) where \(t\) is measured in hours (and \(h\) is still measured in feet). At what rate is the height of the water changing with respect to time at the instant \(t = 2\text{?}\)

  3. Continuing under the assumptions in (b), at what instantaneous rate is the volume of water in the tank changing with respect to time at the instant \(t = 2\text{?}\)

  4. What are the main differences between the rates found in (a) and (c)? Include a discussion of the relevant units.

Answer
  1. \(\frac{dV}{dh} = \pi \left(8h-h^2 \right)\text{,}\) cubic feet per foot.

  2. \(\frac{dV}{dt} = \frac{\pi}{3}\left[ 12 \cdot 2 (\sin(\pi t) + 1) \cdot \pi \cos(\pi t) - 3 (\sin(\pi t) + 1)^2 \cdot \pi \cos(\pi t) \right]\) cubic feet per hour.

  3. \(\left. \frac{dV}{dt} \right|_{t=0} = 7 \pi^2\) cubic feet per hour.

  4. In (a) we are determining the instantaneous rate at which the volume changes as we increase the height of the water in the tank, while in (c) we are finding the instantaneous rate at which volume changes as we increase time.

Solution
  1. We are asked to find \(\frac{dV}{dh}\) (the derivative of \(V\) with respect to the independent variable \(h\)) at the instant \(h = 1\text{.}\) If we first expand \(V\) to write

    \begin{equation*} V = \frac{\pi}{3}\left(12h^2 - h^3\right) \end{equation*}

    we find that

    \begin{equation*} \frac{dV}{dh} = \frac{\pi}{3} \left(24h - 3h^2\right) = \pi \left(8h-h^2 \right)\text{,} \end{equation*}

    with units ``cubic feet per foot''.

  2. Now we want to find \(\frac{dV}{dt}\text{,}\) the derivative of \(V\) with respect to the independent variable \(t\text{.}\) Here we can write \(V\) as a function of \(t\) by writing \(V(t) = \frac{\pi}{3}\left(12(h(t))^2 - (h(t))^3\right)\text{,}\) where \(h(t) = \sin(\pi t) + 1\text{.}\) By the chain rule, it follows that

    \begin{equation*} \frac{dV}{dt} = \frac{\pi}{3}\left( 12 \cdot 2 h(t) \cdot h'(t) - 3 (h(t))^2 \cdot h'(t) \right) \end{equation*}

    and hence using \(h(t) = \sin(\pi t) + 1\) and \(h'(t) = \pi \cos(\pi t)\text{,}\)

    \begin{equation*} \frac{dV}{dt} = \frac{\pi}{3}\left[ 12 \cdot 2 (\sin(\pi t) + 1) \cdot \pi \cos(\pi t) - 3 (\sin(\pi t) + 1)^2 \cdot \pi \cos(\pi t) \right] \end{equation*}

    with units ``cubic feet per hour''.

  3. Now we want to find \(\frac{dV}{dt}\) when \(t=0\text{.}\) Using the result from part (b), we have

    \begin{equation*} \left. \frac{dV}{dt} \right|_{t=0} = \frac{\pi}{3}\left[ 12 \cdot 2 (\sin(0) + 1) \cdot \pi \cos(0) - 3 (\sin(0) + 1)^2 \cdot \pi \cos(0) \right] = 7 \pi^2 \end{equation*}

    cubic feet per hour.

  4. In (a) we are determining the instantaneous rate at which the volume changes as we increase the height of the water in the tank, while in (c) we are finding the instantaneous rate at which volume changes as we increase time. The first calculation is a direct one, while the second is more indirect, as it involves the composition of \(V\) with \(h\) as a function of time. In the latter case, both \(h\) and \(V\) are functions of time, which allows us to think not only of how \(V\) is changing as a function of \(h\text{,}\) but also as a function of \(t\text{.}\)