3: The Chain Rule
( \newcommand{\kernel}{\mathrm{null}\,}\)
- 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.
- Recognize the chain rule for a composition of three or more functions.
- Describe the proof of the chain rule.
We have seen the techniques for differentiating basic functions (xn,sinx,cosx, 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)=sin(x3) or k(x)=√3x2+1. In this section, we study the rule for finding the derivative of the composition of two or more functions.
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
h(x)=(f∘g)(x)=f(g(x))
is given by
h′(x)=f′(g(x))⋅g′(x).
Alternatively, if y is a function of u, and u is a function of x, then
dydx=dydu⋅dudx.
- To differentiate h(x)=f(g(x)), begin by identifying f(x) and g(x).
- Find f′(x) and evaluate it at g(x) to obtain f′(g(x)).
- Find g′(x).
- Write h′(x)=f′(g(x))⋅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.
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)=xn. Then f′(x)=nxn−1. Thus, f′(g(x))=n(g(x))n−1. This leads us to the derivative of a power function using the chain rule,
h′(x)=n(g(x))n−1⋅g′(x)
For all values of x for which the derivative is defined, if
h(x)=(g(x))n,
Then
h′(x)=n(g(x))n−1⋅g′(x).
Find the derivative of h(x)=1(3x2+1)2.
Solution
First, rewrite h(x)=1(3x2+1)2=(3x2+1)−2.
Applying the power rule with g(x)=3x2+1, we have
h′(x)=−2(3x2+1)−3⋅6x.
Rewriting back to the original form gives us
h′(x)=−12x(3x2+1)3
Find the derivative of h(x)=(2x3+2x−1)4.
- Hint
-
Use the General Power Rule (Equation ???) with g(x)=2x3+2x−1.
- Answer
-
h′(x)=4(2x3+2x−1)3(6x2+2)=8(3x2+1)(2x3+2x−1)3
Find the derivative of h(x)=sin3x.
Solution
First recall that sin3x=(sinx)3, so we can rewrite h(x)=sin3x as h(x)=(sinx)3.
Applying the power rule with g(x)=sinx, we obtain
h′(x)=3(sinx)2cosx=3sin2xcosx.
Find the equation of a line tangent to the graph of h(x)=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)=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
h′(x)=−2(3x−5)−3(3)=−6(3x−5)−3.
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.
Find the equation of the line tangent to the graph of f(x)=(x2−2)3 at x=−2.
- Hint
-
Use the preceding example as a guide.
- Answer
-
y=−48x−88
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 trigonometric functions or with the product rule.
Find the derivative of h(x)=cos(g(x)).
Solution
Think of h(x)=cos(g(x)) as f(g(x)) where f(x)=cosx. Since f′(x)=−sinx, we have f′(g(x))=−sin(g(x)). Then we do the following calculation.
h′(x)=f′(g(x))⋅g′(x)Apply the chain rule.=−sin(g(x))⋅g′(x)Substitutef′(g(x))=−sin(g(x)).
Thus, the derivative of h(x)=cos(g(x)) is given by h′(x)=−sin(g(x))⋅g′(x).
In the following example we apply the rule that we have just derived.
Find the derivative of h(x)=cos(5x2).
Solution
Let g(x)=5x2. Then g′(x)=10x. Using the result from the previous example,
h′(x)=−sin(5x2)⋅10x=−10xsin(5x2)
Find the derivative of h(x)=sin(7x+2).
- Hint
-
Apply the chain rule to h(x)=sin(g(x)) first and then use g(x)=7x+2.
- Answer
-
h′(x)=7cos(7x+2)
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.
h′(x)=ddx((2x+1)5)⋅(3x−2)7+ddx((3x−2)7)⋅(2x+1)5Apply the product rule.=5(2x+1)4⋅2⋅(3x−2)7+7(3x−2)6⋅3⋅(2x+1)5Apply the chain rule.=10(2x+1)4(3x−2)7+21(3x−2)6(2x+1)5Simplify.=(2x+1)4(3x−2)6(10(3x−2)+21(2x+1))Factor out (2x+1)4(3x−2)6=(2x+1)4(3x−2)6(72x+1)Simplify.
Find the derivative of h(x)=x(2x+3)3.
- Hint
-
Start out by applying the quotient rule. Remember to use the chain rule to differentiate the denominator.
- Answer
-
h′(x)=3−4x(2x+3)4
Composites of Three or More Functions
When we are differentiating the composition of three or more functions, we need to apply the chain rule more than once.
In general terms, first we let
k(x)=h(f(g(x))).
Then, applying the chain rule once we obtain
k′(x)=ddx(h(f(g(x))))=h′(f(g(x)))⋅ddx(f(g(x))).
Applying the chain rule again, we obtain
k′(x)=h′(f(g(x)))⋅f′(g(x))⋅g′(x).
For all values of x for which the function is differentiable, if
k(x)=h(f(g(x))),
then
k′(x)=h′(f(g(x)))⋅f′(g(x))⋅g′(x).
In other words, we are applying the chain rule twice.
Notice that the derivative of the composition of three functions has three parts. (Similarly, the derivative of the composition of four functions has four parts, and so on.) Also, remember, we can always work from the outside in, taking one derivative at a time.
Find the derivative of k(x)=cos4(7x2+1).
Solution
First, rewrite k(x) as
k(x)=(cos(7x2+1))4.
Then apply the chain rule several times.
k′(x)=4(cos(7x2+1))3⋅ddx(cos(7x2+1))Apply the chain rule.=4(cos(7x2+1))3(−sin(7x2+1))⋅ddx(7x2+1)Apply the chain rule.=4(cos(7x2+1))3(−sin(7x2+1))(14x)Apply the chain rule.=−56xsin(7x2+1)cos3(7x2+1)Simplify
Find the derivative of h(x)=sin6(x3).
- Hint
-
Rewrite h(x)=sin6(x3)=(sin(x3))6 and use Example 3.8 as a guide.
- Answer
-
h′(x)=18x2sin5(x3)cos(x3)
A particle moves along a coordinate axis. Its position at time t is given by s(t)=sin(2t)+cos(3t). What is the velocity of the particle at time t=π6?
Solution
To find v(t), the velocity of the particle at time t, we must differentiate s(t). Thus,
v(t)=s′(t)=2cos(2t)−3sin(3t).□
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.
h′(1)=f′(g(1))⋅g′(1)Apply the chain rule.=f′(4)⋅3Substituteg(1)=4andg′(1)=3.=7⋅3Substitutef′(4)=7.=21Simplify.
Given h(x)=f(g(x)). If g(2)=−3,g′(2)=4, and f′(−3)=7, find h′(2).
- Hint
-
Follow Example 3.10.
- Answer
-
28
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.
For h(x)=f(g(x)), let u=g(x) and y=h(x)=f(u). Thus,
h′(x)=dydx
f′(g(x))=f′(u)=dydu
and
g′(x)=dudx.
Consequently,
dydx=h′(x)=f′(g(x))⋅g′(x)=dydu⋅dudx.
If y is a function of u, and u is a function of x, then
dydx=dydu⋅dudx.
Find the derivative of y=(x3x+2)5.
Solution
First, let u=x3x+2. Thus, y=u5. Next, find dudx and dydu. Using the quotient rule,
dudx=2(3x+2)2
and
dydu=5u4.
Finally, we put it all together.
dydx=dydu⋅dudxApply the chain rule.=5u4⋅2(3x+2)2Substitutedydu=5u4anddudx=2(3x+2)2.=5(x3x+2)4⋅2(3x+2)2Substituteu=x3x+2.=10x4(3x+2)6Simplify.
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.
Find the derivative of y=tan(4x2−3x+1).
Solution
First, let u=4x2−3x+1. Then y=tanu. Next, find dudx and dydu:
dudx=8x−3 and dydu=sec2u.
Finally, we put it all together.
dydx=dydu⋅dudxApply the chain rule.=sec2u⋅(8x−3)Usedudx=8x−3anddydu=sec2u.=sec2(4x2−3x+1)⋅(8x−3)Substituteu=4x2−3x+1.
Use Leibniz’s notation to find the derivative of y=cos(x3). Make sure that the final answer is expressed entirely in terms of the variable x.
- Hint
-
Let u=x3.
- Answer
-
dydx=−3x2sin(x3).
Key Concepts
- The chain rule allows us to differentiate compositions of two or more functions. It states that for h(x)=f(g(x)),
h′(x)=f′(g(x))⋅g′(x).
In Leibniz’s notation this rule takes the form
dydx=dydu⋅dudx.
- 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:
If h(x)=(g(x))n, then h′(x)=n(g(x))n−1⋅g′(x).
- When applied to the composition of three functions, the chain rule can be expressed as follows: If h(x)=f(g(k(x))), then h′(x)=f′(g(k(x)))⋅g′(k(x))⋅k′(x).
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)
Glossary
- chain rule
- the chain rule defines the derivative of a composite function as the derivative of the outer function evaluated at the inner function times the derivative of the inner function