Calculus Volume 1

# 3.6The Chain Rule

Calculus Volume 13.6 The Chain Rule

### Learning Objectives

• 3.6.1 State the chain rule for the composition of two functions.
• 3.6.2 Apply the chain rule together with the power rule.
• 3.6.3 Apply the chain rule and the product/quotient rules correctly in combination when both are necessary.
• 3.6.4 Recognize the chain rule for a composition of three or more functions.
• 3.6.5 Describe the proof of the chain rule.

We have seen the techniques for differentiating basic functions $(xn,sinx,cosx,etc.)(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)h(x)=sin(x3)$ or $k(x)=3x2+1.k(x)=3x2+1.$ In this section, we study the rule for finding the derivative of the composition of two or more functions.

### 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)=sin(x3).h(x)=sin(x3).$ We can think of the derivative of this function with respect to x as the rate of change of $sin(x3)sin(x3)$ relative to the change in $x.x.$ Consequently, we want to know how $sin(x3)sin(x3)$ changes as $xx$ changes. We can think of this event as a chain reaction: As $xx$ changes, $x3x3$ changes, which leads to a change in $sin(x3).sin(x3).$ This chain reaction gives us hints as to what is involved in computing the derivative of $sin(x3).sin(x3).$ First of all, a change in $xx$ forcing a change in $x3x3$ suggests that somehow the derivative of $x3x3$ is involved. In addition, the change in $x3x3$ forcing a change in $sin(x3)sin(x3)$ suggests that the derivative of $sin(u)sin(u)$ with respect to $u,u,$ where $u=x3,u=x3,$ is also part of the final derivative.

We can take a more formal look at the derivative of $h(x)=sin(x3)h(x)=sin(x3)$ by setting up the limit that would give us the derivative at a specific value $aa$ in the domain of $h(x)=sin(x3).h(x)=sin(x3).$

$h′(a)=limx→asin(x3)−sin(a3)x−a.h′(a)=limx→asin(x3)−sin(a3)x−a.$

This expression does not seem particularly helpful; however, we can modify it by multiplying and dividing by the expression $x3−a3x3−a3$ to obtain

$h′(a)=limx→asin(x3)−sin(a3)x3−a3·x3−a3x−a.h′(a)=limx→asin(x3)−sin(a3)x3−a3·x3−a3x−a.$

From the definition of the derivative, we can see that the second factor is the derivative of $x3x3$ at $x=a.x=a.$ That is,

$limx→ax3−a3x−a=ddx(x3)x=a=3a2.limx→ax3−a3x−a=ddx(x3)x=a=3a2.$

However, it might be a little more challenging to recognize that the first term is also a derivative. We can see this by letting $u=x3u=x3$ and observing that as $x→a,u→a3:x→a,u→a3:$

$limx→asin(x3)−sin(a3)x3−a3=limu→a3sinu−sin(a3)u−a3=ddu(sinu)u=a3=cos(a3).limx→asin(x3)−sin(a3)x3−a3=limu→a3sinu−sin(a3)u−a3=ddu(sinu)u=a3=cos(a3).$

Thus, $h′(a)=cos(a3)·3a2.h′(a)=cos(a3)·3a2.$

In other words, if $h(x)=sin(x3),h(x)=sin(x3),$ then $h′(x)=cos(x3)·3x2.h′(x)=cos(x3)·3x2.$ Thus, if we think of $h(x)=sin(x3)h(x)=sin(x3)$ as the composition $(f∘g)(x)=f(g(x))(f∘g)(x)=f(g(x))$ where $f(x)=f(x)=$ sin $xx$ and $g(x)=x3,g(x)=x3,$ then the derivative of $h(x)=sin(x3)h(x)=sin(x3)$ is the product of the derivative of $g(x)=x3g(x)=x3$ and the derivative of the function $f(x)=sinxf(x)=sinx$ evaluated at the function $g(x)=x3.g(x)=x3.$ At this point, we anticipate that for $h(x)=sin(g(x)),h(x)=sin(g(x)),$ it is quite likely that $h′(x)=cos(g(x))g′(x).h′(x)=cos(g(x))g′(x).$ As we determined above, this is the case for $h(x)=sin(x3).h(x)=sin(x3).$

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. An informal proof is provided at the end of the section.

### Rule: The Chain Rule

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

$h(x)=(f∘g)(x)=f(g(x))h(x)=(f∘g)(x)=f(g(x))$

is given by

$h′(x)=f′(g(x))g′(x).h′(x)=f′(g(x))g′(x).$
3.17

Alternatively, if $yy$ is a function of $u,u,$ and $uu$ is a function of $x,x,$ then

$dydx=dydu·dudx.dydx=dydu·dudx.$

### Media

Watch an animation of the chain rule.

Problem-Solving Strategy: Applying the Chain Rule
1. To differentiate $h(x)=f(g(x)),h(x)=f(g(x)),$ begin by identifying $f(x)f(x)$ and $g(x).g(x).$
2. Find $f′(x)f′(x)$ and evaluate it at $g(x)g(x)$ to obtain $f′(g(x)).f′(g(x)).$
3. Find $g′(x).g′(x).$
4. Write $h′(x)=f′(g(x))·g′(x).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,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))nh(x)=(g(x))n$ as $f(g(x))f(g(x))$ where $f(x)=xn.f(x)=xn.$ Then $f′(x)=nxn−1.f′(x)=nxn−1.$ Thus, $f′(g(x))=n(g(x))n−1.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−1g′(x)h′(x)=n(g(x))n−1g′(x)$

### Rule: Power Rule for Composition of Functions

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

$h(x)=(g(x))n.h(x)=(g(x))n.$

Then

$h′(x)=n(g(x))n−1g′(x).h′(x)=n(g(x))n−1g′(x).$
3.18

### Example 3.48

#### Using the Chain and Power Rules

Find the derivative of $h(x)=1(3x2+1)2.h(x)=1(3x2+1)2.$

Checkpoint 3.34

Find the derivative of $h(x)=(2x3+2x−1)4.h(x)=(2x3+2x−1)4.$

### Example 3.49

#### Using the Chain and Power Rules with a Trigonometric Function

Find the derivative of $h(x)=sin3x.h(x)=sin3x.$

### Example 3.50

#### Finding the Equation of a Tangent Line

Find the equation of a line tangent to the graph of $h(x)=1(3x−5)2h(x)=1(3x−5)2$ at $x=2.x=2.$

Checkpoint 3.35

Find the equation of the line tangent to the graph of $f(x)=(x2−2)3f(x)=(x2−2)3$ at $x=−2.x=−2.$

### 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.

### Example 3.51

#### Using the Chain Rule on a General Cosine Function

Find the derivative of $h(x)=cos(g(x)).h(x)=cos(g(x)).$

In the following example we apply the rule that we have just derived.

### Example 3.52

#### Using the Chain Rule on a Cosine Function

Find the derivative of $h(x)=cos(5x2).h(x)=cos(5x2).$

### Example 3.53

#### Using the Chain Rule on Another Trigonometric Function

Find the derivative of $h(x)=sec(4x5+2x).h(x)=sec(4x5+2x).$

Checkpoint 3.36

Find the derivative of $h(x)=sin(7x+2).h(x)=sin(7x+2).$

At this point we provide a list of derivative formulas that may be obtained by applying the chain rule in conjunction with the formulas for derivatives of trigonometric functions. Their derivations are similar to those used in Example 3.51 and Example 3.53. For convenience, formulas are also given in Leibniz’s notation, which some students find easier to remember. (We discuss the chain rule using Leibniz’s notation at the end of this section.) It is not absolutely necessary to memorize these as separate formulas as they are all applications of the chain rule to previously learned formulas.

Theorem 3.10

#### Using the Chain Rule with Trigonometric Functions

For all values of $xx$ for which the derivative is defined,

$ddx(sin(g(x))=cos(g(x))g′(x)ddxsinu=cosududxddx(cos(g(x))=−sin(g(x))g′(x)ddxcosu=−sinududxddx(tan(g(x))=sec2(g(x))g′(x)ddxtanu=sec2ududxddx(cot(g(x))=−csc2(g(x))g′(x)ddxcotu=−csc2ududxddx(sec(g(x))=sec(g(x)tan(g(x))g′(x)ddxsecu=secutanududxddx(csc(g(x))=−csc(g(x))cot(g(x))g′(x)ddxcscu=−cscucotududx.ddx(sin(g(x))=cos(g(x))g′(x)ddxsinu=cosududxddx(cos(g(x))=−sin(g(x))g′(x)ddxcosu=−sinududxddx(tan(g(x))=sec2(g(x))g′(x)ddxtanu=sec2ududxddx(cot(g(x))=−csc2(g(x))g′(x)ddxcotu=−csc2ududxddx(sec(g(x))=sec(g(x)tan(g(x))g′(x)ddxsecu=secutanududxddx(csc(g(x))=−csc(g(x))cot(g(x))g′(x)ddxcscu=−cscucotududx.$

### Example 3.54

#### Combining the Chain Rule with the Product Rule

Find the derivative of $h(x)=(2x+1)5(3x−2)7.h(x)=(2x+1)5(3x−2)7.$

Checkpoint 3.37

Find the derivative of $h(x)=x(2x+3)3.h(x)=x(2x+3)3.$

### Composites of Three or More Functions

We can now combine the chain rule with other rules for differentiating functions, but when we are differentiating the composition of three or more functions, we need to apply the chain rule more than once. If we look at this situation in general terms, we can generate a formula, but we do not need to remember it, as we can simply apply the chain rule multiple times.

In general terms, first we let

$k(x)=h(f(g(x))).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)))·ddxf((g(x))).k′(x)=ddx(h(f(g(x)))=h′(f(g(x)))·ddxf((g(x))).$

Applying the chain rule again, we obtain

$k′(x)=h′(f(g(x))f′(g(x))g′(x)).k′(x)=h′(f(g(x))f′(g(x))g′(x)).$

### Rule: Chain Rule for a Composition of Three Functions

For all values of x for which the function is differentiable, if

$k(x)=h(f(g(x))),k(x)=h(f(g(x))),$

then

$k′(x)=h′(f(g(x)))f′(g(x))g′(x).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.

### Example 3.55

#### Differentiating a Composite of Three Functions

Find the derivative of $k(x)=cos4(7x2+1).k(x)=cos4(7x2+1).$

Checkpoint 3.38

Find the derivative of $h(x)=sin6(x3).h(x)=sin6(x3).$

### Example 3.56

#### Using the Chain Rule in a Velocity Problem

A particle moves along a coordinate axis. Its position at time t is given by $s(t)=sin(2t)+cos(3t).s(t)=sin(2t)+cos(3t).$ What is the velocity of the particle at time $t=π6?t=π6?$

Checkpoint 3.39

A particle moves along a coordinate axis. Its position at time $tt$ is given by $s(t)=sin(4t).s(t)=sin(4t).$ Find its acceleration at time $t.t.$

#### Proof

At this point, we present a very informal proof of the chain rule. For simplicity’s sake we ignore certain issues: For example, we assume that $g(x)≠g(a)g(x)≠g(a)$ for $x≠ax≠a$ in some open interval containing $a.a.$ We begin by applying the limit definition of the derivative to the function $h(x)h(x)$ to obtain $h′(a):h′(a):$

$h′(a)=limx→af(g(x))−f(g(a))x−a.h′(a)=limx→af(g(x))−f(g(a))x−a.$

Rewriting, we obtain

$h′(a)=limx→af(g(x))−f(g(a))g(x)−g(a)·g(x)−g(a)x−a.h′(a)=limx→af(g(x))−f(g(a))g(x)−g(a)·g(x)−g(a)x−a.$

Although it is clear that

$limx→ag(x)−g(a)x−a=g′(a),limx→ag(x)−g(a)x−a=g′(a),$

it is not obvious that

$limx→af(g(x))−f(g(a))g(x)−g(a)=f′(g(a)).limx→af(g(x))−f(g(a))g(x)−g(a)=f′(g(a)).$

To see that this is true, first recall that since g is differentiable at $a,ga,g$ is also continuous at $a.a.$ Thus,

$limx→ag(x)=g(a).limx→ag(x)=g(a).$

Next, make the substitution $y=g(x)y=g(x)$ and $b=g(a)b=g(a)$ and use change of variables in the limit to obtain

$limx→af(g(x))−f(g(a))g(x)−g(a)=limy→bf(y)−f(b)y−b=f′(b)=f′(g(a)).limx→af(g(x))−f(g(a))g(x)−g(a)=limy→bf(y)−f(b)y−b=f′(b)=f′(g(a)).$

Finally,

$h′(a)=limx→af(g(x))−f(g(a))g(x)−g(a)·g(x)−g(a)x−a=f′(g(a))g′(a).h′(a)=limx→af(g(x))−f(g(a))g(x)−g(a)·g(x)−g(a)x−a=f′(g(a))g′(a).$

### Example 3.57

#### Using the Chain Rule with Functional Values

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

### Checkpoint 3.40

Given $h(x)=f(g(x)).h(x)=f(g(x)).$ If $g(2)=−3,g′(2)=4,g(2)=−3,g′(2)=4,$ and $f′(−3)=7,f′(−3)=7,$ find $h′(2).h′(2).$

### 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.

$Forh(x)=f(g(x)),Forh(x)=f(g(x)),$ let $u=g(x)u=g(x)$ and $y=h(x)=f(u).y=h(x)=f(u).$ Thus,

$h′(x)=dydx,f′(g(x))=f′(u)=dyduandg′(x)=dudx.h′(x)=dydx,f′(g(x))=f′(u)=dyduandg′(x)=dudx.$

Consequently,

$dydx=h′(x)=f′(g(x))g′(x)=dydu·dudx.dydx=h′(x)=f′(g(x))g′(x)=dydu·dudx.$

### Rule: Chain Rule Using Leibniz’s Notation

If $yy$ is a function of $u,u,$ and $uu$ is a function of $x,x,$ then

$dydx=dydu·dudx.dydx=dydu·dudx.$

### Example 3.58

#### Taking a Derivative Using Leibniz’s Notation, Example 1

Find the derivative of $y=(x3x+2)5.y=(x3x+2)5.$

### Example 3.59

#### Taking a Derivative Using Leibniz’s Notation, Example 2

Find the derivative of $y=tan(4x2−3x+1).y=tan(4x2−3x+1).$

Checkpoint 3.41

Use Leibniz’s notation to find the derivative of $y=cos(x3).y=cos(x3).$ Make sure that the final answer is expressed entirely in terms of the variable $x.x.$

### Section 3.6 Exercises

For the following exercises, given $y=f(u)y=f(u)$ and $u=g(x),u=g(x),$ find $dydxdydx$ by using Leibniz’s notation for the chain rule: $dydx=dydududx.dydx=dydududx.$

214.

$y=3u−6,u=2x2y=3u−6,u=2x2$

215.

$y=6u3,u=7x−4y=6u3,u=7x−4$

216.

$y=sinu,u=5x−1y=sinu,u=5x−1$

217.

$y=cosu,u=−x8y=cosu,u=−x8$

218.

$y=tanu,u=9x+2y=tanu,u=9x+2$

219.

$y=4u+3,u=x2−6xy=4u+3,u=x2−6x$

For each of the following exercises,

1. decompose each function in the form $y=f(u)y=f(u)$ and $u=g(x),u=g(x),$ and
2. find $dydxdydx$ as a function of $x.x.$
220.

$y=(3x−2)6y=(3x−2)6$

221.

$y=(3x2+1)3y=(3x2+1)3$

222.

$y=sin5(x)y=sin5(x)$

223.

$y=(x7+7x)7y=(x7+7x)7$

224.

$y=tan(secx)y=tan(secx)$

225.

$y=csc(πx+1)y=csc(πx+1)$

226.

$y=cot2xy=cot2x$

227.

$y=−6(sin)−3xy=−6(sin)−3x$

For the following exercises, find $dydxdydx$ for each function.

228.

$y=(3x2+3x−1)4y=(3x2+3x−1)4$

229.

$y=(5−2x)−2y=(5−2x)−2$

230.

$y=cos3(πx)y=cos3(πx)$

231.

$y=(2x3−x2+6x+1)3y=(2x3−x2+6x+1)3$

232.

$y=1sin2(x)y=1sin2(x)$

233.

$y=(tanx+sinx)−3y=(tanx+sinx)−3$

234.

$y=x2cos4xy=x2cos4x$

235.

$y=sin(cos7x)y=sin(cos7x)$

236.

$y=6+secπx2y=6+secπx2$

237.

$y=cot3(4x+1)y=cot3(4x+1)$

238.

Let $y=[f(x)]3y=[f(x)]3$ and suppose that $f′(1)=4f′(1)=4$ and $dydx=10dydx=10$ for $x=1.x=1.$ Find $f(1).f(1).$

239.

Let $y=(f(x)+5x2)4y=(f(x)+5x2)4$ and suppose that $f(−1)=−4f(−1)=−4$ and $dydx=3dydx=3$ when $x=−1.x=−1.$ Find $f′(−1)f′(−1)$

240.

Let $y=(f(u)+3x)2y=(f(u)+3x)2$ and $u=x3−2x.u=x3−2x.$ If $f(4)=6f(4)=6$ and $dydx=18dydx=18$ when $x=2,x=2,$ find $f′(4).f′(4).$

241.

[T] Find the equation of the tangent line to $y=−sin(x2)y=−sin(x2)$ at the origin. Use a calculator to graph the function and the tangent line together.

242.

[T] Find the equation of the tangent line to $y=(3x+1x)2y=(3x+1x)2$ at the point $(1,16).(1,16).$ Use a calculator to graph the function and the tangent line together.

243.

Find the $xx$-coordinates at which the tangent line to $y=(x−6x)8y=(x−6x)8$ is horizontal.

244.

[T] Find an equation of the line that is normal to $g(θ)=sin2(πθ)g(θ)=sin2(πθ)$ at the point $(14,12).(14,12).$ Use a calculator to graph the function and the normal line together.

For the following exercises, use the information in the following table to find $h′(a)h′(a)$ at the given value for $a.a.$

$xx$ $f(x)f(x)$ $f′(x)f′(x)$ $g(x)g(x)$ $g′(x)g′(x)$
0 2 5 0 2
1 1 −2 3 0
2 4 4 1 −1
3 3 −3 2 3
245.

$h(x)=f(g(x));a=0h(x)=f(g(x));a=0$

246.

$h(x)=g(f(x));a=0h(x)=g(f(x));a=0$

247.

$h(x)=(x4+g(x))−2;a=1h(x)=(x4+g(x))−2;a=1$

248.

$h(x)=(f(x)g(x))2;a=3h(x)=(f(x)g(x))2;a=3$

249.

$h(x)=f(x+f(x));a=1h(x)=f(x+f(x));a=1$

250.

$h(x)=(1+g(x))3;a=2h(x)=(1+g(x))3;a=2$

251.

$h(x)=g(2+f(x2));a=1h(x)=g(2+f(x2));a=1$

252.

$h(x)=f(g(sinx));a=0h(x)=f(g(sinx));a=0$

253.

[T] The position function of a freight train is given by $s(t)=100(t+1)−2,s(t)=100(t+1)−2,$ with $ss$ in meters and $tt$ in seconds. At time $t=6t=6$ s, find the train’s

1. velocity and
2. acceleration.
3. Using a. and b. is the train speeding up or slowing down?
254.

[T] A mass hanging from a vertical spring is in simple harmonic motion as given by the following position function, where $tt$ is measured in seconds and $ss$ is in inches:

$s(t)=−3cos(πt+π4).s(t)=−3cos(πt+π4).$

1. Determine the position of the spring at $t=1.5t=1.5$ s.
2. Find the velocity of the spring at $t=1.5t=1.5$ s.
255.

[T] The total cost to produce $xx$ boxes of Thin Mint Girl Scout cookies is $CC$ dollars, where $C=0.0001x3−0.02x2+3x+300.C=0.0001x3−0.02x2+3x+300.$ In $tt$ weeks production is estimated to be $x=1600+100tx=1600+100t$ boxes.

1. Find the marginal cost $C′(x).C′(x).$
2. Use Leibniz’s notation for the chain rule, $dCdt=dCdx·dxdt,dCdt=dCdx·dxdt,$ to find the rate with respect to time $tt$ that the cost is changing.
3. Use b. to determine how fast costs are increasing when $t=2t=2$ weeks. Include units with the answer.
256.

[T] The formula for the area of a circle is $A=πr2,A=πr2,$ where $rr$ is the radius of the circle. Suppose a circle is expanding, meaning that both the area $AA$ and the radius $rr$ (in inches) are expanding.

1. Suppose $r=2−100(t+7)2r=2−100(t+7)2$ where $tt$ is time in seconds. Use the chain rule $dAdt=dAdr·drdtdAdt=dAdr·drdt$ to find the rate at which the area is expanding.
2. Use a. to find the rate at which the area is expanding at $t=4t=4$ s.
257.

[T] The formula for the volume of a sphere is $S=43πr3,S=43πr3,$ where $rr$ (in feet) is the radius of the sphere. Suppose a spherical snowball is melting in the sun.

1. Suppose $r=1(t+1)2−112r=1(t+1)2−112$ where $tt$ is time in minutes. Use the chain rule $dSdt=dSdr·drdtdSdt=dSdr·drdt$ to find the rate at which the snowball is melting.
2. Use a. to find the rate at which the volume is changing at $t=1t=1$ min.
258.

[T] The daily temperature in degrees Fahrenheit of Phoenix in the summer can be modeled by the function $T(x)=94−10cos[π12(x−2)],T(x)=94−10cos[π12(x−2)],$ where $xx$ is hours after midnight. Find the rate at which the temperature is changing at 4 p.m.

259.

[T] The depth (in feet) of water at a dock changes with the rise and fall of tides. The depth is modeled by the function $D(t)=5sin(π6t−7π6)+8,D(t)=5sin(π6t−7π6)+8,$ where $tt$ is the number of hours after midnight. Find the rate at which the depth is changing at 6 a.m.