Skip to main content

Section 3.6 The Chain Rule

Learning Objectives.

  • State the chain rule for the composition of two functions.

  • Apply the chain rule together with the power rule.

  • Apply the chain rule and the product/quotient rules correctly in combination when both are necessary.

We have seen the techniques for differentiating basic functions \((x^n,\text{ etc }.)\) as well as sums, differences, products, quotients, and constant multiples of these functions. However, these techniques do not allow us to differentiate compositions of functions, such as \(h(x)=(9x+1)^2\) or \(k(x)=\sqrt{3x^2+1}.\) In this section, we study the rule for finding the derivative of the composition of two or more functions.

Subsection 3.6.1 Deriving the Chain Rule

When we have a function that is a composition of two or more functions, we could use all of the techniques we have already learned to differentiate it. However, using all of those techniques to break down a function into simpler parts that we are able to differentiate can get cumbersome. Instead, we use the chain rule, which states that the derivative of a composite function is the derivative of the outer function evaluated at the inner function times the derivative of the inner function.

To put this rule into context, let’s take a look at an example: \(h(x)=h(x)=(9x+1)^2.\) We can think of the derivative of this function with respect to \(x\) as the rate of change of \((9x+1)^2\) relative to the change in \(x.\) Consequently, we want to know how \((9x+1)^2\) changes as \(x\) changes. We can think of this event as a chain reaction: As \(x\) changes, \(9x+1\) changes, which leads to a change in \((9x+1)^2.\) This chain reaction gives us hints as to what is involved in computing the derivative of \((9x+1)^2.\) First of all, a change in \(x\) forcing a change in \(9x+1\) suggests that somehow the derivative of \(9x+1\) is involved. In addition, the change in \(9x+1\) forcing a change in \((9x+1)^2\) suggests that the derivative of \(u^2\) with respect to \(u,\) where \(u=9x+1,\) is also part of the final derivative.

We can take a more formal look at the derivative of \(h(x)=(9x+1)^2\) by setting up the limit that would give us the derivative at a specific value \(a\) in the domain of \(h(x)=(9x+1)^2.\)

\begin{equation*} h'(a)=\lim_{x\to a}\frac{(9x+1)^2-(9a+1)^2}{x-a}. \end{equation*}

This expression does not seem particularly helpful; however, we can modify it by factoring the numerator using the difference of squares formula to obtain

\begin{align*} h'(a)\amp=\lim_{x\to a}\frac{\big((9x+1)+(9a+1)\big)\big((9x+1)-(9a+1)\big)}{x-a}.\\ \amp=\lim_{x\to a}\frac{(9x+9a+2)(9x-9a)}{x-a}\\ \amp=\lim_{x\to a}\frac{(9x+9a+2)\cdot 9\cdot(x-a)}{x-a}\\ \amp=\lim_{x\to a}(9x+9a+2)\cdot 9\\ \amp=(18a+2)\cdot 9\\ \amp=2(9a+1)^1\cdot 9 \end{align*}

Thus, \(h'(a)=2(9a+1)\cdot 9\)

In other words, if \(h(x)=(9x+1)^2,\) then \(h'(x)=2(9x+1)\cdot 9.\) Thus, if we think of \(h(x)=(9x+1)^2\) as the composition \((f\circ g)(x)=f(g(x))\) where \(f(x)=x^2\) and \(g(x)=9x+1,\) then the derivative of \(h(x)=(9x+1)^2\) is the product of the derivative of \(g(x)=9x+1\) and the derivative of the function \(f(x)=x^2\) evaluated at the function \(g(x)=9x+1.\) At this point, we anticipate that for \(h(x)=(g(x))^2,\) it is quite likely that \(h'(x)=2(g(x))\cdot g'(x).\) As we determined above, this is the case for \(h(x)=(9x+1)^2.\)

Now that we have derived a special case of the chain rule, we state the general case and then apply it in a general form to other composite functions.

Note 3.103. Rule: The Chain Rule.

Let \(f\) and \(g\) be functions. For all \(x\) in the domain of \(g\) for which \(g\) is differentiable at \(x\) and \(f\) is differentiable at \(g(x),\) the derivative of the composite function

\begin{equation*} h(x)=(f\circ g)(x)=f(g(x)) \end{equation*}

is given by

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

Alternatively, if \(y\) is a function of \(u,\) and \(u\) is a function of \(x,\) then

\begin{equation*} \frac{dy}{dx}=\frac{dy}{du}\cdot \frac{du}{dx}. \end{equation*}

Note 3.105. Problem-Solving Strategy: Applying the Chain Rule.

  1. To differentiate \(h(x)=f(g(x)),\) begin by identifying \(f(x)\) and \(g(x).\)

  2. Find \(f'(x)\) and evaluate it at \(g(x)\) to obtain \(f'(g(x)).\)

  3. Find \(g'(x).\)

  4. Write \(h'(x)=f'(g(x))\cdot g'(x).\)

Note: When applying the chain rule to the composition of two or more functions, keep in mind that we work our way from the outside function in. It is also useful to remember that the derivative of the composition of two functions can be thought of as having two parts; the derivative of the composition of three functions has three parts; and so on. Also, remember that we never evaluate a derivative at a derivative.

Subsection 3.6.2 The Chain and Power Rules Combined

We can now apply the chain rule to composite functions, but note that we often need to use it with other rules. For example, to find derivatives of functions of the form \(h(x)=(g(x))^n ,\) we need to use the chain rule combined with the power rule. To do so, we can think of \(h(x)=(g(x))^n \) as \(f(g(x))\) where \(f(x)=x^n.\) Then \(f'(x)=nx^{n-1}.\) Thus, \(f'(g(x))=n(g(x))^{n-1}.\) This leads us to the derivative of a power function using the chain rule,

\begin{equation*} h'(x)=n(g(x))^{n-1}g'(x) \end{equation*}

Note 3.106. Rule: Power Rule for Composition of Functions.

For all values of \(x\) for which the derivative is defined, if

\begin{equation*} h(x)=(g(x))^n . \end{equation*}

Then

\begin{equation} h'(x)=n(g(x))^{n-1}g'(x).\tag{3.6.1} \end{equation}

Example 3.107. Using the Chain and Power Rules.

Find the derivative of \(h(x)=\frac{1}{(3x^2+1)^2}.\)

Solution.

First, rewrite \(h(x)=\frac{1}{(3x^2+1)^2}=(3x^2+1)^{-2}.\)

Applying the power rule with \(g(x)=3x^2+1,\) we have

\begin{equation*} h'(x)=- 2(3x^2+1)^{- 3}(6x). \end{equation*}

Rewriting back to the original form gives us

\begin{equation*} h'(x)=\frac{- 12x}{(3x^2+1)^3}. \end{equation*}

Checkpoint 3.108.

Find the derivative of \(h(x)=(2x^3+2x- 1)^4.\)

Hint.

Use (3.6.1) with \(g(x)=2x^3+2x- 1\)

Solution.

\(h'(x)=4(2x^3+2x- 1)^3(6x^2+2)=8(3x^2+1)(2x^3+2x- 1)^3\)

Example 3.109. Using the Chain and Power Rules.

Find the derivative of \(k(x)=\sqrt{3x^2+1}.\)

Solution.

First recall that \(\sqrt{3x^2+1}=(3x^2+1)^{1/2},\) so we can rewrite \(k(x)=\sqrt{3x^2+1}\) as \(k(x)=(3x^2+1)^{1/2}.\)

Applying the power rule with \(g(x)=3x^2+1,\) we obtain

\begin{equation*} k'(x)=\frac{1}{2}(3x^2+1)^{-1/2}\cdot 6x=3x(3x^2+1)^{-1/2}=\frac{3x}{\sqrt{3x^2+1}}. \end{equation*}

Example 3.110. Finding the Equation of a Tangent Line.

Find the equation of a line tangent to the graph of \(h(x)=\frac{1}{(3x-5)^2}\) at \(x=2.\)

Solution.

Because we are finding an equation of a line, we need a point. The \(x\)-coordinate of the point is 2. To find the \(y\)-coordinate, substitute 2 into \(h(x).\) Since \(h(2)=\frac{1}{(3(2)- 5)^2}=1,\) the point is \((2,1).\)

For the slope, we need \(h'(2).\) To find \(h'(x),\) first we rewrite \(h(x)=(3x- 5)^{-2}\) and apply the power rule to obtain

\begin{equation*} h'(x)=-2(3x- 5)^{-3}(3)=- 6(3x-5)^{-3}. \end{equation*}

By substituting, we have \(h'(2)=-6(3(2)-5)^{-3}=-6.\) Therefore, the line has equation \(y-1=-6(x-2).\) Rewriting, the equation of the line is \(y=-6x+13.\)

Checkpoint 3.111.

Find the equation of the line tangent to the graph of \(f(x)=(x^2- 2)^3\) at \(x=- 2.\)

Hint.

Use the preceding example as a guide.

Solution.

\(y=- 48x- 88\)

Subsection 3.6.3 Combining the Chain Rule with Other Rules

Now that we can combine the chain rule and the power rule, we examine how to combine the chain rule with the other rules we have learned. In particular, we can use it with the formulas for the derivatives of quotient or product rule.

Example 3.112. Combining the Chain Rule with the Product Rule.

Find the derivative of \(h(x)=(2x+1)^5(3x- 2)^7.\)

Solution.

First apply the product rule, then apply the chain rule to each term of the product.

\begin{align*} h'(x)\amp=\frac{d}{dx}((2x+1)^5)\cdot (3x- 2)^7+\frac{d}{dx}((3x- 2)^7)\cdot (2x+1)^5\amp\amp\text{ Apply the product rule. }\\ \amp=5(2x+1)^4\cdot 2\cdot (3x- 2)^7+7(3x- 2)^6\cdot 3\cdot (2x+1)^5\amp\amp\text{ Apply the chain rule. }\\ \amp=10(2x+1)^4(3x- 2)^7+21(3x- 2)^6(2x+1)^5\amp\amp\text{ Simplify. }\\ \amp=(2x+1)^4(3x- 2)^6(10(3x- 2)+21(2x+1))\amp\amp\text{ Factor out } (2x+1)^4(3x- 2)^6.\\ \amp=(2x+1)^4(3x- 2)^6(72x+1)\amp\amp\text{ Simplify. } \end{align*}

Checkpoint 3.113.

Find the derivative of \(h(x)=\frac{x}{(2x+3)^3}.\)

Hint.

Start out by applying the quotient rule. Remember to use the chain rule to differentiate the denominator.

Solution.

\(h'(x)=\frac{3- 4x}{(2x+3)^4}\)

Subsection 3.6.4

Example 3.114. Using the Chain Rule with Functional Values.

Let \(h(x)=f(g(x)).\) If \(g(1)=4,g'(1)=3,\) and \(f'(4)=7,\) find \(h'(1).\)

Solution.

Use the chain rule, then substitute.

\begin{align*} h'(1)\amp=f'(g(1))g'(1)\amp \amp\text{ Apply the chain rule. }\\ \amp=f'(4)\cdot 3\amp\amp\text{ Substitute } g(1)=4 \text{ and } g'(1)=3.\\ \amp=7\cdot 3\amp\amp\text{ Substitute } f'(4)=7.\\ \amp=21\amp\amp\text{ Simplify. } \end{align*}

Checkpoint 3.115.

Given \(h(x)=f(g(x)).\) If \(g(2)=- 3,g'(2)=4,\) and \(f'(- 3)=7,\) find \(h'(2).\)

Subsection 3.6.5 The Chain Rule Using Leibniz’s Notation

As with other derivatives that we have seen, we can express the chain rule using Leibniz’s notation. This notation for the chain rule is used heavily in physics applications.

\(\text{ For } h(x)=f(g(x)),\) let \(u=g(x)\) and \(y=h(x)=g(u).\) Thus,

\begin{equation*} h'(x)=\frac{dy}{dx},\;f'(g(x))=f'(u)=\frac{dy}{du}, \end{equation*}

and

\begin{equation*} g'(x)=\frac{du}{dx}. \end{equation*}

Consequently,

\begin{equation*} \frac{dy}{dx}=h'(x)=f'(g(x))g'(x)=\frac{dy}{du}\cdot \frac{du}{dx}. \end{equation*}

Note 3.116. Rule: Chain Rule Using Leibniz’s Notation.

If \(y\) is a function of \(u,\) and \(u\) is a function of \(x,\) then

\begin{equation*} \frac{dy}{dx}=\frac{dy}{du}\cdot \frac{du}{dx}. \end{equation*}

Example 3.117. Taking a Derivative Using Leibniz’s Notation, Example 1.

Find the derivative of \(y=(\frac{x}{3x+2})^5.\)

Solution.

First, let \(u=\frac{x}{3x+2}.\) Thus, \(y=u^5.\) Next, find \(\frac{du}{dx}\) and \(\frac{dy}{du}.\) Using the quotient rule,

\begin{equation*} \frac{du}{dx}=\frac{2}{(3x+2)^2} \end{equation*}

and

\begin{equation*} \frac{dy}{du}=5u^4. \end{equation*}

Finally, we put it all together.

\begin{align*} \frac{dy}{dx}\amp=\frac{dy}{du}\cdot \frac{du}{dx}\amp\amp\text{ Apply the chain rule. }\\ \amp=5u^4\cdot \frac{2}{(3x+2)^2} \amp \amp \text{ Substitute } \frac{dy}{du}=5u^4 \text{ and } \frac{du}{dx}=\frac{2}{(3x+2)^2}.\\ \amp=5(\frac{x}{3x+2})^4\cdot \frac{2}{(3x+2)^2}\amp\amp\text{ Substitute } u=\frac{x}{3x+2}.\\ \amp=\frac{10x^4}{(3x+2)^6}\amp\amp\text{ Simplify. } \end{align*}

It is important to remember that, when using the Leibniz form of the chain rule, the final answer must be expressed entirely in terms of the original variable given in the problem.

Subsection 3.6.6 Key Concepts

  • The chain rule allows us to differentiate compositions of two or more functions. It states that for \(h(x)=f(g(x)),\)

    \begin{equation*} h'(x)=f'(g(x))g'(x). \end{equation*}
    In Leibniz’s notation this rule takes the form
    \begin{equation*} \frac{dy}{dx}=\frac{dy}{du}\cdot \frac{du}{dx}. \end{equation*}

  • We can use the chain rule with other rules that we have learned, and we can derive formulas for some of them.

  • The chain rule combines with the power rule to form a new rule:

    \begin{equation*} \text{ If } h(x)=(g(x))^n ,\text{ then } h'(x)=n(g(x))^{n-1}g'(x). \end{equation*}

Subsection 3.6.7 Key Equations

  • The chain rule \(h'(x)=f'(g(x))g'(x)\)

  • The power rule for functions \(h'(x)=n(g(x))^{n-1}g'(x)\)

This book is a custom edition based on OpenStax Calculus Volume 1. You can download the original for free at https://openstax.org/details/books/calculus-volume-1.

http://www.openstax.org/l/20_chainrule2