4.4 Chain Rule I

4.4. CHAIN RULE I
4.4
351
Chain Rule I
The chain rule is perhaps the most important of the differentiation rules. It is immensely rich
in application, and very elegantly stated when notation is chosen wisely. In this section we will
look closely at the rule itself, and the underlying intuition of the rule.
The mechanics of applying the rule are of utmost importance, but as with other calculus
principles, understanding the intuition aids in determining when and how to apply the chain rule.
Because of the importance and theoretical richness of the chain rule, the reader is encouraged
to revisit this section from time to time, to reinforce this most important topic.
In its simplest form, the chain rule dictates how we must calculate derivatives of compositions
of functions, i.e., functions of the form h(x) = f (g(x)), especially when we know how to calculate
f ′ and g ′ . With it we will be able to calculate derivatives for a much wider class of functions,
find slopes on implicit curves, and to find so-called related rates relationships among variables.
We will first state the chain rule using our “prime” notation—first introduced by English
mathematician Brook Taylor (1685–1731)—and then re-write it in terms of the more powerful
and explanatory Leibniz notation. (Taylor’s name appears prominently in Chapter 11, which
bears his name.)
4.4.1
Chain Rule in Prime Notation
Theorem 4.4.1 (Chain Rule) Suppose that h(x) = f (g(x)), where g ′ (a) exists and f ′ (g(a))
exists. Then
h′ (a) = [f ′ (g(a))]g ′ (a).
(4.28)
Another way of writing this in Taylor’s prime notation is
′
(f (g(x))) = f ′ (g(x))g ′ (x).
(4.29)
Note that there is an “outer” function, namely f , and an “inner function” g. So the chain rule
is sometimes stated that we compute the derivative of the outer function with respect to the
inner function, that is f ′ (g(x)), and then multiply by the derivative of the inner function, i.e.,
by g ′ (x). That is a common, colloquial way of expressing the chain rule. It should be mentioned
that “multiplying by the derivative of the inner function” is the step that is most commonly
forgotten in such derivative problems.
Example 4.4.1 Compute h′ (x) if h(x) = (x2 + 3x)2 .
Solution: Besides the unwieldy “limit definition,” thus far there are two possible methods for
computing f ′ (x) here:
ˆ Expand the function first, and then compute the derivative, as we would need to do if we
had little more than the power rule to rely upon:
h(x) = x4 + 6x3 + 9x2 =⇒ h′ (x) = 4x3 + 18x2 + 18x.
ˆ Use the chain rule. Here the “outer function” is f (x) = x2 (squaring the input), and the
“inner function” is g(x) = x2 + 3x. Note that f ′ (x) = 2x while g ′ (x) = 2x + 3. Using the
chain rule we would have
h′ (x) = [f ′ (g(x))]g ′ (x) = 2(g(x))1 g ′ (x) = 2(x2 + 3x)1 (2x + 3).
Note that this gives h′ (x) = 2(2x3 + 9x2 + 9x) = 4x3 + 18x2 + 18x as before.
352
CHAPTER 4. THE DERIVATIVE
In Chapter 2 we made some use of a visual device that utilized “empty parentheses” to
illustrate the actions of functions. For the above derivative, we can look at the following:
outer function is
( )2
=⇒
its derivative is
2( )
inner function is ( )2 + 3( )
=⇒
its derivative is
2( ) + 3
The chain rule for this problem could then read:
′
((x)2 + 3(x))2 = 2((x)2 + 3(x)) · [2(x) + 3] = 2(x3 + 3x) · (2x + 3).
As we will see, there are simpler ways of looking at the chain rule than labeling an “outer
function” f (x) and an “inner function” g(x), calculating f ′ and g ′ , and evaluating at g(x) and
x, respectively. Still, there are advantages over expanding the function first. For instance,
expansion might not be so easy. Moreover the final answer using the chain rule is somewhat
factored which helps in, say, constructing its sign chart. The next example will demonstrate
some of these advantages more dramatically.
Example 4.4.2 Find h′ (x) if h(x) = (x3 + 27x + 9)55 .
Solution: Certainly we do not want to multiply this out to use earlier rules. Instead we just
notice that this is a composition of two functions, with the “outer” function being f (x) = x55
and the “inner” function being g(x) = x3 + 27x + 9. Now f ′ (x) = 55x54 , while g ′ (x) = 3x2 + 27.
Thus
h′ (x) = [f ′ (g(x)]g ′ (x) = 55(g(x))54 · g ′ (x) = 55(x3 + 27x + 9)54 · (3x2 + 27).
Even if we had somehow expanded the original, 165-degree polynomial first, and then calculated
the derivative, it is unlikely we would have noticed that our resulting 164-degree polynomial
answer factors so nicely.
The chain rule has much to say about derivatives of functions which contain trigonometric
functions in their structures. Below are two examples where the “outer function” and “inner
function” are squaring and sine functions, respectively and then vice-versa.
Example 4.4.3 Find h′ (x) if h(x) = sin2 x.
Solution: Note that h(x) = (sin x)2 , so the “outer function” is f (x) = x2 , while the “inner
function” is sin x. Next note that f ′ (x) = 2x and g ′ (x) = cos x. Thus
h′ (x) = [f ′ (g(x))]g ′ (x) = [2(g(x))]g ′ (x) = 2 sin x · cos x,
or alternatively,
d
(sin x)2 = 2(sin x) · cos x.
dx
Example 4.4.4 Suppose instead h(x) = sin x2 . Here f (x) = sin x, g(x) = x2 , f ′ (x) = cos x,
g ′ (x) = 2x. Hence
h′ (x) = [f ′ (g(x))]g ′ (x) = cos g(x) · g ′ (x) = cos x2 · 2x = 2x cos x2 ,
or alternatively,
d
sin(x2 ) = cos(x2 ) · 2x = 2x cos x2 .
dx
(It is customary to write the polynomial factor before the trigonometric function factor in the
final answer, so it is clearer what terms are inside the trigonometric function, and which are
multiplying the trigonometric function.)
4.4. CHAIN RULE I
353
Note how it is crucial to identify the outer function and the inner function. It is also important
that the inner function g(x) is inputted into the derivative f ′ of the outer function.
While we identified the outer and inner functions by name, in fact naming an “f (x)” and
“g(x)” is unwieldy and unnecessary. Before long (though usually not immediately) the pattern
of these computations does become natural enough. (Observe in particular the second methods
in each of the two examples given above.)
To show that the chain rule makes sense from the limit-definition standpoint as a derivative
rule, we next offer a partial proof of the chain rule. Note how the way the limit is re-written
reflects the ultimate statement of the chain rule. It also reflects much of the intuition of the rule.
4.4.2
Partial Proof of Chain Rule
We will not completely prove the chain rule in this context because of some technical difficulties
which arise when proving the rule in its most general form. However, we will look at a proof in
perhaps the most common case, which is the case that g(x + ∆x) − g(x) −→ 0 “properly” (so
that we also have (∃δ > 0)[0 < |∆x| < δ −→ g(x + ∆x) − g(x 6= 0]. In such a case we can safely
divide and multiply by g(x + ∆x) − g(x) in the limit definition of the derivative to get
f (g(x + ∆x)) − f (g(x))
d
[f (g(x))] = lim
∆x→0
dx
∆x
f (g(x + ∆x)) − f (g(x)) g(x + ∆x) − g(x)
= lim
.
·
∆x→0
g(x + ∆x) − g(x)
∆x
{z
}
|
{z
} |
(II)
(I)
Now we claim that this limit is f ′ (g(x))g ′ (x). The second term (II) clearly has limit g ′ (x), by
definition. Under the assumption that g(x + ∆x) − g(x) −→ 0 properly as ∆x → 0, we can
substitute ∆g(x) = g(x + ∆x) − g(x) −→ 0, and rewrite the limit (I)38
f (g(x) + ∆g(x)) − f (g(x))
= f ′ (g(x)).
∆g(x)
∆g(x)→0
lim
Note that the computation above is also correct even if ∆g(x) −→ 0+ or ∆g(x) −→ 0− properly,
because the existence of the two-sided limit represented by f ′ (g(x)) is assumed to exist in our
d
f (g(x)) = (I) · (II) = f ′ (g(x)) · g ′ (x), q.e.d.
statement of the chain rule theorem. Thus dx
4.4.3
Leibniz Notation and the Chain Rule
Before we see how the chain rule is stated with Leibniz notation, first we will make some observations about that notation. For example, the following three formulas say the same thing—how
the square of a quantity changes with respect to the quantity—albeit with different variables:
d x2
= 2x,
dx
d t2
= 2t,
dt
d u2
= 2u.
du
See Figure 4.17 for a graphical interpretation of this fact. It is important that in each equation
the variables matched. (Note, for instance, that du2 /dx 6= 2u, as we shall soon see, the problem
38 When
we rewrite f (g(x + ∆x)) = f (g(x) + ∆g(x)), we were justified because
g(x + ∆x) = (g(x + ∆x) − g(x)) + g(x)
= ∆g(x) + g(x)
= g(x) + ∆g(x).
354
CHAPTER 4. THE DERIVATIVE
x2
t2
u2
3
3
3
2
2
2
1
1
1
x
−1
1
u
t
−1
1
−1
1
Figure 4.17: Three identical graphs: x2 versus x, t2 versus t, and u2 versus u. All have the
2
2
2
same slope—though these are dubbed dx
= 2x, dt
= 2t and du
= 2u respectively—at each
dx
dt
du
fixed horizontal axis value. One such value is represented by a black dot on each of the three
graphs.
n
x
being that the variables involved do not match, so the original power rule, namely ddx
= nxn−1
d un
n−1
, does not apply.)
or equivalently du = nu
Now suppose we have a differentiable function u = u(x) and want to take the derivative of
2
(u(x)) . The “outer” function is f (x) = x2 (i.e., squaring what is inside), while the “inner”
function is u = u(x). Consider how we find the derivative of (u(x))2 (a chain rule problem) with
Taylor’s “prime” notation (4.29), and with Leibniz’s notation:
Taylor:
Leibniz:
(u(x))2
′
= 2(u(x))1 · u′ (x)
d u2
d u2 du
du
=
·
= 2u ·
.
dx
du dx
dx
(4.30)
(4.31)
The two notations say the same thing, but the Leibniz notation has several advantages, two of
which we point out here:
2
u
ˆ Resemblance to algebraic manipulations: it appears that we simply decomposed ddx
by
dividing and multiplying by du, yielding derivatives that made sense and could be calculated by known rules (because the variables matched): the first by the power rule, and the
second by whatever method could give us du/dx.
ˆ Variable of differentiation appears explicitly: we know when we are taking the derivative
with respect to x, and when it is with respect to u.
Compare (4.31) to our partial proof from the last subsection. Before giving more computational
examples, we will look at another argument for the validity of the chain rule. We begin with a
very simple example.
Example 4.4.5 Suppose we have a vehicle which always achieves a fuel efficiency rating of
35 mile/gallon, and each gallon costs $1.40. Then we can ask what is the cost per mile. We
can think of this situation as total cost C being a function of total gallons consumed g, i.e.,
C = C(g) and total gallons as a function of total miles, i.e., g = g(m). Ultimately cost is then
a (composite) function of miles, i.e., C = C(g(m)). Now cost per mile will be cost per gallon
4.4. CHAIN RULE I
355
times gallons per mile. In other words, the rate of change in C with respect to total miles m is
$1.40
1 gallon
·
= $0.04/mile .
gallon
35 mile
| {z } | {z } | {z }
dC
dg
dC
=
·
dg
dm
dm
(4.32)
This example is simple because these rates do not change. Still, it is reasonable that even if
dC
will still
these rates dC/dg and dg/dm only hold for an instant in time, during that instant dm
dC dg
be the product dg · dm as above. (This is not a proof, but an argument for reasonableness.) For
that reason, we can similarly do the following (but where the “instant” is a particular value of
x):
d (x3 + 1)2
d (x3 + 1)2 d (x3 + 1)
=
·
= 2(x3 + 1)1 · 3x2 .
(4.33)
dx
d(x3 + 1)
dx
That d(x3 + 1)2 /d(x3 + 1) = 2(x3 + 1) is not much different from the argument in Figure 4.17,
page 354, except the “horizontal axis” would be (x3 + 1) while the vertical would be (x3 + 1)2 .
The derivative with respect to x—which is a “hidden” variable upon which the others depend—is
found by compensation, that is, the rate of change of (x3 + 1)2 with respect to x is found by
first finding its rate of change with respect to (x3 + 1), and then multiplying by a compensating
factor which is the rate of change of (x3 + 1) with respect to x. The idea is very similar to (4.32).
To review (4.33), there we want to know how (x3 + 1)2 changes with respect to x, so we first
ask how does (x3 + 1)2 change with respect to (x3 + 1), i.e., how does the square of a quantity
change with respect to that quantity (power rule)—and multiply by how (x3 + 1) changes as
x changes.39 With this kind of argument we can extend the power rule to have a chain rule
version,
dun
dun du
=
,
·
dx
du dx
|{z}
i.e.,
||
n
du
du
= nun−1 ·
.
dx
dx
(4.34)
Example 4.4.6 With (4.34) we can quickly calculate the following derivatives, which would be
more difficult without the chain rule:
ˆ
ˆ
d
d (29x − x2 )4
= 4(29x − x2 )3 ·
(29x − x2 ) = 4(29x − x2 )3 (29 − 2x).
dx
dx
d (x + 21)9
d(x + 21)
= 9(x + 21)8 ·
= 9(x + 21)8 · 1 = 9(x + 21)8 . Note that occasionally
dx
dx
the derivative du
dx of the “inner function” is just 1.
39 This is somewhat similar to compensating for unmatched units in physics or chemistry problems. If we travel
60 miles in 75 minutes, and we want our average speed in miles/hour, we can first find miles/minute, and then
multiply by a compensating factor which relates minutes to hours:
speed =
mile
60 mile
= 0.8
75 minute
minute
60 minute
·
| 1 hour
{z
}
compensating
factor
= 48
mile
.
hour
Since the question was how the distance relates to hours, we first did the easy computation relating distance to
minutes, and then compensated by multiplying how minutes relate to hours.
356
ˆ
CHAPTER 4. THE DERIVATIVE
d
d
(5x − 9)8 = 8(5x − 9)7 ·
(5x − 9) = 8(5x − 9)7 · 5 = 40(5x − 9)7 .
dx
dx
When we computed
d
8
dx (5x−9) ,
we could have written a Leibniz-style decomposition/expansion,
d(5x − 9)8
d(5x − 9)8 d(5x − 9)
=
·
= 8(5x − 9)7 · 5,
dx
d(5x − 9)
dx
(4.35)
and this is quite correct. However it is not standard practice to write the middle step. Indeed
most authors prefer to avoid having complicated expressions in the denominator of a differential
d
d
d
, dt
, du
, etc. In this text we will still occasionally
operator, preferring denominators as in dx
write as in (4.35) for clarity (which is akin to using a truth table to show a style of argument is
valid), but more often we will just state the chain rule version (4.34) of the power rule with the
correct terms in place of the general u.
The reader is encouraged in the strongest possible terms to always write the first
step of “power rule with chain rule” problems, as shown in the next examples below. This
will avoid common errors, especially as derivative computations become more and more complex,
and such practice will reinforce the proper use of the chain rule version of the power rule, (4.34).
We now list several further examples of this rule, showing in the first step what the rule says
literally for each problem, before the “inner function’s” derivative is computed.
ˆ
d (2x + 9)3
d
= 3(2x + 9)2 ·
(2x + 9) = 3(2x + 9)2 · 2 = 6(2x + 9)2 .
dx
dx
ˆ
d sin2 x
d
d
=
(sin x)2 = 2(sin x)
sin x = 2 sin x cos x. Note that the final answer is undx
dx
dx
derstood to mean 2(sin x)(cos x).
d
d 2
(x + cos x)4 = 4(x2 + cos x)3 (x2 + cos x) = 4(x2 + cos x)3 (2x − sin x).
dx
dx
7
6 d
d
3x2 + 6x + 7 = 7 3x2 + 6x + 7 ·
3x2 + 6x + 7
ˆ
dx
dx
6
2
2
= 7 3x + 6x + 7 (6x + 6) = 7(3x + 6x + 7)6 · 6(x + 1) = 42(3x2 + 6x + 7)(x + 1).
ˆ
n
u
Note that the chain rule version of the power rule, ddx
= nun−1 · du
dx , does not contradict the
d xn
n−1
. For instance, when “u” is equal to x, we can write
earlier power rule that dx = nx
d x9
dx
= 9x8 ·
= 9x8 · 1 = 9x8 ,
dx
dx
9
x
which agrees with our original power rule, which here would give us ddx
= 9x8 . Thus the chain
rule version of the power rule in fact generalizes the original power rule.
4.4.4
Chain Rule Derivatives of Sine and Cosine
Now we look at derivatives of sin u and cos u with respect to x, assuming u = u(x), i.e., that
x
= cos x and
u is actually a function of x. Recall (4.18) and (4.19) from page 317: d sin
dx
d cos x
=
−
sin
x.
The
chain
rule
versions
of
the
derivatives
of
sine
and
cosine
follow
easily from
dx
the Leibniz notation:
d sin u du
du
d sin u
=
·
= cos u ·
,
dx
du
dx
dx
d cos u du
du
d cos u
=
·
= − sin u ·
,
dx
du
dx
dx
4.4. CHAIN RULE I
357
As interesting as the above equations are to behold, in practice one usually uses summary
versions:
du
d sin u
= cos u ·
,
dx
dx
du
d cos u
= − sin u ·
.
dx
dx
(4.36)
(4.37)
Thus derived, we are free to use (4.36) and (4.37) where applicable. In the next example we
show two methods of computing a particular derivative: using a Leibniz-style decomposition,
and applying (4.36) directly.
Example 4.4.7 If f (x) = sin x2 , that is f (x) = sin(x2 ), then we can compute f ′ (x) the following
two ways:
d sin x2
d sin x2 dx2
·
=
= cos x2 · 2x = 2x cos x2 ,
dx
dx2
dx
dx2
d sin x2
= cos x2 ·
= cos x2 · 2x = 2x cos x2 .
dx
dx
(4.38)
(4.39)
In the second method (4.39) for computing the derivative above, we did just insert u = x2 into
(4.36), but the justification for that can also be seen in the first method (4.38) with the Leibnizstyle decomposition. Note also that we computed this same derivative in Example 4.4.4, page
352 using the prime notation.
Example 4.4.8 Compute d fdz(z) if f (z) = cos(z 3 + sin z).
Solution: Here the names of the variables have changed, but the principle of the chain rule is
the same. Again we will compute this two ways, the second using (4.37), except with z in place
of x:
d cos(z 3 + sin z) d(z 3 + sin z)
d
cos(z 3 + sin z) =
·
= − sin(z 3 + sin z) · (3z 2 + cos z),
dz
d(z 3 + sin z)
dz
d(z 3 + sin z)
d
cos(z 3 + sin z) = − sin(z 3 + sin z) ·
= − sin(z 3 + sin z) · (3z 2 + cos z).
f ′ (z) =
dz
dz
f ′ (z) =
Accepted practice is to compute the above derivative using the latter method, and so that is the
method students should eventually strive to reproduce. As in an earlier discussion involving the
power rule, one can think of this example as using the thought pattern that says the derivative
of cosine is minus sine. . . , multiplied by the derivative of what is inside the cosine. That is
perhaps an over-simplification, and should be informed by awareness of what we get from the
Leibniz-style expansion.
To be clear on what (4.36) and (4.37) say, and why these should hold, consider the following
abstract equations, which are in fact restatements of (4.36):40
d sin u
d sin u du
du
=
·
= cos u ·
,
dw
du
dw
dw
d sin θ dθ
dθ
d sin θ
=
·
= cos θ · ,
dξ
dθ
dξ
dξ
d sin x dx
dx
d sin x
=
·
= cos x ·
.
dt
dx
dt
dt
358
CHAPTER 4. THE DERIVATIVE
Note that in all the cases, the decomposition’s first factor let us use the known derivative
formula for sine—because the variables matched—and then we compensated for introducing the
new variable’s derivative (as a fraction of sorts) with the second factor.
We now point out that it is quite common for the chain rule to apply more than once in a
particular problem. Our next example below shows a case of a function within a function within
a function, and the example following will be a sum of two functions, each requiring a chain rule.
3
d
Example 4.4.9 Compute dx
sin (4x) .
3
Solution: Note that the function can be rewritten [sin 4x] . Now we compute the derivative,
first applying the power rule version of the chain rule (4.34), page 355, and then (4.36), page
357. Then we show the same computation using the Leibniz-style decomposition.
d sin 4x
d[sin 4x]3
= 3[sin 4x]2 ·
dx
dx
d(4x)
= 3 sin2 4x · cos 4x
dx
= 3 sin2 4x cos 4x · 4 = 12 sin2 4x cos 4x.
d[sin 4x]3
d[sin 4x]3 d sin 4x d(4x)
=
·
·
dx
d[sin 4x]
d(4x)
dx
= 3[sin 4x]2 · cos 4x · 4 = 12 sin2 4x cos 4x.
So the Leibniz-style decomposition will work for longer “chains” of functions within functions.
3
d sin u
2 du
But so will the abbreviated chain rules which say du
= cos u · du
dx = 3u · dx , and
dx
dx , which
was the first approach in the computations above: after applying the power rule, the “inner”
derivative called another chain rule.41 Again, it is best to strive for the abbreviated approach in
practice, though both approaches are worth studying (and of course the decomposition explains
the abbreviated approach).
Example 4.4.10 Find f ′ (x) if f (x) = sin2 x + cos2 x.
Solution: The larger structure of this function is that of a sum of two functions, so first we
use the sum rule, which tells us to add (and thus first compute) the derivatives of sin2 x and
cos2 x. These are then both chain rules.
d 2
sin x + cos2 x
f ′ (x) =
dx
d 2 d 2 sin x +
cos x
=
dx
dx
d d (sin x)2 +
(cos x)2
=
dx
dx
d
d
= 2(sin x)
sin x + 2(cos x)
cos x
dx
dx
= 2 sin x cos x + 2 cos x(− sin x)
= 2 sin x cos x − 2 cos x sin x
= 0.
to be sure, it should be pointed out that when we write for instance cos x · dx
, we mean that the dx
dt
dt
dx
is outside of the cosine function, i.e., we mean (cos x) · dt . Note that many texts assume this meaning without
making it explicit with the dot “·,” and simply write cos x dx
. As a matter of style, it is assumed the derivative
dt
dx
is
not
part
of
the
argument
of
the
cosine
function
in
such
a case.
dt
41 This phenomenon of “rules calling other rules” occurs repeatedly throughout the rest of the textbook. We
will see it occasionally in this section, and it will become the norm in later sections.
40 Just
4.4. CHAIN RULE I
359
Actually this is what we should hope would be the answer, for the original function we are taking
the derivative of is actually constant:
d 2
d
sin x + cos2 x =
[1] = 0.
dx
dx
It happens frequently in calculus that it is advantageous to algebraically rewrite a function
before taking its derivative. In fact we did that each time we took a derivative of sin2 x = (sin x)2 ,
the latter notation being more obvious in illustrating the composition (function inside of a
function) structure of the original function. For calculus to be consistent (which it is, so no need
to fear!), we should be able to rewrite the function and get the same derivative, as long as we
rewrite the function correctly. The differentiation (derivative computing) rules are eventually
sufficient to compute the derivative no matter how the function is rewritten, but some forms of
a given function are easier to deal with than others.
4.4.5
Power Rule for Rational Powers
With the chain rule we have enough theoretical development to show that the power rule actually
holds for any constant power which is a rational number p/q (where p, q ∈ Z, and of course
q 6= 0). Recall that the set of all rational numbers was denoted Q, for “quotients,” i.e., fractions,
of integers. We already proved the power rule for powers n ∈ {0, 1, 2, 3, · · · }, and that result is
used in the proof for rational powers which we leave the proof until the end of this section, so
we can expeditiously come to examples. But first we state the theorem.
Theorem 4.4.2 (Power Rule for Rational Powers) For any r ∈ Q − {0} (i.e., nonzero
rational numbers),
d xr
= rxr−1 ,
dx
du
d ur
= rur−1 ·
.
dx
dx
(4.40)
(4.41)
Example 4.4.11 For example, the following (which was an exercise with difference quotient
limits in Section 4.1) yields quickly to the power rule:
√
d x1/2
1
1
1
d x
=
= x1/2−1 = x−1/2 = √ .
dx
dx
2
2
2 x
In fact, this particular derivative occurs often enough that it, along with its chain rule version,
deserves special attention (and should be committed to memory):
√
1
d x
= √ ,
(4.42)
dx
2 x
√
d u
1
du
= √ ·
.
(4.43)
dx
2 u dx
p
Example 4.4.12 Find f ′ (x) for f (x) = x2 + 1.
f ′ (x) =
1
d
x
1
d p 2
x2 + 1 = √
·
· (2x) = √
.
x +1= √
2
2
2
dx
2 x + 1 dx
2 x +1
x +1
360
CHAPTER 4. THE DERIVATIVE
Note that in the above example the “outer” function was the square root, while the “inner”
function is x2 + 1. One could write (though again, it is not standard practice):
√
d x2 + 1 d(x2 + 1)
d p 2
1
x
x +1=
·
= √
· 2x = √
.
2
2
dx
d(x2 + 1)
dx
2 x +1
x +1
p
√
Example 4.4.13 Suppose f (x) = x + x. Then the Leibniz decomposition would look like
p
√
√
1
df (x)
d x + x d (x + x)
1
√ ·
.
=
= p
√ · 1+ √
dx
dx
d (x + x)
2 x
2 x+ x
Again—and especially with practice—one would usually not write the Leibniz decomposition in
the first step, but should instead write
√
q
√
d
1
d (x + x)
1
1
p
√
x+ x= p
·
·
1
+
.
=
√
√
dx
dx
2 x
2 x+ x
2 x+ x
√
A common mistake in the above example is to think of x as the inner function, since geometrically
√ it somehow appears to be innermost. In fact the inner function is actually the whole of
x + x.
Example 4.4.14 Suppose f (x) =
f ′ (x) =
2
. Then
(x3 − 9x + 7)7
d 3
2(x − 9x + 7)−7
dx
d 3
(x − 9x + 7)
dx
3
−8
2
= −14(x − 9x + 7) (3x − 9)
= 2 · (−7)(x3 − 9x + 7)−8
=
−14(3x2 − 9)
.
(x3 − 9x + 7)8
In the previous example we were able to use the chain rule version (4.41) of the power rule once
we wrote the function as a power of a polynomial, albeit negative and with a multiplicative
constant along for the ride. The next example calls for a rewriting (for simplicity), and then
calls the chain rule twice.
s
1
√
.
Example 4.4.15 f (x) = 3
x + x3 + 9
"s
#
1
d 3
′
√
f (x) =
dx
x + x3 + 9
−1/3
p
d =
x + x3 + 9
dx
−4/3 d p
p
1
·
x + x3 + 9
= − x + x3 + 9
3
dx
−4/3 p
1
1
d 3
3
· 1+ √
=− x+ x +9
·
(x + 9)
3
2 x3 + 9 dx
−4/3
p
3x2
1
· 1+ √
= − x + x3 + 9
3
2 x3 + 9
4.4. CHAIN RULE I
361
In the calculation above, we first rewrote the expression as a −1
3 power, then used the chain
rule version of the power rule, and used the chain rule again in calculating the derivative of that
“inner” function.
4.4.6
Proof Of Power Rule for Ratoinal Powers
We now divert temporarily to prove the power rule for rational numbers
r ∈ Q =⇒
d xr
= rxr−1 ,
dx
from which the chain rule version also follows. The technique used will recur several times
throughout the text. Fortunately it is somewhat self-explanatory, assuming knowledge of the
general chain rule.
The proof is in two steps, the first being a proof in the case of negative integer powers, from
which we can eventually recover all rational power cases.
d r
Proof: Now we will use the chain rule to show that the power rule, dx
x = rxr−1 ,
holds also for any rational power r = p/q, with p, q nonzero integers. (The case
p = 0 is trivial and the case q = 0 is meaningless.) The proofs below are included
for completeness, and also because they foreshadow a method we will use extensively
later in the text, that method being implicit differentiation.
First we will show that the power rule holds for y = xn for any negative integer
exponents n. In such cases we can write y = x−m for a positive integer exponent m
(namely −n). But then y −1 = xm . Furthermore we already showed in Section 4.1
−1
(Example 4.1.4, page 300) that the derivative definition gives us dydy = −1/y 2
(though the variable used in the proof there was x). Using this and the chain rule,
we get
=⇒
=⇒
=⇒
y −1 = xm
d −1 d m
y
=
[x ]
dx
dx
1 dy
= mxm−1
− 2·
y dx
dy
= −y 2 mxm−1
dx
= −(xn )2 (−n)x−n−1
= nx2n−n−1
= nxn−1 ,
q.e.d.
It is important to that we interpret the first implication correctly. Recall that y = xn ,
so y is a function of x. But then so is y −1 and, in fact, y −1 and xm are the same
functions of x. Hence, if y −1 and xm were graphed versus x, the graphs would be
the same, so the slopes at each x-value would be the same. Therefore y −1 and xm
have the same derivative with respect to x.
Now we will use the chain rule in a similar way to compute the derivatives of rational
powers of x. Suppose y = xp/q , where p, q ∈ Z − {0} are nonzero integers, and that
362
CHAPTER 4. THE DERIVATIVE
r = p/q is in simplified form. Then we can raise both sides of y = xp/q to the power
q to get42
=⇒
=⇒
=⇒
yq
d yq
dx
dy
qy q−1
dx
dy
dx
= xp
d xp
=
dx
= pxp−1
=
p
p
p 1−q p−1
p p/q 1−q p−1
p
p
y x
=
x
x
= · x q −p xp−1 = · x q −1 ,
q
q
q
q
dy
= rxr−1 . Thus y = xr implies the form that we sought to
which can be rewritten dx
prove for the derivative.
In fact, once we have logarithms we can define y = xr for all r ∈ R, and find again that the
derivative is given by the same formula as in our power rules here.
4.4.7
Further Examples
Example 4.4.16 Suppose charge q1 is fixed and q2 is moving away from charge q1 , and r is the
distance between them. When r = 0.1m, we have F = 0.6N. Find dF
dr when r = 0.1m and when
r = 0.3m.
Solution: Recall Coulomb’s Law: F = k qr1 2q2 . Since F = k q1rq22 = (kq1 q2 ) r−2 , and
kq1 q2
(0.1)2
0.6 = (kq1 q2 ) · 100
0.6 =
⇐⇒
⇐⇒ kq1 q2 = 0.006
kq1 q2
0.006
=⇒
F =
=
.
2
r
r2
(Recall that k, q1 and q2 are all constants.) From this we can deduce
dF
d d 0.006
=
0.006r−2 = −2(0.006)r−3 = −0.012r−3
=
dr
dr
r2
dr
dF
0.012
=⇒
=− 3 .
dr
r
With that, we have
Note that for r > 0 we have
decrease in F itself slows.
dF
dr
dF 0.012
=−
= − 12,
dr r=0.1
0.13
dF 0.012
≈ − 0.44.
=−
dr r=0.3
0.33
< 0, so F decreases as r increases. Furthermore, the rate of
42 Note that p or q (but not both, since p/q is simplified) could be negative, but what we are about to do is
justified by the previous result that the power rule also works for negative integer exponents.
4.4. CHAIN RULE I
363
Example 4.4.17 Supply and demand for an item are usually related to its price: demand will
be high if the price is low; producers will supply a large number of an item if the price is high.
The price elasticity of demand is given by the formula43
P dq ,
(4.44)
ε=
q dP where P is the price and q is the quantity for a given demand equation which relates P and q.
Demand is said to be elastic if ε > 1, inelastic if ε < 1, and unitary if ε = 1. Describe the
elasticity of the following demand curve equations:
1
(a) q = 100 − P
3
(b) q =
√
1200 − P
Solution:
dq
= − 13 , and so
(a) For q = 100 − 31 P , we have dP
1
1
P dq P
P
P
=
−
· =
ε=
.
=
q dP 300 − P
100 − 13 P 3 100 − 31 P 3
We can either solve directly for the three cases P/(300 − P ) < 1, > 1, = 1 or we can introduce
P
− 1 and see where this is negative, positive and zero—in short, construct a sign
F (P ) = 300−P
chart for F (P ):
)
P
−300
F (P ) = 300−P
− 1 = P −(300−P
= 2P
300−P
300−P . we can see this is zero when 2P − 300 = 0 ⇐⇒
2P = 300 ⇐⇒ P = 150. This corresponds to ε = 1, so demand is unitary (ε = 1) when
P = 150.
Before constructing the sign chart, we notice that q = 100 − 13 P requires that P < 300, lest
q be negative. Furthermore, we can assume P > 0 as well. With these constraints in mind, we
produce our sign chart:
F (P ) =
Function:
Test P =
Sign Factors:
Sign F (P ):
2(P −150)
300−P
50
⊖/⊕
0
200
⊕/⊕
150
⊖
⊕
300
From the chart we get F (P ) < 0 on 0 < P < 150, F (P ) = 0 at P = 150 and F (P ) > 0 on
150 < P < 300. Equivalently, we get
(inelastic) ε < 0
(unitary) ε = 0
(elastic) ε > 0
43 This
⇐⇒
⇐⇒
⇐⇒
0 < P < 150,
P = 150,
150 < P < 300.
formula is the derivative version of an alternative definition, in which ε is defined as
100% · (∆q)/q
percent change in q
(∆q)/q
=
=
.
(∆P )/P
100% · (∆P )/P
percent change in P
Using the first expression in the line above, and replacing ∆ with d, we see this is approximately (P/q) · (dq/dP ).
However, this quantity being almost always negative, economists tend to verbalize its absolute value instead.
Since P and q are nonnegative (or at least it stretches the imagination to find scenarios where they are negative),
using absolute values with the derivative’s output generally leaves a nonnegative value for ε.
364
CHAPTER 4. THE DERIVATIVE
√
(b) For the case q = 1200 − P , we have
P dq P
d
√ 1
√
ε=
(1200
−
P
)
=
·
q
dP
1200 − P
2 1200 − P dP
−1
1
P
= √ P
· √
· √
=√
1200 − P 2 1200 − P 1200 − P 2 1200 − P
P
.
=
2(1200 − P )
We can use the same technique as we did in (a) to find where ε < 1, > 1, = 1, though this time
we will opt for solving these directly. Note that we must have 0 < P < 1200 due to the definition
of q. Under that assumption, we have:
P
=1
2400 − 2P
⇐⇒
P = 2400 − 2P
ε = 1 ⇐⇒
⇐⇒
ε < 1 ⇐⇒
⇐⇒
⇐⇒
ε > 1 ⇐⇒
⇐⇒
⇐⇒
3p = 2400
⇐⇒ p = 800,
P
<1
2400 − 2P
P < 2400 − 2P
3p < 2400
⇐⇒ p < 800,
P
>1
2400 − 2P
P > 2400 − 2P
3p > 2400
⇐⇒ p > 800,
Remembering our constraint 0 < P < 1200, we can write in fact that
(inelastic)
(unitary)
(elastic)
ε<0
ε=0
ε>0
⇐⇒
⇐⇒
⇐⇒
0 < P < 800,
P = 800,
800 < P < 1200.
It should be noted that we could multiply both sides of the inequalities by 2400 − 2P because
we were operating under the assumption that 0 < P < 1200, and this implies 2400 − 2P > 0. If
we are unsure of the sign of an expression we wish to multiply by to manipulate an inequality,
it is safer to use a sign chart method, which avoids multiplying both sides of an inequality by a
variable quantity (of unknown sign). Also, in a case like (b) we see nearly the same computation
completed three times, and the sign chart somewhat decreases this redundancy. However, the
observant student might combine both ideas, finding where ε = 1 and simply testing the other
regions in simpler cases such as the above.
Example 4.4.18 Suppose an object slides on a straight, frictionless track. Suppose further that
one end of a spring is attached to a fixed point at the end of the track, and that the other end
of the spring is attached to the sliding object. If the object is otherwise free to slide, its motion
will be periodic, of a type known as simple harmonic motion.
Suppose that the equilibrium point for object attached to the spring is at position x = 0,
A is the maximum positive displacement of the object, x(t) is the position of the object at any
given time t, and x(0) = A, we can give the position by
4.4. CHAIN RULE I
365
2π
t ,
x = A cos
T
where T is the period of the motion, that is,
the time required for one complete cycle before the motion repeats. This equation would
hold, for instance, if the object were pulled to
position A and then released at time t = 0.
x
−A
0
A
Find the velocity and acceleration for any time t > 0.
d
x(t), and acceleration a(t) =
Solution: As usual we will define velocity v(t) = dt
the chain rule we get the following computations (note 2π/T is a constant):
d
2π
v(t) =
A cos
t
dt
T
d 2π
2π
t ·
t
= −A sin
T
dt T
2π
2π
= −A sin
t ·
T
T
2π
2πA
sin
t ,
=⇒ v(t) = −
T
T
d
dt v(t).
From
d
v(t)
dt
2πA
d
2π
−
=
sin
t
dt
T
T
2πA
d 2π
2π
=−
cos
t ·
t
T
T
dt T
2πA
2π
2π
=−
cos
t ·
T
T
T
2
2π
2π
sin
t .
=⇒ a(t) = −A
T
T
a(t) =
It is common in the study of oscillating functions to define ω = 2π/T so that the above
computations can be summarized
x = A cos(ωt)
d
dt
=⇒ v = −Aω sin(ωt)
d
dt
=⇒
a = −Aω 2 cos(ωt).
In such a case, the period is given by T = 2π/ω. Note also that a(t) = −ω 2 x(t). This is a
defining feature of simple harmonic oscillators, namely that the force is proportional to but in
the opposite direction of the position. (Recall force = mass × acceleration.) This is the case
with most springs, which conform to Hooke’s Law, F = −kx, where k > 0 is a constant, x is the
position relative to the equilibrium (rest) position of the spring and F is the force it exerts.44
44 Named for Robert Hooke(1635–1703), an English inventor, professor, natural philosopher and architect. His
1678 statement of his law in words read, Ut tensio, sic vis (Latin), meaning, ”As the extension, so the force”.
Hooke was a contemporary of Newton’s, and was very much involved in many of the significant discussions of
his time. For instance, Newton gave him some credit for reviving Newton’s interest in astronomical mechanics,
leading to Newton’s development of the inverse square law of gravitational attraction, which mirrors Coulomb’s
electrostatic law (4.21), page 329, though there are no cases of gravitational repulsion in Newton’s law (only
attraction).
366
CHAPTER 4. THE DERIVATIVE
Exercises
For 1–6, use the power rule to compute
the derivative, after re-writing the problem.
d
(axn ) = a ·
In particular, you can use dx
n−1
nx
.
d
1
1.
dx x11
d
1
√
2.
dx
x
i
d h√
3
x4
3.
dx
d 6
4.
dx x
d
1
5.
dt 2t2
d hp i
9y Recall (ab)n = an bn any6.
dy
time a, b ≥ 0.
For 7–10, compute the given derivative.
d (1 − 9x)11
dx
d 8.
27(3x2 − 10x + 55)2 .
dx
i
d hp 5
2x − 1
9.
dx
14. f (x) =
d
(3x + 1)2 (Do this two ways: using
dx
the chain rule, and by first expanding
the square. Compare your answers.)
For 11–14, compute f ′ (x).
11. f (x) = (x + 5)100 .
12. f (x) = (2x + 5)100 .
13. f (x) =
(x4
1
.
− x + 1)3
x+
q
√
x + x.
Compute the following derivatives.
d sin z
dx
d cos θ
16.
dt
15.
d x7
dt
d sin(cos x)
18.
d cos x
17.
For 19–23, compute the given derivative.
19.
20.
21.
22.
7.
10.
r
23.
24.
√
d sin x
dx
d √
sin x
dx
d sin(cos x)
dx
d
cos3 x
dx
d
cos(x + cos x)
dx
Find h′ (9) if h(x) = f (g(x)), g(9) = 5,
g ′ (9) = 2, and f ′ (5) = 7.
25. On the unit circle, y 2 = 1 − x2 . If we
take either the upper semicircle or the
lower semicircle, then y is also a function of x. Find the tangent line to the
graph at the point (3/5, 4/5) by finding
dy
dx two ways:
p
(a) Using y = 1 − x2 for the upper
semicircle, and the chain rule.
d
to both sides of
(b) By applying dx
2
2
y = 1 − x , as we did in the proof
of Theorem 4.4.2, and then solvdy
ing for dx
, and plugging into that
expression (x, y) = (3/5, 4/5).
4.4. CHAIN RULE I
367
26. Using sec x = (cos x)−1 ,
d
sec x = sec x tan x.
dx
(b) Use (a) and the chain rule to comp
d
sec x2 + 1.
pute
dx
(a) derive
27. Show that if k, q1 , q2 are constant in
Coulomb’s law (4.21), page 329, then
F
dF
dr = −2 r .
28. As a charge q2 moves away from a
stationary chage q1 , the instantaneous
rate of change of the Coulomb force
F with respect to r is measured to be
5N/m.
(a) Find the magnitude of the force
between the charges when they
are 0.3m apart.
(See Example 4.4.16, page 362.)
(b) If we are given that k = 9 × 109
N· m2 /C, and q2 = 3×10−6C, find
the equation for the force between
the two particles when separated
by a distance r.
(c) Find dF
dr from (b) when r =
0.25M.
29. The gravitational force of attraction
between any two masses is directly
proportional to the product of the
masses and inverseley proportional to
the square of the distance between
them. In particular,
F =G
m1 m2
,
r2
(4.45)
where G ≈ 6.67 × 10−11 N(m)2 /(kg)2
is the universal gravitational constant,
m1 , m2 are in kg, and r is in m. Find
the rate of change of F with respect
to distance r (i.e., find dF/dr) when
r = 0.5m.
30. An object moves along the x-axis according to the equation s(t) = t+2 sin t.
Find those values of t when the object
45 Here
is moving to the left, i.e., find where
s′ (t) < 0, within the interval t ∈ [0, 2π].
31. Suppose that the cost in thousands of
dollars to manufacture x thousands of
items is given by
C(x) = 0.003x3 + 0.2x2 + 0.3x + 70,
where x ∈ [0, 10].
(a) Find the (proxy) marginal cost
function, C ′ (x).
(b) Determine the marginal cost at
x = 4 (in units of thousands of
dollars per thousands of items,
which simplifies to dollers per
item).45
(c) Find the average rate of change
of cost in going from x = 3.9 to
x = 4.1.
(d) Compare the answers to parts (b)
and (c).
32. Consider the following alternating current circuit:
R
V
L
The current I where the resistor R and
an inductor L are present is given by
V
,
I= p
R2 + (2πf L)2
where V is the voltage and f is the
current’s frequency of alternation (in
cycles/second, or Hertz, also written
Hz). Assuming that V, R and f are
constants, find an equation for the instantaneous rate of change of current I
with respect to inductance L.
marginal cost would represent the cost of the next thousand items.