Skip to main content

Section 3.6 The Chain Rule

References.

The Chain Rule shows how to differentiate compositions of functions, which also allows us to differentiate inverses. These are the last main methods for building new functions from old, and so complete the tools we need to compute the derivatives of all the elementary functions. Along the way we will verify that the power rule works for all real powers, as stated in Section 3.3, and see the easy way to compute the derivative of cosine.
Suppose that \(m\) is length in miles, \(y\) is length in yards, and \(i\) is length in inches. The rate of change of \(y\) relative to \(m\) is 1760: each one mile increase is a 1760 yard increase. Likewise, rate of change of \(i\) relative to \(y\) is 36. So what is the rate of change of \(i\) relative to \(m\text{?}\)
Solution.
Clearly \(1760 \cdot 36\text{,}\) the number of inches in a mile: the rates of change multiply. In formulas, \(y=1760m\) and \(i=36y\text{,}\) and the above results are
\begin{equation*} \frac{dy}{dm} = 1760, \quad \frac{di}{dy} = 36, \quad \frac{di}{dm} = \frac{di}{dy}\frac{dy}{dm} = 36 \cdot 1760. \end{equation*}
In terms of functions, \(i=f(y)=36y\text{,}\) \(y=g(m)=1760m\) and inches as a function of miles is \(i=f(g(m))\text{.}\) Composition takes miles \(m\text{,}\) first applies the “inside” function \(g\) to “input” \(m\) to get yards \(y\text{,}\) and then applies the “outside” function \(f\) to its “input” \(y\) (which is the “output” of \(g\)) to get the final “output” value for inches \(i\text{.}\)
The simple pattern above of multiplying derivatives works for all compositions:

Mnemonic: Treat Derivatives as Quotients of \(dx\text{,}\) \(dy\text{,}\) \(du\text{,}\) etc..

Note the resemblance to simplification of a product of fractions in the last form. The Leibniz notation also emphasizes that the argument \(u\) of the outside function \(y=f(u)\) is different from the argument \(x\) of the inside function \(g(x)\text{.}\)
  1. Compute the derivative of \(F(x)=(x^3+1)^2\) two ways: with and without the Chain Rule.
  2. Repeat for \(F(x)=(x^3+1)^9\) using the Chain Rule.
  3. What would be involved in differentiating \(F(x)=(x^3+1)^9\) without using the Chain Rule?
  1. Compute the derivative of \(f(x) = (\sqrt[5]{x})^5\text{,}\) using the Power Rule and the Chain Rule;
  2. then check by noting that this function is just \(f(x)=x\text{!}\)
Use the facts that \((\sin x)' = \cos x\) and \(\cos(x)=\sin(x+\pi/2)\) to verify that
\begin{equation*} (\cos x)' = -\sin x\text{.} \end{equation*}

Partial Verification of the Chain Rule.

Write \(u\) for \(g(x)\) and let \(\Delta u = g(x + \Delta x) - g(x)\text{,}\) the change in the value of \(g\) caused by changing \(x\) by an amount \(\Delta x\text{,}\) so that \(g(x + \Delta x) = g(x) + \Delta u\text{.}\) The change \(\Delta x\) changes the composition by
\begin{equation*} \Delta y = f(g(x+\Delta x)) - f(g(x)) = f(u + \Delta u) - f(u) \end{equation*}
so the derivative of \(y=F(x)\) is the limit as \(\Delta x \to 0\) of
\begin{equation} \frac{\Delta y}{\Delta x} = \frac{\Delta y}{\Delta u} \frac{\Delta u}{\Delta x},\tag{3.6.3} \end{equation}
so long as \(\Delta u\) is never zero.
Ignoring that possibility for now, as \(\Delta x \to 0\text{,}\) \(\Delta u \to 0\) because \(g\) is continuous, and so
\begin{equation*} \frac{\Delta y}{\Delta u} \to \frac{dy}{du} = f'(u) = f'(g(x)), \frac{\Delta u}{\Delta x} \to \frac{du}{dx} = g'(x), \frac{\Delta y}{\Delta x} \to \frac{dy}{dx} = F'(x). \end{equation*}
Equation (3.6.3) says that the last of these limits is the product of the first two, which is the Chain Rule in Equations (3.6.1) and (3.6.2) above.
The examples so far test the Chain Rule against previous results; let us now use it where there is no other way to get the answer:
Do this two ways, first using the Chain Rule in the Lagrange form (3.6.1) and then using the Leibniz form (3.6.2).
Hint 1.
It is useful at first to introduce a name like \(u\) for the intermediate quantity, the value of the first or “inside” function in the composition.
However with practice, it becomes quicker and more convenient to work directly with formulas all in terms of one variable, the argument of the first function.
Hint 2.
As is often the case with calculus, it can help to rewrite roots in terms of fractional powers.
Differentiate
  • \(\sin x^2\) (\(= \sin(x^2)\))
  • \(\sin^2 x\) (\(= (\sin x)^2\))
What is the intermediate quantity “\(u\)” in each case?
Suggestion: write each function with an abundance of parentheses to avoid ambiguity about the order of operations.
Note from this example the importance of which function comes first in a composition! Also note the convention for squaring the value of a trigonometric function by writing as if one is squaring the name of the function [\(\sin^2\)] as opposed to squaring its argument [\(x^2\)].

Derivatives of Exponentials.

We can now confirm the result for the derivative of any exponential function \(y=f(x)=a^x\text{.}\) Note that the text leaves this till Section 3.9 3  but I like to introduce exponential functions as soon as possible.
Write \(a\) as \(e^{(\ln a)}\text{,}\) so that \(y=a^{x}=\left[e^{(\ln a)}\right]^x=e^{(x \ln a)}\text{,}\) a composition with
  • inside function \(u=(\ln a) x\text{,}\) with derivative the constant \(\ln a\)
  • outside function \(e^u\text{,}\) derivative \(e^u\text{.}\)
The derivative is thus \(\displaystyle \frac{d}{dx}a^{x} = \frac{d}{du}e^{u} \cdot \frac{d}{dx}[(\ln a)x] = e^u (\ln a) = (\ln a) a^x,\) or
\begin{equation} \frac{d}{dx}a^{x} = (\ln a) a^x.\tag{3.6.4} \end{equation}

The Generalized Power Rule.

A common and convenient case of the Chain Rule is when the outside function is a power: \(y=u^r\text{,}\) \(u=g(x)\text{.}\) Then
\begin{equation} \frac{d}{dx}(u^r) = ru^{r-1}\frac{du}{dx}\tag{3.6.5} \end{equation}
or
\begin{equation*} [(g(x))^r]' = r[g(x)]^{r-1}\cdot g'(x). \end{equation*}
Differentiate \(\displaystyle f(x) = \frac{1}{\sqrt[3]{x^2+x+1}}.\)
Hint.
Rewrite roots as powers, and reciprocals of powers as negative powers: this is often useful in calculus.
In fact, the rule for the derivative of a reciprocal can be got just using the chain rule; writing \(1/g(x))\) as \(F(x) = [g(x)]^{-1} = u^{-1}\) so \(u = g(x)\text{,}\)
\begin{equation*} \frac{d}{dx} \frac{1}{g(x)} = \frac{d (u^{-1})}{du} \frac{du}{dx} = (-1)u^{-2} \frac{d g}{d x} = -\frac{d g/d x}{g^2(x)} \end{equation*}
Differentiate \(\displaystyle g(t) = \left( \frac{t-2}{2t+1} \right)^9.\)
Note that this is not overall a composition, but contains two compositions, and we need to use the Product Rule first.

Nested Compositions.

Functions can be produced with multiple nested compositions and then the Chain Rule must be applied repeatedly. My usual guideline applies: look at the order in which the steps in evaluation of the function must be done, and apply differentiation rules from last to first; “from the outside inwards.” This means that the Chain Rule is applied first to the “outer” composition, as this is evaluated last.
Solution.
  1. The outside function is \(\sin\text{,}\) with derivative \(\cos\text{,}\) which is evaluated at \(\tan(x^2)\) because \(\sin\) was: this gives a factor \(\cos(\tan(x^2))\text{.}\)
  2. Next in is the function \(\tan\text{,}\) which has derivative \(\sec^2\text{,}\) and this is evaluated at \(x^2\text{:}\) a factor \(\sec^2(x^2)\text{.}\)
  3. Finally, the innermost function is \(x^2\text{,}\) with derivative \(2x\text{.}\)
Altogether,
\begin{align*} \frac{d}{dx}\sin(\tan(x^2)) \amp= \sin'(\tan(x^2)) \cdot \tan'(x^2) \cdot (x^2)'\\ \amp= \cos(\tan(x^2)) \cdot \sec^2 (x^2) \cdot 2x\\ \amp= 2x \cos(\tan(x^2)) \sec^2(x^2). \end{align*}
Note: put parentheses around the arguments of trig. functions whenever the argument is more than a single letter like “\(x\)”: that avoids any possibly ambiguity about what the argument is, such as in products like this.
Hint.
That innocent looking “\(3\theta\)” means there are two compositions here.

Exercises Exercises

Study Calculus Volume 1, Section 3.6 4 ; in particular Examples 48, 48, 50, 52 and 53, all Checkpoint items, and Exercises 215, 217, 219, 221, 224, 229, 233, 235, 245, 251 and 257.
openstax.org/books/calculus-volume-1/pages/3-6-the-chain-rule
openstax.org/books/calculus-volume-1/pages/3-9-derivatives-of-exponential-and-logarithmic-functions
openstax.org/books/calculus-volume-1/pages/3-9-derivatives-of-exponential-and-logarithmic-functions
openstax.org/books/calculus-volume-1/pages/3-6-the-chain-rule