Differentiation of Compositions of Functions (Section 3.4)
Section 3.4
Difference Equations
to
Differential Equations
Differentiation of Compositions
of Functions
In this section we will consider the relationship between the derivative of the composition
of two functions and the derivatives of the individual functions being composed. We shall
see that the resulting differentiation rule, known as the chain rule, will be useful in a
variety of situations in our later work. The following example will set the stage.
Example Consider a spherical balloon which is being inflated so that its radius is increasing at a rate of 2 centimeters per second. If we let r denote the radius of the balloon
in centimeters, t denote time in seconds, and V denote the volume of the balloon in cubic
centimeters, then we know that r = 2t and
V =
4 3
πr .
3
Moreover, we can see that, as a function of t,
V =
4
32 3
π(2t)3 =
πt .
3
3
At time t = 5, the rate of change of the radius with respect to time is
dr
= 2 centimeters per second,
dt t=5
the rate of change of the volume with respect to the radius is
dV
= 4πr2
= 400π centimeters per centimeter,
dr r=10
r=10
and the rate of change of the volume with respect to time is
dV
= 32πt2
= 800π cubic centimeters per second,
dt t=5
t=5
where dV
dr is evaluated at r = 10 since this is the value of r when t = 5. It follows that
dV
dV
dr
=
.
dt t=5
dr r=10 dt t=5
That is, the overall rate of change of V with respect to t is the product of the rate of change
of V with respect to r and the rate of change of r with respect to t. This is an example
1
Copyright c by Dan Sloughter 2000
2
Differentiation of Compositions of Functions
Section 3.4
of the chain rule. Viewed in this manner, the chain rule is saying that if V changes 400π
times as fast as r and r changes 2 times as fast as t, then V changes (400π)(2) = 800π
times as fast as t.
Another interesting special case of the chain rule arises with the composition of two
affine functions. Specifically, if f (x) = ax + b and g(x) = cx + d, where a, b, c, and d are
all constants, then
f ◦ g(x) = f (g(x)) = f (cx + d) = a(cx + d) + b = acx + ad + b.
Thus the slope of graph of f ◦ g is ac, the product of the slopes of the graphs of f and g.
In terms of derivatives, this says that
(f ◦ g)0 (x) = ac = f 0 (g(x))g 0 (x).
The chain rule says this relationship holds for all differentiable functions.
For the general case, suppose g is differentiable at a point c and f is differentiable at
g(c). We wish to compute the value of the derivative of f ◦ g at c. We have
f ◦ g(c + h) − f ◦ g(c)
f (g(c + h)) − f (g(c))
= lim
.
h→0
h→0
h
h
(f ◦ g)0 (c) = lim
(3.4.1)
As with our demonstrations of the quotient and product rules, we need to manipulate
(3.4.1) into a form which allows us to evaluate the limit in terms of what we already know.
The trick that works this time is to multiply and divide by g(c + h) − g(c). However, we
must be aware of one possible complication: In order to divide by g(c + h) − g(c) we must
be assured that g(c + h) − g(c) 6= 0 for all h in some interval about 0. We will assume that
this is the case. If in fact this were not the case, then one can show that both (f ◦g)0 (c) = 0
and g 0 (c) = 0, giving us the desired result that
(f ◦ g)0 (c) = f 0 (g(c))g 0 (c).
With our assumption, we have
0
(f ◦ g) (c) = lim
h→0
f (g(c + h)) − f (g(c))
g(c + h) − g(c)
g(c + h) − g(c)
h
.
(3.4.2)
Since g is differentiable at c, we have
g(c + h) − g(c)
= g 0 (c).
h→0
h
lim
(3.4.3)
Since f is differentiable at g(c), if we let s = g(c + h) − g(c), then
f (g(c) + s) − f (g(c))
f (g(c + h)) − f (g(c))
= lim
= f 0 (g(c)),
s→0
h→0
g(c + h) − g(c)
s
lim
(3.4.4)
Section 3.4
Differentiation of Compositions of Functions
3
where we have used the continuity of g at c to ascertain that s goes to 0 as h goes to 0.
Putting (3.4.2), (3.4.3) and (3.4.4) together, we now have
(f ◦ g)0 (c) = f 0 (g(c))g 0 (c),
(3.4.5)
which is our desired result.
Chain Rule
If f and g are differentiable, then
(f ◦ g)0 (x) = f 0 (g(x))g 0 (x).
(3.4.6)
Example Suppose h(x) = (1 + x2 )10 . Then h(x) = f ◦ g(x) where g(x) = 1 + x2 and
f (x) = x10 . Now
g 0 (x) = 2x
and
f 0 (x) = 10x9 ,
so
h0 (x) = (f ◦ g)0 (x) = f 0 (g(x))g 0 (x) = f 0 (1 + x2 )(2x) = 10(1 + x2 )9 (2x) = 20x(1 + x2 )9 .
Note that the preceding example is a particular case of the following general example.
If g is a differentiable function, n 6= 0 is an integer, and h(x) = (g(x))n , then h(x) = f ◦g(x)
where f (x) = xn . Then we have
f 0 (x) = nxn−1 ,
and so
h0 (x) = (f ◦ g)0 (x) = f 0 (g(x))g 0 (x) = n(g(x))n−1 g 0 (x).
That is,
d
(g(x)n ) = n(g(x))n−1 g 0 (x).
dx
Example
To illustrate the previous comments,
d
d
(3x − 2)6 = 6(3x − 2)5 (3x − 2) = 6(3x − 2)5 (3) = 18(3x − 2)5 .
dx
dx
Example
For another illustration, if
f (x) =
3
(x3 + 4)5
,
then
f 0 (x) = (−5)(3)(x3 + 4)−6
d 3
45x2
(x + 4) = −15(x3 + 4)−6 (3x2 ) = − 3
.
dx
(x + 4)6
(3.4.7)
4
Differentiation of Compositions of Functions
Section 3.4
If we translate the chain rule into the notation of Leibniz, we obtain a formulation like
that of the first example. Specifically, if we let y = f (x) and x = g(t), then
dy
dy
dx
= (f ◦ g)0 (c) = f 0 (g(c))g 0 (c) =
.
dt t=c
dx x=g(c) dt t=c
(3.4.8)
For short, we write
dy dx
dy
=
.
(3.4.9)
dt
dx dt
This formula is easy to remember, but at the same time care must be taken to remember
dy
that if we want to evaluate dy
dt at t = c, then we must evaluate dx at x = g(c).
Example Suppose that for a certain city, when the population of the city is p, the total
√
amount of waste deposited in the city landfill every day is given by W = 5 p pounds per
day. Moreover, suppose that the population of the city is growing so that t years from now
the population will be
p = 100, 000(1 + 0.04t + 0.008t2 ).
To find the rate of change of W with respect to t five years from now, we note that
p = 140, 000 when t = 5 and then compute
5
5
dW
= √
= √
dp p=140,000
2 p p=140,000
2 140, 000
and
dp
= 100, 000(0.04 + 0.016t) t=5 = 12, 000.
dt t=5
Hence the rate of increase of the number of pounds of waste in the landfill after five years
is, in pounds per day per year,
dW
dp
5
30, 000
dW
√
=
=
(12, 000) = √
= 80.12,
dt t=5
dp p=140,000 dt t=5
2 140, 000
140, 000
where the final answer is rounded to 2 decimal places.
Differentiation of algebraic functions
At this point the only thing keeping us from routinely differentiating any algebraic function
is that we do not have a rule for handling exponents which are rational numbers, but not
integers. We now consider this problem. Suppose y = xn , where n = pq for nonzero integers
p and q. Then
p q
yq = x q
= xp .
(3.4.10)
Differentiating the left-hand side of (3.4.9) with respect to x gives us
d q
dy
y = qy q−1 ,
dx
dx
(3.4.11)
Section 3.4
Differentiation of Compositions of Functions
5
dy
where the factor dx
is a consequence of the special case of the chain rule in (3.4.7). Of
course,
d p
x = pxp−1 .
(3.4.12)
dx
We may equate (3.4.11) and (3.4.12) (by (3.4.10) they are the derivatives of equal functions)
to obtain
dy
qy q−1
= pxp−1 .
(3.4.13)
dx
dy
Solving for dx
, we have
dy
pxp−1
p
= q−1 = xp−1 y 1−q .
dx
qy
q
(3.4.14)
p
Recalling that y = x q and n = pq , (3.4.14) becomes
p 1−q
p
p
p
p p
dy
= xp−1 x q
= xp−1 x q −p = x q −1 = nxn−1 .
dx
q
q
q
(3.4.15)
Hence we may now state the following proposition as an extension of our previous results.
Proposition
If n 6= 0 is a rational number, then
d n
x = nxn−1 .
dx
Example
We have
(3.4.16)
1
d 1
1 1
d √
x=
x 2 = x− 2 = √ ,
2
dx
dx
2 x
in agreement with our result in Section 3.2.
Example
If
f (x) = √
then
f 0 (x) =
3
x2 + 1
,
1
3
d
3
3x
3(x2 + 1)− 2 = − (x2 + 1)− 2 (2x) = −
3 .
dx
2
(x2 + 1) 2
Implicit differentiation
The technique used in the demonstration of the last proposition is of general use. Any
equation involving two variables, such as f (x, y) = 0, determines a curve in the plane
consisting of the set of all ordered pairs (x, y) which satisfy the equation. Such a curve
need not be the graph of a function. For example, the curve associated with x2 +y 2 −25 = 0,
or, more simply, x2 + y 2 = 25, is a circle of radius 5 centered at the origin, which is not
the graph of any function. However, for a specified point on the curve, it may be the case
that a segment of the curve containing that point is the graph of some function; hence the
6
Differentiation of Compositions of Functions
Section 3.4
10
7.5
5
2.5
-10
5
-5
10
-2.5
-5
Figure 3.4.1 Tangent line to the circle x2 + y 2 = 25 at (3, 4)
curve may have a tangent line at this point. For example, (3, 4) is a point on the curve
x2 + y 2 = 25 which lies on the half of the circle lying above the x-axis and, considered
by
√
itself, this piece of the circle is the graph of a function, namely, the function y = 25 − x2 .
To find the slope of the tangent line at such a point on the curve, we may borrow the
technique we used in demonstrating the previous proposition. That is, we differentiate
both sides of the equation, treating one variable as a function of the other. If we treat y as
a function of x, then, differentiating with respect to x and using the chain rule, we obtain
dy
dy
which we can then solve for dx
. For the equation x2 + y 2 = 25,
an equation involving dx
we have
d 2
d
(x + y 2 ) =
25.
dx
dx
Since
d 2
dy
(x + y 2 ) = 2x + 2y
dx
dx
and
d
25 = 0,
dx
we have
dy
2x + 2y
= 0.
dx
dy
Solving for dx
, we have
dy
2x
x
=−
=−
dx
2y
y
at all points (x, y) for which y 6= 0. Now we have
dy
3
=− ,
dx (x,y)=(3,4)
4
Section 3.4
Differentiation of Compositions of Functions
7
and so the equation of the tangent line at (3, 4) is
3
y = − (x − 3) + 4.
4
The circle with equation x2 + y 2 = 25 and the tangent line at (3, 4) are shown in Figure
3.4.1. Note that our procedure would not work to find the tangent lines to the circle at
(−5, 0) and (5, 0). However, the tangents lines at these points are vertical, and, hence, do
not have a slope. Although it is beyond the scope of this book to provide a justification,
it is in fact the case that the technique outlined in this example will work to find the slope
of the tangent line at all points on the curve that have a tangent line with a slope.
This technique for finding derivatives is called implicit differentiation because we did
not use an explicit formula for y in terms x. In this case we could have obtained√the same
result by first solving for y in terms of x for values close to (3, 4), giving us y = 25 − x2 ,
and then evaluating the derivative of this function at x = 3. However, this is not always
possible or desirable; in many cases implicit differentiation is significantly simpler even if
an explicit solution is possible.
Example Consider the problem of finding the best affine approximation to the curve
with equation
y 3 + 3xy 2 − xy + x = 7
dy
, we compute
near the point (2, 1). To find dx
d 3
d
(y + 3xy 2 − xy + x) =
7,
dx
dx
which give us
d 3
d 2
dy
d
d
2 d
y + 3x y + 3y
x− x
+y x +
x = 0.
dx
dx
dx
dx
dx
dx
Computing the derivatives on the left-hand side gives us
dy
dy
2 dy
3y
+ 3x 2y
+ 3y 2 (1) − x
− y(1) + 1 = 0.
dx
dx
dx
Hence
3y 2
dy
dy
dy
+ 6xy
+ 3y 2 − x
− y + 1 = 0,
dx
dx
dx
from which it follows that
dy
(3y 2 + 6xy − x) = y − 3y 2 − 1.
dx
dy
Solving for dx
, we have
dy
y − 3y 2 − 1
= 2
,
dx
3y + 6xy − x
8
Differentiation of Compositions of Functions
Section 3.4
6
4
2
-4
2
-2
4
6
8
10
-2
-4
-6
Figure 3.4.2 Curve with equation y 3 + 3xy 2 − xy + x = 7 and tangent line at (2, 1)
which holds at all points for which the denominator is not 0. Thus
dy
1−3−1
3
=
=− .
dx (x,y)=(2,1)
3 + 12 − 2
13
So the best affine approximation at (2, 1) is given by
T (x) = −
3
(x − 2) + 1.
13
The equation in this example does not specify y as a function of x (in fact, in Figure 3.4.2
we can see that there are at least two other values of y that correspond to x = 2), but
there is a segment of the curve through (2, 1) which is the graph of some function. For this
function, which we have not explicitly found, T is the best affine approximation at x = 2.
For example, if we denote this unknown function by h, we know that
h(2.05) ≈ T (2.05) = −
3
(0.05) + 1 = 0.9885,
13
where we have rounded the result to four decimal places. Put another way, the point
(2.05, 0.9885) is an approximate solution to the equation
y 3 + 3xy 2 − xy + x = 7.
Section 3.4
Differentiation of Compositions of Functions
9
At this point we can routinely find the derivative of any algebraic function. In the
next section we will consider the derivatives of the trigonometric functions.
Problems
1. Find the derivative of each of the following functions.
(a) f (x) = (4x + 5)4
3
(c) h(t) =
2(6t − 2)2
(b) g(x) = 13x(x2 + 2)5
3s − 4
(d) f (s) = 3
(s + 2)4
(3x + 4)3 (8x − 13)4
(f) f (x) =
(2x + 3)
(e) g(z) = (3z + 4)3 (2z 2 + z)2
2. For each of the following, find the derivative of the dependent variable with respect to
the independent variable.
s2 (4s − 3)2
s2 + 1
3x
(d) y = √
3x + 4
(a) s = 4t2 (t2 − 1)2
(c) q =
√
(b) z = −
3t3 − 4t
2
(f) u = 3(v 2 + 4)− 3
p
(h) v = u2 + (3u − 2)2
(e) x = 8t(4t + 5)−2
1
(g) y = (3x − 1) 5
3. Find the best affine approximation to the function
f (x) =
3x
(x2 + 1)2
at x = 2.
4. (a) Find the best affine approximation to f (x) = (1 + x)h at x = 0, where h 6= 0 is a
constant.
√
(b) Use your result from (a) to approximate 1.06 and compare with the value obtained from a calculator.
√
(c) Use your result from (a) to approximate 3 1.06 and compare with the value obtained from a calculator.
√
(d) Use your result from (a) to approximate 5 1.06 and compare with the value obtained from a calculator.
5. Find the equation of the line tangent to each of the following curves at the indicated
point.
(a) x2 + 3y 2 = 21 at (3, 2)
(b) x2 − 3y 2 = 4 at (4, 2)
(c) x2 + 3xy + y 2 = 11 at (2, 1)
(d) y 5 + 2x2 y 2 − x2 = 10 at (3, 1)
(e) x5 + xy + y 5 = 3 at (1, 1)
(f) 4x2 − 3xy − 2xy 2 = 26 at (−2, 1)
10
Differentiation of Compositions of Functions
Section 3.4
6. Suppose values for f (x), f 0 (x), g(x), and g 0 (x) are as given in the following table.
x
0
1
2
f (x)
1
2
0
f 0 (x)
2
−1
3
g(x)
2
0
1
Find k 0 (0) for each of the following.
(a) k(x) = f ◦ g(x)
(c) k(x) = g ◦ g(x)
(e) k(x) = (f ◦ g) ◦ f (x)
g 0 (x)
3
2
−2
(b) k(x) = g ◦ f (x)
(d) k(x) = f ◦ f (x)
(f) k(x) = g(f (x))f (x)
7. Show that if g 0 (c) = 0, then (g ◦ g)0 (c) = 0.
8. Suppose the sides of cube are increasing at a rate of 3 centimeters per minute. At
what rate is the volume of the cube increasing when the length of one of the sides is
10 centimeters?
9. A pebble is dropped in a√pond of water. Suppose that the resulting circular wave has
a radius given by r = 20 t centimeters after t seconds. Find the rate of change of the
area of the wave with respect to time after 5 seconds.
10. The volume of a balloon is increasing at a rate of 50 cubic centimeters per second. At
what rate is the radius increasing when the radius is 10 centimeters?
11. The kinetic energy of an object moving in a straight line is given by
K=
1
mv 2 ,
2
where m is the mass of the object and v is its velocity. If the acceleration of the object,
dK
a = dv
dt , is a constant 9.8 meters per second per second, find dt when v = 10 meters
per second.
12. Ship A passes a buoy at 10:00 a.m. and heads north at 20 miles per hour. Ship B
passes the same buoy at 11:00 a.m. and heads east at 25 miles per hour. If s is the
distance between the ships, what is ds
dt at noon?
13. Suppose the height of a rectangle is growing at a rate of 0.1 inches per second while its
length is growing at a rate of 0.2 inches per second. When the height of the rectangle is
4 inches and its length is 8 inches, at what rate is the area of the rectangle increasing?
14. The work force of a certain factory is growing at rate of 2 per month while the average
productivity of a worker is growing at a rate of 4 units per month. If the work force
is currently 100 and the average productivity per month is 200 units, at what rate is
the total productivity per month of the factory increasing?
15. (a) What happens in Problem 14 if the work force is declining by 2 per month?
(b) What happens in Problem 14 if the average productivity is decreasing by 5 per
month?
Section 3.4
Differentiation of Compositions of Functions
11
16. A circular oil slick is 0.03 feet thick and has a radius which is increasing at a rate of 2
feet per hour. When the radius is 100 feet, at what rate is the volume of the oil slick
increasing?
17. Oil is being added to a circular oil slick at the rate of 100 cubic feet per minute. If the
oil slick is 0.05 feet thick, at what rate is the radius of the oil slick increasing when the
radius is 400 feet?
18. In Section 2.2 we mentioned that the period of a pendulum of length b centimeters
undergoing small oscillations is given by
s
T = 2π
b
seconds,
g
where g = 980 centimeters per second per second. Suppose the length of the pendulum
changes as a function of temperature τ so that
db
= 0.08 centimeters per degree Celsius.
dτ
(a) Find dT
dτ when b = 20 centimeters.
(b) Use (a) to approximate the effect on T of a 1◦ C increase in temperature. Do the
same for a 2◦ C increase and a 2◦ C decrease.