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.
- 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 [latex]({x}^{n}, \sin x, \cos x,\text{etc}.)[/latex] 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 [latex]h(x)= \sin ({x}^{3})[/latex] or [latex]k(x)=\sqrt{3{x}^{2}+1}.[/latex] 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: [latex]h(x)= \sin ({x}^{3}).[/latex] We can think of the derivative of this function with respect to [latex]x[/latex] as the rate of change of [latex]\sin ({x}^{3})[/latex] relative to the change in [latex]x.[/latex] Consequently, we want to know how [latex]\sin ({x}^{3})[/latex] changes as [latex]x[/latex] changes. We can think of this event as a chain reaction: As [latex]x[/latex] changes, [latex]{x}^{3}[/latex] changes, which leads to a change in [latex]\sin ({x}^{3}).[/latex] This chain reaction gives us hints as to what is involved in computing the derivative of [latex]\sin ({x}^{3}).[/latex] First of all, a change in [latex]x[/latex] forcing a change in [latex]{x}^{3}[/latex] suggests that somehow the derivative of [latex]{x}^{3}[/latex] is involved. In addition, the change in [latex]{x}^{3}[/latex] forcing a change in [latex]\sin ({x}^{3})[/latex] suggests that the derivative of [latex]\sin (u)[/latex] with respect to [latex]u,[/latex] where [latex]u={x}^{3},[/latex] is also part of the final derivative.
We can take a more formal look at the derivative of [latex]h(x)= \sin ({x}^{3})[/latex] by setting up the limit that would give us the derivative at a specific value [latex]a[/latex] in the domain of [latex]h(x)= \sin ({x}^{3}).[/latex]
This expression does not seem particularly helpful; however, we can modify it by multiplying and dividing by the expression [latex]{x}^{3}-{a}^{3}[/latex] to obtain
From the definition of the derivative, we can see that the second factor is the derivative of [latex]{x}^{3}[/latex] at [latex]x=a.[/latex] That is,
However, it might be a little more challenging to recognize that the first term is also a derivative. We can see this by letting [latex]u={x}^{3}[/latex] and observing that as [latex]x\to a,u\to {a}^{3}\text{:}[/latex]
Thus, [latex]{h}^{\prime }(a)= \cos ({a}^{3})·3{a}^{2}.[/latex]
In other words, if [latex]h(x)= \sin ({x}^{3}),[/latex] then [latex]{h}^{\prime }(x)= \cos ({x}^{3})·3{x}^{2}.[/latex] Thus, if we think of [latex]h(x)= \sin ({x}^{3})[/latex] as the composition [latex](f\circ g)(x)=f(g(x))[/latex] where [latex]f(x)=[/latex] sin [latex]x[/latex] and [latex]g(x)={x}^{3},[/latex] then the derivative of [latex]h(x)= \sin ({x}^{3})[/latex] is the product of the derivative of [latex]g(x)={x}^{3}[/latex] and the derivative of the function [latex]f(x)= \sin x[/latex] evaluated at the function [latex]g(x)={x}^{3}.[/latex] At this point, we anticipate that for [latex]h(x)= \sin (g(x)),[/latex] it is quite likely that [latex]{h}^{\prime }(x)= \cos (g(x)){g}^{\prime }(x).[/latex] As we determined above, this is the case for [latex]h(x)= \sin ({x}^{3}).[/latex]
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 [latex]f[/latex] and [latex]g[/latex] be functions. For all [latex]x[/latex] in the domain of [latex]g[/latex] for which [latex]g[/latex] is differentiable at [latex]x[/latex] and [latex]f[/latex] is differentiable at [latex]g(x),[/latex] the derivative of the composite function
is given by
Alternatively, if [latex]y[/latex] is a function of [latex]u,[/latex] and [latex]u[/latex] is a function of [latex]x,[/latex] then
Watch an animation of the chain rule.
Problem-Solving Strategy: Applying the Chain Rule
- To differentiate [latex]h(x)=f(g(x)),[/latex] begin by identifying [latex]f(x)[/latex] and [latex]g(x).[/latex]
- Find [latex]f\prime (x)[/latex] and evaluate it at [latex]g(x)[/latex] to obtain [latex]{f}^{\prime }(g(x)).[/latex]
- Find [latex]{g}^{\prime }(x).[/latex]
- Write [latex]{h}^{\prime }(x)={f}^{\prime }(g(x))·{g}^{\prime }(x).[/latex]
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 [latex]h(x)={(g(x))}^{n},[/latex] we need to use the chain rule combined with the power rule. To do so, we can think of [latex]h(x)={(g(x))}^{n}[/latex] as [latex]f(g(x))[/latex] where [latex]f(x)={x}^{n}.[/latex] Then [latex]{f}^{\prime }(x)=n{x}^{n-1}.[/latex] Thus, [latex]{f}^{\prime }(g(x))=n{(g(x))}^{n-1}.[/latex] This leads us to the derivative of a power function using the chain rule,
Rule: Power Rule for Composition of Functions
For all values of [latex]x[/latex] for which the derivative is defined, if
Then
Using the Chain and Power Rules
Find the derivative of [latex]h(x)=\frac{1}{{(3{x}^{2}+1)}^{2}}.[/latex]
Find the derivative of [latex]h(x)={(2{x}^{3}+2x-1)}^{4}.[/latex]
Using the Chain and Power Rules with a Trigonometric Function
Find the derivative of [latex]h(x)={ \sin }^{3}x.[/latex]
Finding the Equation of a Tangent Line
Find the equation of a line tangent to the graph of [latex]h(x)=\frac{1}{{(3x-5)}^{2}}[/latex] at [latex]x=2.[/latex]
Find the equation of the line tangent to the graph of [latex]f(x)={({x}^{2}-2)}^{3}[/latex] at [latex]x=-2.[/latex]
Hint
Use the preceding example as a guide.
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.
Using the Chain Rule on a General Cosine Function
Find the derivative of [latex]h(x)= \cos (g(x)).[/latex]
In the following example we apply the rule that we have just derived.
Using the Chain Rule on a Cosine Function
Find the derivative of [latex]h(x)= \cos (5{x}^{2}).[/latex]
Let [latex]g(x)=5{x}^{2}.[/latex] Then [latex]{g}^{\prime }(x)=10x.[/latex] Using the result from the previous example,
Using the Chain Rule on Another Trigonometric Function
Find the derivative of [latex]h(x)= \sec (4{x}^{5}+2x).[/latex]
Find the derivative of [latex]h(x)= \sin (7x+2).[/latex]
[latex]{h}^{\prime }(x)=7 \cos (7x+2)[/latex]
Hint
Apply the chain rule to [latex]h(x)= \sin g(x)[/latex] first and then use [latex]g(x)=7x+2.[/latex]
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 (Figure) and (Figure). 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.
Using the Chain Rule with Trigonometric Functions
For all values of [latex]x[/latex] for which the derivative is defined,
Combining the Chain Rule with the Product Rule
Find the derivative of [latex]h(x)={(2x+1)}^{5}{(3x-2)}^{7}.[/latex]
Find the derivative of [latex]h(x)=\frac{x}{{(2x+3)}^{3}}.[/latex]
Hint
Start out by applying the quotient rule. Remember to use the chain rule to differentiate the denominator.
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
Then, applying the chain rule once we obtain
Applying the chain rule again, we obtain
Rule: Chain Rule for a Composition of Three Functions
For all values of [latex]x[/latex] for which the function is differentiable, if
then
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.
Differentiating a Composite of Three Functions
Find the derivative of [latex]k(x)={ \cos }^{4}({7x}^{2}+1).[/latex]
Find the derivative of [latex]h(x)={ \sin }^{6}({x}^{3}).[/latex]
Hint
Rewrite [latex]h(x)={ \sin }^{6}({x}^{3})={( \sin ({x}^{3}))}^{6}[/latex] and use (Figure) as a guide.
Using the Chain Rule in a Velocity Problem
A particle moves along a coordinate axis. Its position at time [latex]t[/latex] is given by [latex]s(t)= \sin (2t)+ \cos (3t).[/latex] What is the velocity of the particle at time [latex]t=\frac{\pi }{6}?[/latex]
A particle moves along a coordinate axis. Its position at time [latex]t[/latex] is given by [latex]s(t)= \sin (4t).[/latex] Find its acceleration at time [latex]t.[/latex]
Hint
Acceleration is the second derivative of position.
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 [latex]g(x)\ne g(a)[/latex] for [latex]x\ne a[/latex] in some open interval containing [latex]a.[/latex] We begin by applying the limit definition of the derivative to the function [latex]h(x)[/latex] to obtain [latex]{h}^{\prime }(a)\text{:}[/latex]
Rewriting, we obtain
Although it is clear that
it is not obvious that
To see that this is true, first recall that since [latex]g[/latex] is differentiable at [latex]a,g[/latex] is also continuous at [latex]a.[/latex] Thus,
Next, make the substitution [latex]y=g(x)[/latex] and [latex]b=g(a)[/latex] and use change of variables in the limit to obtain
Finally,
□
Using the Chain Rule with Functional Values
Let [latex]h(x)=f(g(x)).[/latex] If [latex]g(1)=4,{g}^{\prime }(1)=3,[/latex] and [latex]{f}^{\prime }(4)=7,[/latex] find [latex]{h}^{\prime }(1).[/latex]
Given [latex]h(x)=f(g(x)).[/latex] If [latex]g(2)=-3,{g}^{\prime }(2)=4,[/latex] and [latex]{f}^{\prime }(-3)=7,[/latex] find [latex]{h}^{\prime }(2).[/latex]
Hint
Follow (Figure).
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.
[latex]\text{ For }h(x)=f(g(x)),[/latex] let [latex]u=g(x)[/latex] and [latex]y=h(x)=g(u).[/latex] Thus,
Consequently,
Rule: Chain Rule Using Leibniz’s Notation
If [latex]y[/latex] is a function of [latex]u,[/latex] and [latex]u[/latex] is a function of [latex]x,[/latex] then
Taking a Derivative Using Leibniz’s Notation, Example 1
Find the derivative of [latex]y={(\frac{x}{3x+2})}^{5}.[/latex]
Taking a Derivative Using Leibniz’s Notation, Example 2
Find the derivative of [latex]y= \tan (4{x}^{2}-3x+1).[/latex]
Use Leibniz’s notation to find the derivative of [latex]y= \cos ({x}^{3}).[/latex] Make sure that the final answer is expressed entirely in terms of the variable [latex]x.[/latex]
Hint
Let [latex]u={x}^{3}.[/latex]
Key Concepts
- The chain rule allows us to differentiate compositions of two or more functions. It states that for [latex]h(x)=f(g(x)),[/latex]
[latex]{h}^{\prime }(x)={f}^{\prime }(g(x)){g}^{\prime }(x).[/latex]
In Leibniz’s notation this rule takes the form
[latex]\frac{dy}{dx}=\frac{dy}{du}·\frac{du}{dx}.[/latex] - 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:
[latex]\text{ If }h(x)={(g(x))}^{n},\text{then}{h}^{\prime }(x)=n{(g(x))}^{n-1}{g}^{\prime }(x).[/latex]
- When applied to the composition of three functions, the chain rule can be expressed as follows: If [latex]h(x)=f(g(k(x))),[/latex] then [latex]{h}^{\prime }(x)={f}^{\prime }(g(k(x)){g}^{\prime }(k(x)){k}^{\prime }(x).[/latex]
Key Equations
- The chain rule
[latex]{h}^{\prime }(x)={f}^{\prime }(g(x)){g}^{\prime }(x)[/latex] - The power rule for functions
[latex]{h}^{\prime }(x)=n{(g(x))}^{n-1}{g}^{\prime }(x)[/latex]
For the following exercises, given [latex]y=f(u)[/latex] and [latex]u=g(x),[/latex] find [latex]\frac{dy}{dx}[/latex] by using Leibniz’s notation for the chain rule: [latex]\frac{dy}{dx}=\frac{dy}{du}\frac{du}{dx}.[/latex]
[latex]y=3u-6,u=2{x}^{2}[/latex]
[latex]y=6{u}^{3},u=7x-4[/latex]
[latex]y= \sin u,u=5x-1[/latex]
[latex]y= \cos u,u=\frac{\text{−}x}{8}[/latex]
[latex]y= \tan u,u=9x+2[/latex]
[latex]y=\sqrt{4u+3},u={x}^{2}-6x[/latex]
For each of the following exercises,
- decompose each function in the form [latex]y=f(u)[/latex] and [latex]u=g(x),[/latex] and
- find [latex]\frac{dy}{dx}[/latex] as a function of [latex]x.[/latex]
[latex]y={(3x-2)}^{6}[/latex]
[latex]y={(3{x}^{2}+1)}^{3}[/latex]
[latex]y={ \sin }^{5}(x)[/latex]
[latex]y={(\frac{x}{7}+\frac{7}{x})}^{7}[/latex]
[latex]y= \tan ( \sec x)[/latex]
[latex]y= \csc (\pi x+1)[/latex]
[latex]y={ \cot }^{2}x[/latex]
[latex]y=-6{ \sin }^{-3}x[/latex]
For the following exercises, find [latex]\frac{dy}{dx}[/latex] for each function.
[latex]y={(3{x}^{2}+3x-1)}^{4}[/latex]
[latex]y={(5-2x)}^{-2}[/latex]
[latex]y={ \cos }^{3}(\pi x)[/latex]
[latex]y={(2{x}^{3}-{x}^{2}+6x+1)}^{3}[/latex]
[latex]y=\frac{1}{{ \sin }^{2}(x)}[/latex]
[latex]y={( \tan x+ \sin x)}^{-3}[/latex]
[latex]y={x}^{2}{ \cos }^{4}x[/latex]
[latex]y= \sin ( \cos 7x)[/latex]
[latex]y=\sqrt{6+ \sec \pi {x}^{2}}[/latex]
[latex]y={ \cot }^{3}(4x+1)[/latex]
Let [latex]y={\left[f(x)\right]}^{3}[/latex] and suppose that [latex]{f}^{\prime }(1)=4[/latex] and [latex]\frac{dy}{dx}=10[/latex] for [latex]x=1.[/latex] Find [latex]f(1).[/latex]
Let [latex]y={(f(x)+5{x}^{2})}^{4}[/latex] and suppose that [latex]f(-1)=-4[/latex] and [latex]\frac{dy}{dx}=3[/latex] when [latex]x=-1.[/latex] Find [latex]{f}^{\prime }(-1)[/latex]
Let [latex]y={(f(u)+3x)}^{2}[/latex] and [latex]u={x}^{3}-2x.[/latex] If [latex]f(4)=6[/latex] and [latex]\frac{dy}{dx}=18[/latex] when [latex]x=2,[/latex] find [latex]{f}^{\prime }(4).[/latex]
[T] Find the equation of the tangent line to [latex]y=\text{−} \sin (\frac{x}{2})[/latex] at the origin. Use a calculator to graph the function and the tangent line together.
[T] Find the equation of the tangent line to [latex]y={(3x+\frac{1}{x})}^{2}[/latex] at the point [latex](1,16).[/latex] Use a calculator to graph the function and the tangent line together.
Find the [latex]x[/latex]-coordinates at which the tangent line to [latex]y={(x-\frac{6}{x})}^{8}[/latex] is horizontal.
[T] Find an equation of the line that is normal to [latex]g(\theta )={ \sin }^{2}(\pi \theta )[/latex] at the point [latex](\frac{1}{4},\frac{1}{2}).[/latex] 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 [latex]{h}^{\prime }(a)[/latex] at the given value for [latex]a.[/latex]
[latex]x[/latex] | [latex]f(x)[/latex] | [latex]f\prime (x)[/latex] | [latex]g(x)[/latex] | [latex]g\prime (x)[/latex] |
---|---|---|---|---|
0 | 2 | 5 | 0 | 2 |
1 | 1 | −2 | 3 | 0 |
2 | 4 | 4 | 1 | −1 |
3 | 3 | −3 | 2 | 3 |
[latex]h(x)=f(g(x));a=0[/latex]
[latex]h(x)=g(f(x));a=0[/latex]
[latex]h(x)={({x}^{4}+g(x))}^{-2};a=1[/latex]
[latex]h(x)={(\frac{f(x)}{g(x)})}^{2};a=3[/latex]
[latex]h(x)=f(x+f(x));a=1[/latex]
[latex]h(x)={(1+g(x))}^{3};a=2[/latex]
[latex]h(x)=g(2+f({x}^{2}));a=1[/latex]
[latex]h(x)=f(g( \sin x));a=0[/latex]
[T] The position function of a freight train is given by [latex]s(t)=100{(t+1)}^{-2},[/latex] with [latex]s[/latex] in meters and [latex]t[/latex] in seconds. At time [latex]t=6[/latex] s, find the train’s
- velocity and
- acceleration.
- Using a. and b. is the train speeding up or slowing down?
[T] A mass hanging from a vertical spring is in simple harmonic motion as given by the following position function, where [latex]t[/latex] is measured in seconds and [latex]s[/latex] is in inches:
[latex]s(t)=-3 \cos (\pi t+\frac{\pi }{4}).[/latex]
- Determine the position of the spring at [latex]t=1.5[/latex] s.
- Find the velocity of the spring at [latex]t=1.5[/latex] s.
[T] The total cost to produce [latex]x[/latex] boxes of Thin Mint Girl Scout cookies is [latex]C[/latex] dollars, where [latex]C=0.0001{x}^{3}-0.02{x}^{2}+3x+300.[/latex] In [latex]t[/latex] weeks production is estimated to be [latex]x=1600+100t[/latex] boxes.
- Find the marginal cost [latex]{C}^{\prime }(x).[/latex]
- Use Leibniz’s notation for the chain rule, [latex]\frac{dC}{dt}=\frac{dC}{dx}·\frac{dx}{dt},[/latex] to find the rate with respect to time [latex]t[/latex] that the cost is changing.
- Use b. to determine how fast costs are increasing when [latex]t=2[/latex] weeks. Include units with the answer.
[T] The formula for the area of a circle is [latex]A=\pi {r}^{2},[/latex] where [latex]r[/latex] is the radius of the circle. Suppose a circle is expanding, meaning that both the area [latex]A[/latex] and the radius [latex]r[/latex] (in inches) are expanding.
- Suppose [latex]r=2-\frac{100}{{(t+7)}^{2}}[/latex] where [latex]t[/latex] is time in seconds. Use the chain rule [latex]\frac{dA}{dt}=\frac{dA}{dr}·\frac{dr}{dt}[/latex] to find the rate at which the area is expanding.
- Use a. to find the rate at which the area is expanding at [latex]t=4[/latex] s.
[T] The formula for the volume of a sphere is [latex]S=\frac{4}{3}\pi {r}^{3},[/latex] where [latex]r[/latex] (in feet) is the radius of the sphere. Suppose a spherical snowball is melting in the sun.
- Suppose [latex]r=\frac{1}{{(t+1)}^{2}}-\frac{1}{12}[/latex] where [latex]t[/latex] is time in minutes. Use the chain rule [latex]\frac{dS}{dt}=\frac{dS}{dr}·\frac{dr}{dt}[/latex] to find the rate at which the snowball is melting.
- Use a. to find the rate at which the volume is changing at [latex]t=1[/latex] min.
[T] The daily temperature in degrees Fahrenheit of Phoenix in the summer can be modeled by the function [latex]T(x)=94-10 \cos \left[\frac{\pi }{12}(x-2)\right],[/latex] where [latex]x[/latex] is hours after midnight. Find the rate at which the temperature is changing at 4 p.m.
[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 [latex]D(t)=5 \sin (\frac{\pi }{6}t-\frac{7\pi }{6})+8,[/latex] where [latex]t[/latex] is the number of hours after midnight. Find the rate at which the depth is changing at 6 a.m.
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
Hint
Use (Figure) with [latex]g(x)=2{x}^{3}+2x-1[/latex]