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

y=f(g(x))g(x).

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.

F1(x)=(1-x)2:
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

y=f(g(x))g(x)=2(1-x)(-1)=-2(1-x)=2x-2.

F2(x)=(1-x)3:
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

y=f(g(x))g(x)=3(1-x)2(-1)=-3(1-x)2.

F3(x)=(1-x)4:
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

y=f(g(x))g(x)=4(1-x)3(-1)=-4(1-x)3.

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

ddx(g(x)n)=n(g(x))n-1g(x).

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)
=20(3x2-5x+7+sinx)19(6x-5+cosx).

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

Solution

  1. (a)

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

    y=f(g(x))g(x)=cos(2x)ddx(2x)=cos(2x)2=2cos2x.
  2. (b)

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

    ddx(lnx)=1x.

    This leads us to:

    y =14x3-2x2ddx(4x3-2x2)
    =14x3-2x2(12x2-4x)
    =12x2-4x4x3-2x2
    =4x(3x-1)2x(2x2-x)
    =2(3x-1)2x2-x.
  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

    y=ex2ddx(x2)=e-x2(-2x)=(-2x)e-x2.
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. Λ

y=-1.68(x-1)+0.54.

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,

ddx(ln(anything))=1anythingddx(anything)=ddx(anything)anything.

A concrete example of this is

ddx(ln(3x15-cosx+ex))=45x14+sinx+ex3x15-cosx+ex.

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

ddx(lnu)=uu.

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

  1. (a)

    ddx(un)=nun-1u.

  2. (b)

    ddx(eu)=ueu.

  3. (c)

    ddx(sinu)=ucosu.

  4. (d)

    ddx(cosu)=-usinu.

  5. (e)

    ddx(tanu)=usec2u.


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.

Solution

  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
    =x5[cos2x3ddx(2x3)]+5x4sin2x3
    =x5(6x2cos2x3)+5x4(sin2x3)
    =6x7cos2x3+5x4sin2x3.
  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
    =e-x215x2-5x3e-x2ddx(-x2)(e-x2)2
    =e-x2(15x2)-5x3((-2x)e-x2)(e-x2)2
    =e-x2(10x4+15x2)e-2x2
    =ex2(10x4+15x2).

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)
=5tan4(6x3-7x)sec2(6x3-7x)ddx(6x3-7x)
=5tan4(6x3-7x)sec2(6x3-7x)(18x2-7)
=5(18x2-7)tan4(6x3-7x)sec2(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.
f(x)=

(lnx2)[-x(sinx-2)(-2x-3)+1(cos(x-2))-2sine4xcose4x(4e4x)]-2xx2[xcos(x-2)-sin2(e4x)](lnx2)2.

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

dydx=dydx.

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,

dydt=dydddddt.

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,

dydx=dydududx=23=6.

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.

Problems

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

  1. 7.

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

  2. 8.

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

  3. 9.

    g(θ)=(sinθ+cosθ)3

  4. 10.

    h(t)=e3t2+t-1

  5. 11.

    f(x)=(x+1x)4

  6. 12.

    p(x)=(x2-1x2)6

  7. 13.

    f(x)=cos(3x)

  8. 14.

    g(x)=tan(5x)

  9. 15.

    h(θ)=tan(θ2+4θ)

  10. 16.

    g(t)=sin(t5+1t)

  11. 17.

    h(t)=sin4(2t)

  12. 18.

    p(t)=cos3(t2+3t+1)

  13. 19.

    g(x)=tan2x-tan(x2)

  14. 20.

    w(x)=sec(ex3)

  15. 21.

    f(x)=ln(cosx)

  16. 22.

    f(x)=ln(x2)

  17. 23.

    f(x)=2ln(x)

  18. 24.

    g(t)=152

  19. 25.

    r(x)=4x-3x2

  20. 26.

    f(x)=(3x2-5)4(2x3-1)2

  21. 27.

    h(x)=[(2x+1)10+1]10

  22. 28.

    f(t)=[(1+1t)-1+1]-1

  23. 29.

    F(x)=2x(2x+1)2(2x+3)3

  24. 30.

    f(x)=x2sin(5x)

  25. 31.

    f(x)=(x2+x)5(3x4+2x)3

  26. 32.

    g(t)=cos(t2+3t)sin(5t-7)

  27. 33.

    g(t)=cos(1t)e5t2

  28. 34.

    f(x)=sin(4x+1)(5x-9)3

  29. 35.

    f(x)=(4x+1)2tan(5x)

  30. 36.

    a(t)=7t3etant2

  31. 37.

    y=sin(cos2x)

  32. 38.

    k(x)=cos(xsinx3)

  33. 39.

    f(x)=x+1x

  34. 40.

    f(x)=x3+x2/3

  35. 41.

    f(t)=1-t2

  36. 42.

    g(t)=tsint

  37. 43.

    h(x)=x1.5

  38. 44.

    f(x)=xπ+x1.9+π1.9

  39. 45.

    g(x)=x+7x

  40. 46.

    f(t)=t5(sect+et)

  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.

Review

  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

Modern Campus CMS