2 Derivatives

2.5 The Chain Rule

We have covered almost all of the derivative rules that deal with combinations of two (or more) functions. The operations of addition, subtraction, multiplication (including by a constant) and division led to the Sum and Difference rules, the Constant Multiple Rule, the Power Rule, the Product Rule and the Quotient Rule. To complete the list of differentiation rules, we look at the last way two (or more) functions can be combined: the process of composition (i.e. one function “inside” another).

One example of a composition of functions is f(x)=cos(x2). We currently do not know how to compute this derivative. If forced to guess, one would likely guess f(x)=-sin(2x), where we recognize -sinx as the derivative of cosx and 2x as the derivative of x2. However, this is not the case; f(x)-sin(2x). In Example 2.5.4 we’ll see the correct answer, which employs the new rule this section introduces, the Chain Rule.

Before we define this new rule, recall the notation for composition of functions. We write (fg)(x) or f(g(x)), read as “f of g of x,” to denote composing f with g. In shorthand, we simply write fg or f(g) and read it as “f of g.” Before giving the corresponding differentiation rule, we note that the rule extends to multiple compositions like f(g(h(x))) or f(g(h(j(x)))), etc.

To motivate the rule, let’s look at three derivatives we can already compute.

Example 2.5.1 Exploring similar derivatives

Find the derivatives of F1(x)=(1-x)2, F2(x)=(1-x)3, and F3(x)=(1-x)4. (We’ll see later why we are using subscripts for different functions and an uppercase F.)

SolutionIn order to use the rules we already have, we must first expand each function as F1(x)=1-2x+x2, F2(x)=1-3x+3x2-x3 and F3(x)=1-4x+6x2-4x3+x4.

It is not hard to see that:

F1(x) =-2+2x,
F2(x) =-3+6x-3x2  and
F3(x) =-4+12x-12x2+4x3.

An interesting fact is that these can be rewritten as

F1(x) =-2(1-x),
F2(x) =-3(1-x)2  and
F3(x) =-4(1-x)3.

A pattern might jump out at you. Recognize that each of these functions is a composition, letting g(x)=1-x:

F1(x) =f1(g(x)), where f1(x)=x2,
F2(x) =f2(g(x)), where f2(x)=x3,
F3(x) =f3(g(x)), where f3(x)=x4.

We’ll come back to this example after giving the formal statements of the Chain Rule; for now, we are just illustrating a pattern.

Theorem 2.5.1 The Chain Rule

Let y=f(u) be a differentiable function of u and let u=g(x) be a differentiable function of x. Then y=f(g(x)) is a differentiable function of x, and


We can think of this as taking the derivative of the outer function evaluated at the inner function times the derivative of the inner function. To help understand the Chain Rule, we return to Example 2.5.1.

Example 2.5.2 Using the Chain Rule

Use the Chain Rule to find the derivatives of the functions given in Example 2.5.1.

SolutionExample 2.5.1 ended with the recognition that each of the given functions was actually a composition of functions. To avoid confusion, we ignore most of the subscripts here.

We found that

y=(1-x)2=f(g(x)), where f(x)=x2 and g(x)=1-x.

To find y, we apply the Chain Rule. We need f(x)=2x and g(x)=-1.

Part of the Chain Rule uses f(g(x)). This means substitute g(x) for x in the equation for f(x). That is, f(x)=2(1-x). Finishing out the Chain Rule we have


Let y=(1-x)3=f(g(x)), where f(x)=x3 and g(x)=(1-x). We have f(x)=3x2, so f(g(x))=3(1-x)2. The Chain Rule then states


Finally, when y=(1-x)4, we have f(x)=x4 and g(x)=(1-x). Thus f(x)=4x3 and f(g(x))=4(1-x)3. Thus


Example 2.5.2 demonstrated a particular pattern: when f(x)=xn and y=f(g(x)), then y=n(g(x))n-1g(x). This is called the Generalized Power Rule.

Theorem 2.5.2 Generalized Power Rule

Let g(x) be a differentiable function. Then


This allows us to quickly find the derivative of functions like y=(3x2-5x+7+sinx)20. While it may look intimidating, the Generalized Power Rule states that

y =20(3x2-5x+7+sinx)19ddx(3x2-5x+7+sinx)

Treat the derivative-taking process step-by-step. In the example just given, first multiply by 20, then rewrite the inside of the parentheses, raising it all to the 19th power. Then think about the derivative of the expression inside the parentheses, and multiply by that.

We now consider more examples that employ the Chain Rule.

Example 2.5.3 Using the Chain Rule

Find the derivatives of the following functions:

1.y=sin2x    2.y=ln(4x3-2x2)    3.y=e-x2


  1. (a)

    Consider y=sin2x. Recognize that this is a composition of functions, where f(x)=sinx and g(x)=2x. Thus

  2. (b)

    Recognize that y=ln(4x3-2x2) is the composition of f(x)=lnx and g(x)=4x3-2x2. Also, recall that


    This leads us to:

    y =14x3-2x2ddx(4x3-2x2)
  3. (c)

    Recognize that y=e-x2 is the composition of f(x)=ex and g(x)=-x2. Remembering that f(x)=ex, we have

Example 2.5.4 Using the Chain Rule to find a tangent line

Let f(x)=cosx2. Find the equation of the line tangent to the graph of f at x=1.

SolutionThe tangent line goes through the point (1,f(1))(1,0.54) with slope f(1). To find f, we need the Chain Rule.

f(x)=-sin(x2)(2x)=-2xsinx2. Evaluated at x=1, we have f(1)=-2sin1-1.68. Thus the equation of the tangent line is approximately margin: -22-1-0.50.51xy Figure 2.5.1: f(x)=cosx2 sketched along with its tangent line at x=1. Λ


The tangent line is sketched along with f in Figure 2.5.1.

The Chain Rule is used often in taking derivatives. Because of this, one can become familiar with the basic process and learn patterns that facilitate finding derivatives quickly. For instance,


A concrete example of this is


While the derivative may look intimidating at first, look for the pattern. The denominator is the same as what was inside the natural log function; the numerator is simply its derivative.

This pattern recognition process can be applied to lots of functions. In general, instead of writing “anything”, we use u as a generic function of x. We then say


The following is a short list of how the Chain Rule can be quickly applied to familiar functions.

  1. (a)


  2. (b)


  3. (c)


  4. (d)


  5. (e)


Of course, the Chain Rule can be applied in conjunction with any of the other rules we have already learned. We practice this next.

Example 2.5.5 Using the Product, Quotient and Chain Rules

Find the derivatives of the following functions.

1.f(x)=x5sin2x3    2.f(x)=5x3e-x2.


  1. (a)

    We must use the Product and Chain Rules. Do not think that you must be able to “see” the whole answer immediately; rather, just proceed step-by-step.

    f(x) =x5ddx(sin2x3)+ddx(x5)sin2x3
  2. (b)

    We must employ the Quotient Rule along with the Chain Rule. Again, proceed step-by-step.

    f(x) =e-x2ddx(5x3)-5x3ddxe-x2(e-x2)2

A key to correctly working these problems is to break the problem down into smaller, more manageable pieces. For instance, when using the Product and Chain Rules together, just consider the first part of the Product Rule at first: f(x)g(x). Just rewrite f(x), then find g(x). Then move on to the f(x)g(x) part. Don’t attempt to figure out both parts at once.

Likewise, using the Quotient Rule, approach the numerator in two steps and handle the denominator after completing that. Only simplify afterward.

We can also employ the Chain Rule itself several times, as shown in the next example.

Example 2.5.6 Using the Chain Rule multiple times

Find the derivative of y=tan5(6x3-7x).

SolutionRecognize that we have the function g(x)=tan(6x3-7x) “inside” the function f(x)=x5; that is, we have y=(tan(6x3-7x))5. We use the Chain Rule multiple times, beginning with the Generalized Power Rule:

y =5(tan(6x3-7x))4ddxtan(6x3-7x)

This function is frankly a ridiculous function, possessing no real practical value. It is very difficult to graph, as the tangent function has many vertical asymptotes and 6x3-7x grows so very fast. The important thing to learn from this is that the derivative can be found. In fact, it is not “hard;” one must take several small steps and be careful to keep track of how to apply each of these steps.

It is a traditional mathematical exercise to find the derivatives of arbitrarily complicated functions just to demonstrate that it can be done. Just break everything down into smaller pieces.

Example 2.5.7 Using the Product, Quotient and Chain Rules

Find the derivative of f(x)=xcos(x-2)-sin2(e4x)lnx2.

SolutionThis function likely has no practical use outside of demonstrating derivative skills. The answer is given below without simplification. It employs the Quotient Rule, the Product Rule, and the Chain Rule three times.


The reader is highly encouraged to look at each term and recognize why it is there. This example demonstrates that derivatives can be computed systematically, no matter how arbitrarily complicated the function is.

Alternate Chain Rule Notation

It is instructive to understand what the Chain Rule “looks like” using “dydx” notation instead of y notation. Suppose that y=f(u) is a function of u, where u=g(x) is a function of x, as stated in Theorem 2.5.1. Then, through the composition fg, we can think of y as a function of x, as y=f(g(x)). Thus the derivative of y with respect to x makes sense; we can talk about dydx. This leads to an interesting progression of notation:

y =f(g(x))g(x)
dydx =y(u)u(x) (since y=f(u) and u=g(x))
dydx =dydududx (using “fractional” notation for the derivative)

Here the “fractional” aspect of the derivative notation stands out. On the right hand side, it seems as though the “du” terms divide out, leaving


It is important to realize that we are not dividing these terms; the derivative notation of dydx is one symbol. It is equally important to realize that this notation was chosen precisely because of this behavior. It makes applying the Chain Rule easy with multiple variables. For instance,


where and are any variables you’d like to use.

margin: xudydu=3dudx=2dydx=6y Figure 2.5.2: A series of gears to demonstrate the Chain Rule. Note how dydx=dydududx Λ

One of the most common ways of “visualizing” the Chain Rule is to consider a set of gears, as shown in Figure 2.5.2. The gears have 36, 18, and 6 teeth, respectively. That means for every revolution of the x gear, the u gear revolves twice. That is, the rate at which the u gear makes a revolution is twice as fast as the rate at which the x gear makes a revolution. Using the terminology of calculus, the rate of u-change, with respect to x, is dudx=2.

Likewise, every revolution of u causes 3 revolutions of y: dydu=3. How does y change with respect to x? For each revolution of x, y revolves 6 times; that is,


We can then extend the Chain Rule with more variables by adding more gears to the picture.

It is difficult to overstate the importance of the Chain Rule. So often the functions that we deal with are compositions of two or more functions, requiring us to use this rule to compute derivatives. It is often used in practice when actual functions are unknown. Rather, through measurement, we can calculate dydu and dudx. With our knowledge of the Chain Rule, finding dydx is straightforward.

In the next section, we use the Chain Rule to justify another differentiation technique. There are many curves that we can draw in the plane that fail the “vertical line test.” For instance, consider x2+y2=1, which describes the unit circle. We may still be interested in finding slopes of tangent lines to the circle at various points. The next section shows how we can find dydx without first “solving for y.” While we can in this instance, in many other instances solving for y is impossible. In these situations, implicit differentiation is indispensable.

Exercises 2.5


Terms and Concepts

  1. 1.

    T/F: The Chain Rule describes how to evaluate the derivative of a composition of functions.

  2. 2.

    T/F: The Generalized Power Rule states that ddx(g(x)n)=n(g(x))n-1.

  3. 3.

    T/F: ddx(ln(x2))=1x2.

  4. 4.

    T/F: ddx(ex2)=ex2.

  5. 5.

    T/F: dxdy=dxdtdtdy

  6. 6.

    T/F: Taking the derivative of f(x)=x2sin(5x) requires the use of both the Product and Chain Rules.


In Exercises 7–46., compute the derivative of the given function.

  1. 7.


  2. 8.


  3. 9.


  4. 10.


  5. 11.


  6. 12.


  7. 13.


  8. 14.


  9. 15.


  10. 16.


  11. 17.


  12. 18.


  13. 19.


  14. 20.


  15. 21.


  16. 22.


  17. 23.


  18. 24.


  19. 25.


  20. 26.


  21. 27.


  22. 28.


  23. 29.


  24. 30.


  25. 31.


  26. 32.


  27. 33.


  28. 34.


  29. 35.


  30. 36.


  31. 37.


  32. 38.


  33. 39.


  34. 40.


  35. 41.


  36. 42.


  37. 43.


  38. 44.


  39. 45.


  40. 46.


  1. 47.

    If k(x)=f(g(x)) with f(2)=-4, g(2)=2, f(2)=3, and g(2)=5. Find k(2).

  2. 48.

    Suppose r(x)=f(g(h(x))), where h(1)=2, g(2)=3, h(1)=3, g(2)=5, and f(3)=6. Find r(1).

  3. 49.
    If f and g are functions whose graphs are shown, evaluate the expressions.-2-11234-3-2-11234gfxy * (a) (fg)(-1) (b) (gf)(0) (c) (gg)(-1) (d) (ff)(4)
  4. 50.
    xf(x)f(x)g(x)g(x)1454540711266463 Use the given table of values for f, g, f, and g to find (a) (fg)(6) (b) (gf)(1) (c) (gg)(6) (d) (ff)(1)

In Exercises 51–54., find the equations of tangent line to the graph of the function at the given point. Note: the functions here are the same as in Exercises 7.10..

  1. 51.

    f(x)=(4x3-x)10 at x=0

  2. 52.

    f(t)=(3t-2)5 at t=1

  3. 53.

    g(θ)=(sinθ+cosθ)3 at θ=π/2

  4. 54.

    h(t)=e3t2+t-1 at t=-1

  1. 55.
    Compute ddx(ln(kx)) two ways: (a) Using the Chain Rule, and (b) by first using the logarithm rule ln(ab)=lna+lnb, then taking the derivative.
  2. 56.
    Compute ddx(ln(xk)) two ways: (a) Using the Chain Rule, and (b) by first using the logarithm rule ln(ap)=plna, then taking the derivative.
  3. 57.
    Use the Chain Rule to prove the following: (a) The derivative of an even function is an odd function. (b) The derivative of an odd function is an even function.
  4. 58.

    Use the Chain Rule and Product Rule to give an alternative proof of the Quotient Rule. (Hint: write f(x)/g(x) as f(x)[g(x)]-1).

  5. 59.

    Use the Chain Rule to express the second derivative of f(g(x)) in terms of first and second derivatives of f and g.


  1. 60.
    The “wind chill factor” is a measurement of how cold it “feels” during cold, windy weather. Let W(w) be the wind chill factor, in degrees Fahrenheit, when it is 25F outside with a wind of w mph. (a) What are the units of W(w)? (b) What would you expect the sign of W(10) to be?
  2. 61.

    Find the derivative of f(x)=x2excotx

Omni CMS