Skip to Content
OpenStax Logo
Calculus Volume 1

3.6 The Chain Rule

Calculus Volume 13.6 The Chain Rule
  1. Preface
  2. 1 Functions and Graphs
    1. Introduction
    2. 1.1 Review of Functions
    3. 1.2 Basic Classes of Functions
    4. 1.3 Trigonometric Functions
    5. 1.4 Inverse Functions
    6. 1.5 Exponential and Logarithmic Functions
    7. Key Terms
    8. Key Equations
    9. Key Concepts
    10. Chapter Review Exercises
  3. 2 Limits
    1. Introduction
    2. 2.1 A Preview of Calculus
    3. 2.2 The Limit of a Function
    4. 2.3 The Limit Laws
    5. 2.4 Continuity
    6. 2.5 The Precise Definition of a Limit
    7. Key Terms
    8. Key Equations
    9. Key Concepts
    10. Chapter Review Exercises
  4. 3 Derivatives
    1. Introduction
    2. 3.1 Defining the Derivative
    3. 3.2 The Derivative as a Function
    4. 3.3 Differentiation Rules
    5. 3.4 Derivatives as Rates of Change
    6. 3.5 Derivatives of Trigonometric Functions
    7. 3.6 The Chain Rule
    8. 3.7 Derivatives of Inverse Functions
    9. 3.8 Implicit Differentiation
    10. 3.9 Derivatives of Exponential and Logarithmic Functions
    11. Key Terms
    12. Key Equations
    13. Key Concepts
    14. Chapter Review Exercises
  5. 4 Applications of Derivatives
    1. Introduction
    2. 4.1 Related Rates
    3. 4.2 Linear Approximations and Differentials
    4. 4.3 Maxima and Minima
    5. 4.4 The Mean Value Theorem
    6. 4.5 Derivatives and the Shape of a Graph
    7. 4.6 Limits at Infinity and Asymptotes
    8. 4.7 Applied Optimization Problems
    9. 4.8 L’Hôpital’s Rule
    10. 4.9 Newton’s Method
    11. 4.10 Antiderivatives
    12. Key Terms
    13. Key Equations
    14. Key Concepts
    15. Chapter Review Exercises
  6. 5 Integration
    1. Introduction
    2. 5.1 Approximating Areas
    3. 5.2 The Definite Integral
    4. 5.3 The Fundamental Theorem of Calculus
    5. 5.4 Integration Formulas and the Net Change Theorem
    6. 5.5 Substitution
    7. 5.6 Integrals Involving Exponential and Logarithmic Functions
    8. 5.7 Integrals Resulting in Inverse Trigonometric Functions
    9. Key Terms
    10. Key Equations
    11. Key Concepts
    12. Chapter Review Exercises
  7. 6 Applications of Integration
    1. Introduction
    2. 6.1 Areas between Curves
    3. 6.2 Determining Volumes by Slicing
    4. 6.3 Volumes of Revolution: Cylindrical Shells
    5. 6.4 Arc Length of a Curve and Surface Area
    6. 6.5 Physical Applications
    7. 6.6 Moments and Centers of Mass
    8. 6.7 Integrals, Exponential Functions, and Logarithms
    9. 6.8 Exponential Growth and Decay
    10. 6.9 Calculus of the Hyperbolic Functions
    11. Key Terms
    12. Key Equations
    13. Key Concepts
    14. Chapter Review Exercises
  8. A | Table of Integrals
  9. B | Table of Derivatives
  10. C | Review of Pre-Calculus
  11. Answer Key
    1. Chapter 1
    2. Chapter 2
    3. Chapter 3
    4. Chapter 4
    5. Chapter 5
    6. Chapter 6
  12. Index

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


This expression does not seem particularly helpful; however, we can modify it by multiplying and dividing by the expression x3a3x3a3 to obtain


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,


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 xa,ua3:xa,ua3:


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 (fg)(x)=f(g(x))(fg)(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


is given by


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



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)=nxn1.f(x)=nxn1. Thus, f(g(x))=n(g(x))n1.f(g(x))=n(g(x))n1. 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 x for which the derivative is defined, if




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+2x1)4.h(x)=(2x3+2x1)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(3x5)2h(x)=1(3x5)2 at x=2.x=2.

Checkpoint 3.35

Find the equation of the line tangent to the graph of f(x)=(x22)3f(x)=(x22)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,


Example 3.54

Combining the Chain Rule with the Product Rule

Find the derivative of h(x)=(2x+1)5(3x2)7.h(x)=(2x+1)5(3x2)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


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 x for which the function is differentiable, if




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.


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 xaxa 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):


Rewriting, we obtain


Although it is clear that


it is not obvious that


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


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




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,




Rule: Chain Rule Using Leibniz’s Notation

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


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(4x23x+1).y=tan(4x23x+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.













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.
















For the following exercises, find dydxdydx for each function.






















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


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)


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


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


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


Find the xx-coordinates at which the tangent line to y=(x6x)8y=(x6x)8 is horizontal.


[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

















[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?

[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:


  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.

[T] The total cost to produce xx boxes of Thin Mint Girl Scout cookies is CC dollars, where C=0.0001x30.02x2+3x+300.C=0.0001x30.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.

[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=2100(t+7)2r=2100(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.

[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)2112r=1(t+1)2112 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.

[T] The daily temperature in degrees Fahrenheit of Phoenix in the summer can be modeled by the function T(x)=9410cos[π12(x2)],T(x)=9410cos[π12(x2)], where xx 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 D(t)=5sin(π6t7π6)+8,D(t)=5sin(π6t7π6)+8, where tt is the number of hours after midnight. Find the rate at which the depth is changing at 6 a.m.


Want to cite, share, or modify this book? This book is Creative Commons Attribution-NonCommercial-ShareAlike License 4.0 and you must attribute OpenStax.

Attribution information
  • If you are redistributing all or part of this book in a print format, then you must include on every physical page the following attribution:
    Access for free at
  • If you are redistributing all or part of this book in a digital format, then you must include on every digital page view the following attribution:
    Access for free at
Citation information

© Sep 2, 2020 OpenStax. Textbook content produced by OpenStax is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike License 4.0 license. The OpenStax name, OpenStax logo, OpenStax book covers, OpenStax CNX name, and OpenStax CNX logo are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.