Lecture 12: Rules of Differentiation

LECTURE 12
Rules of Differentiation
At the end of Chapter 2, we finally arrived at the following definition of the derivative of a function f
df
f (x + h) − f (x)
(x) := lim
h→0
dx
h
doing so only after an extended discussion as what the right hand side of this formula means, and how to
compute it. But now, as promised, we are going to develop tools that will allow us to compute derivatives
without actually taking limits. Rather we shall develop rules by which we can compute derivatives from
our knowledge of a few basic derivatives.
The first step will be to develop a repetoire of basic derivatives. However, before we even start, let me write
down an alternative limit definition of the derivative.
Suppose we want the value of the derivative of f at a particular point x = a. Then
f (a + h) − f (a)
df
(a) = lim
h→0
dx
h
Now instead of thinking of h going to 0, let us think instead think of x := a + h going to a. So doing we
can write, h = x − a, and
df
f (a + h) − f (a)
f (x) − f (a)
(a) = lim
= lim
x→a
h→0
dx
h
x−a
Thus,
f (x) − f (a)
df
(a) := lim
x→a
dx
x−a
is an alternative, but equivalent, definition of the derivative of f at x = a.
Okay, now we’re ready to develop the basic rules of differentiation. We’ll start with rules to compute the
derivatives of simple powers of x.
0.1. The Power Rule. Let’s do the easiest case first. Suppose f (x) = 1 for all x. Then we have
df
f (x + h) − f (x)
1−1
(x) = lim
= lim
= lim 0 = 0
h→0
h→0
h→0
dx
h
h
Next consider f (x) = xn .
n
df
(x + h) − xn
(x) = lim
h→0
dx
h
In order the compute this limit we note that
(1)
An − B n = (A − B) An−1 + An−1 B + An−2 B 2 + · · · + AB n−2 + B n−1
58
12. RULES OF DIFFERENTIATION
59
This can be seen by expanding the right hand side and noticing that all but the first and last terms end up
cancelling
RHS : = (A − B) An−1 + An−1 B + An−2 B 2 + · · · + AB n−2 + B n−1
= A An−1 + An−1 B + An−2 B 2 + · · · + AB n−2 + B n−1
−B An−1 + An−1 B + An−2 B 2 + · · · + AB n−2 + B n−1
= An + An−1 B + An−2 B 2 + · · · + A2 B n−2 + AB n−1
−An−1 B − An−2 B 2 +
We thus have
d n
x
=
dx
·········
− AB n−1 − B n
n
(x + h) − xn
h→0
h
n−1
n−1
n−2 2
h (x + h)
+ (x + h)
x + (x + h)
x + · · · + (x + h) xn−2 + xn−1
= lim
h→0
h
= n−1
n−1
n−2 2
=
(x + h)
+ (x + h)
x + (x + h)
x + · · · + (x + h) xn−2 + xn−1 lim
n=0
Applying formula (1), we get
n−1
n−1
n−2 2
((x + h) − x) (x + h)
+ (x + h)
x + (x + h)
x + · · · + (x + h) xn−2 + xn−1
= lim
h→0
h
Simplifying the first factor in the numerator, we get
n−1
n−1
n−2 2
h (x + h)
+ (x + h)
x + (x + h)
x + · · · + (x + h) xn−2 + xn−1
= lim
h→0
h
Cancelling the common factor of h from the numerator and the denominator, we get
n−1
n−1
n−2 2
(2)
= lim (x + h)
+ (x + h)
x + (x + h)
x + · · · + (x + h) xn−2 + xn−1
h→0
Now we’re taking the limit of a polynomial and this we can do by simplying evaluating each term at h = 0
(because polynomials are always continuous). In fact, we can do this term by term. So we end up with
d n
x
dx
=
(x + 0)
n−1
+ (x + 0)
n−1
x + · · · + (x + 0) xn−2 + xn−1
(3)
= xn−1 + xn−1 + · · · + xn−1 + xn−1
The only thing that remains is figure out exactly how many xn−1 terms appear on the right hand side.
Looking back at the original expansion we see that we had a total of n such terms, for note that in (2) we
have factors of x that range from 1 = x0 , x, x2 , . . . , xn−1 , and so we’re basically counting from 0 to n − 1,
which will have the same number of steps as counting from 1 to n. Conclusion: we have a total of n terms
xn−1 on the right hand side of (3). Thus, we can finally conclude:
d n
x = n xn−1
dx
In fact, we have
Theorem 12.1. Suppose α is any real number, then
d α
x = αxα−1
dx
Example 12.2. Suppose f (x) = xπ/2 , what is f 0 (x)?
d π/2 π π/2−1
x
=
x
dx
2
12. RULES OF DIFFERENTIATION
60
0.2. The Constant Multiple Rule. Suppose f is a differentiable function and c is a constant. Then
d
cf (x + h) − cf (x)
f (x + h) − f (x)
(cf (x)) = lim
= c lim
= cf 0 (x)
h→0
h→0
dx
h
h
where in the second equality we have used the Limit law
lim cF (x) = c lim F (x)
x→a
x→a
whenever c is a constant.
Thus, we have proved.
Theorem 12.3. Suppose f is a differentiable function and c is a constant, then
d
df
(cf (x)) = c (x)
dx
dx
Example 12.4. Compute the derivative of f (x) = 3x5 .
Well,
d
d
3x5 = 3
x5 = 3 5x5−1 = 15x4
dx
dx
where we have employed both the Constant Multiple Rule and the Power Rule.
0.3. The Sum and Difference Rules. Recall that
lim (F (x) ± G (x)) = lim F (x) ± lim G (x)
x→a
x→a
x→a
was another of our basic Limit Laws. From this law we see that, if f and g are differentiable functions,
d
(f (x) + g (x))
dx
=
=
=
(f (x + h) + g (x + h)) − (f (x) + g (x))
h→0
h
g (x + h) − g (x)
f (x + h) − f (x)
+ lim
lim
h→0
h→0
h
h
dg
df
(x) +
(x)
dx
dx
lim
One similarly shows that
d
df
dg
(f (x) − g (x)) =
(x) −
(x)
dx
dx
dx
Thus,
Theorem 12.5. Suppose f and g are differentiable functions, then
df
dg
d
(f (x) ± g (x)) =
(x) ±
(x)
dx
dx
dx
Example 12.6. Compute the derivative of f (x) = 3x2 + 2x − 1
Well, we have
df
dx
=
d
d
d
3x2 +
(2x) −
(1)
dx
dx
dx
3 2x2−1 + 2 1x1−1 − 0
=
6x + 2
=
Remark 12.7. We often call this process differentiating term-by-term.
12. RULES OF DIFFERENTIATION
61
0.4. Derivatives of Exponential Functions. Recall that an exponential function was defined as a
function of the form
f (x) = ax
a being some constant.
We can actually compute the derivatives of such functions. For
df
ax+h − ax
an − 1
(x) = lim
= ax lim
x→0
h→0
dx
h
h
Notice that when x = 0 we have
df
an − 1
an − 1
(0) = a0 lim
= lim
h→0
h→0
dx
h
h
Thus, in general, if f (x) = ax is an exponential function
df
= ax f 0 (0) = f 0 (x) f (x)
dx
Definition 12.8. Suppose e is the unique number such that
eh − 1
=1
h→0
h
lim
Then the exponential function
f (x) = ex
is called the natural exponential function. We often use the notation
exp (x) := ex
for this exponential function.
The reason why this f (x) = ex is more natural (from the point of view of Calculus) than other exponential
functions like f (x) = 10x is that
d x
e = ex
dx
It is, in fact, the unique function such that f (0) = 1 and f 0 (x) = f (x).
In summary,
Theorem 12.9.
d x
e = ex
dx
Example 12.10. Compute the second derivative of f (x) = 3x2 + 4ex .
Well, the first derivative of f is
df
dx
d
3x2 + 4ex
dx
d
d
3x2 + 4 (ex )
=
dx
dx
d
d
= 3 x2 + 4 ex
dx
dx
= 3 2x2−1 + 4 (ex )
=
=
6x + 4e
x
by the sum rule
by the constant multiple rule
by the rules for differentiating xn and ex
12. RULES OF DIFFERENTIATION
62
The second derivative is the derivative of the first derivative, so
d df
d
d2 f
:
=
=
(6x + 4ex )
dx2
dx dx
dx
d
d
= 6 x + 4 ex
dx
dx
= 6 (1) x1−1 + 4ex
=
6x0 + 4ex
=
6 + 4ex
0.5. The Product Rule. Recall that the rule
lim (F (x) G (x)) = lim F (x)
lim G (x)
x→a
x→a
x→a
made it easy to compute the limits of products of functions. Unfortunately, this rule can not be applied
directly to the computation of derivatives of products of functions. For on the one hand
d
f (x + h) g (x + h) − f (x) g (x)
(f (x) g (x)) := lim
h→0
dx
h
(3)
While on the other hand
dg
df
(x)
(x)
dx
dx
f (x + h) − f (x)
g (x + h) − g (x)
: = lim
lim
h→0
h→0
h
h
f (x + h) g (x + h) − f (x + h) g (x) − f (x) g (x + h) + f (x) g (x)
= lim
h→0
h
which does not agree with the right hand side of (3).
To get the right rule, let me start with the alternative formula for the derivative f 0 (a)
df
f (x) − f (a)
(a) = lim
x→a
dx
x−a
We then have
f (x) g (x) − f (a) g (a)
x→a
x−a
f (x) g (x) + 0 − f (a) g (a)
= lim
x→a
x−a
f (x) g (x) + (−f (a) g (x) − f (a) g (x)) − f (a) g (a)
= lim
x→a
x−a
g (x) (f (x) − f (a)) + f (a) (g (x) − g (a))
= lim
x→a
x−a
f (x) − f (a)
g (x) − g (a)
= lim g (x)
+ lim f (a)
x→a
x→a
x−a
x−a
Now we can apply the product rules to both limits
g (x) − g (a)
f (x) − f (a)
+ lim f (a)
lim
= lim g (x)
lim
x→a
x→a
x→a
x→a
x−a
x−a
d
(f g) (a)
dx
=
lim
Now
lim g (x) = g (a)
x→a
since if g (x) is differentiable it is also continuous. Also
lim f (a) = f (a)
x→a
because f (a) doesn’t depend on x. Thus, we get
d
f (x) − f (a)
g (x) − g (a)
(f g) (a) = g (a) lim
+ f (a) lim
= g (a) f 0 (a) − f (a) g 0 (a)
x→a
x→a
dx
x−a
x−a
12. RULES OF DIFFERENTIATION
63
Now regarding the evaluation point a as a free parameter x, we get
Theorem 12.11 (The Product Rule). Suppose f and g are differentiable functions. Then
d
(f g) (x) = f 0 (x) g (x) + f (x) g 0 (x)
dx
Remark 12.12. This rule is also called the Leibniz rule since it was first published by Gottfried Leibniz in
1684.
0.6. The Simple Quotient Rule. From our limit laws we also know that
limx→a P (x)
P (x)
=
so long as lim Q (x) 6= 0
lim
x→a
x→a Q (x)
limx→a Q (x)
But just as with the Product Rule above, we have to be a little careful and getting the correct rule for
differentiating quotients of functions.
We’ll start with a particularly simple quotient of functions. Suppose f (x) =
df
(a)
dx
:
f (x) − f (a)
1
= lim
x→a
x→a x − a
x−a
= lim
1
Q(x) .
1
1
−
Q (x) Q (a)
Then
Finding a common denominator for the second factor, we have
df
1
Q (a) − Q (x)
(a) = lim
x→a x − a
dx
Q (x) Q (a)
Then, collecting factors differently and using the Product Rule for Limits we have
df
1
Q (a) − Q (x)
(5)
(a) = lim
lim
x→a Q (x) Q (a)
x→a
dx
x−a
Employing the Quotient Rule we have
lim
x→a
1
1
1
=
=
2
Q (x) Q (a)
limx→a Q (x) Q (a)
(Q (a))
so long as Q (a) 6= 0
and, from the definition of the derivative, we have
Q (a) − Q (x)
Q (x) − Q (a)
= − lim
= −Q0 (x)
lim
x→a
x→a
x−a
x−a
We can thus conclude from (5) that
df
1
0
(a) = −
2 Q (x)
dx
[Q (a)]
Regarding the evaluation point a as a variable x, we thus arrive at the following rule:
Theorem 12.13 (The Simple Quotient Rule). Suppose Q (x) is a differentiable function. Then
d 1
Q0 (x)
=−
2
dx Q (x)
[Q (x)]
At points x where Q (x) = 0, the derivative of
1
Q(x)
so long as Q (x) 6= 0.
need not be defined.
12. RULES OF DIFFERENTIATION
64
0.7. The General Quotient Rule. Let us now consider a function of the form f (x) = P (x) /Q (x).
With our spanky new Product and Simple Quotient Rules in hand, we can readily derive a formula for the
derivative of P (x) /Q (x). For all we have to do is think of P (x) /Q (x) as P (x) ∗ (1/Q (x)). Thus,
d P (x)
d
1
=
P (x)
dx Q (x)
dx
Q (x)
dP
1
d 1
=
+ P (x)
dx Q (x)
dx Q (x)
0
−Q
(x)
= P 0 (x) Q (x) + P (x)
2
(Q (x))
P 0 (x) Q (x) − P (x) Q0 (x)
=
2
(Q (x))
We thus have
Theorem 12.14. Suppose P (x) and Q (x) are differentiable functions. Then
d P
P 0 (x) Q (x) − P (x) Q0 (x)
(x) =
2
dx Q
(Q (x))
at all points x such that Q (x) 6= 0.
Example 12.15. Compute the derivative of
f (x) =
We have f (x) of the form
P (x)
Q(q)
x2 − 3x + 1
x3 + 2
with
P (x)
= x2 − 3x + 1
Q (x)
= x3 + 2
To apply the quotient rule we need to compute
d
x2 − 3x + 1 = 2x2−1 − 3 ((1) x1−1 + 0 = 2x − 3
P 0 (x) =
dx
d
0
Q (x) =
x3 + 1 = 3x2−1 + 0 = 3x2
dx
We can now plug into the quotient rule
(2x − 3) x3 + 1 − x2 − 3x + 1 3x2
d P (x)
P 0 (x) Q (x) − P (x) Q0 (x)
df
=
=
=
2
2
dx
dx Q (x)
(Q (x))
(x3 + 1)