MTH102-LN 3 (Differentiation)
MTH102-LN 3 (Differentiation)
Differentiation
y = f (x)
Q
P
h R
M N x
The above figure shows the graph of a general function y = f (x). M and N are points (a, 0)
and (a + h, 0) respectively. P and Q are the points on the curve given by x = a and x = a + h.
So M P = f (a) and N Q = f (a + h). It can be observed that
RQ = N Q − N R
= NQ − MP
= f (a + h) − f (a)
The gradient of
RQ
PQ =
PR
f (a + h) − f (a)
=
h
15
16 CHAPTER 2. DIFFERENTIATION
f (x + h) − f (x)
f ′ (x) = lim .
h→0 h
f ′ (x) is called the derived function of f (x), and this method used in obtaining f ′ (x) is generally
known as the first principle.
Example 2.1.1. Use the first principle method to find f ′ (x) given that
(a) f (x) = x
f (x + h) − f (x) (x + h) − x h
f ′ (x) = lim = = =1 (h ̸= 0).
h→0 h h h
∴ f (x + h) = 2(x + h)2
= 2(x2 + 2hx + h2 )
= 2x2 + 4hx + 2h2
f (x + h) − f (x)
f ′ (x) = lim
h→0 h
2x2 + 4hx + 2h2 − 2x2
= lim
h→0 h
4hx + 2h 2
= lim
h→0 h
= lim 4x + 2h = 4x
h→0
x x+h
(c) Here, f (x) = , f (x + h) =
x+1 x+h+1
x+h x
x+h+1 − x+1
f ′ (x) = lim
h→0 h
(x+h)(x+1)−x(x+h+1)
(x+h+1)(x+1)
= lim
h→0 h
(x + h)(x + 1) − x(x + h + 1)
= lim
h→0 h(x + h + 1)(x + 1)
x + hx + x + h − x2 − hx − x
2
= lim
h→0 h(x + h + 1)(x + 1)
2.1. THE FIRST PRINCIPLE 17
h
= lim
h(x + h + 1)(x + 1)
h→0
1
= lim
h→0 (x + h + 1)(x + 1)
1
=
(x + 1)(x + 1)
1
=
(x + 1)2
Example 2.1.2. Find f ′ (x) by the first principle method in each of the following:
1
(a) f (x) = x 2
(b) f (x) = xn
1
(c) f (x) = x− 2
Solution.
1 √ √
(a) Here f (x) = x 2 = x. f (x + h) = x + h.
f (x + h) − f (x)
f ′ (x) = lim
h→0 h
√ √
x+h− x
= lim
h→0 h
√ √ √ √
x+h− x x+h+ x
= lim ×√ √
h→0 h x+h+ x
x+h−x
= lim √ √
h→0 h( x + h + x)
1
= lim √ √
h→0 x+h+ x
1 1
= √ = x−1/2
2 x 2
(b) f (x) = xn ,
f (x + h) = (x + h)n
n(n − 1) n−2 2
= xn + nxn−1 h + x h + · · · + hn
2!
f (x + h) − f (x)
f ′ (x) = lim
h→0 h
x + nxn−1 h + n(n−2)
n
2 xn−2 h2 + · · · + hn − xn
= lim
h→0 h
n−1 n(n−2) n−2 2
nx h+ 2 x h + · · · + hn
= lim
h→0
h
n−1 n(n − 2) n−2 n−1
= lim nx + x h + ··· + h
h→0 2
= nxn−1
18 CHAPTER 2. DIFFERENTIATION
1 1 1
(c) Here, f (x) = x− 2 = √ and f (x + h) = √ .
x x+h
f (x + h) − f (x)
f ′ (x) = lim
h→0 h
√1 − √1
x+h x
= lim
h→0 h
√ √
x− x+h
= lim √ √
h→0 h( x x + h)
√ √ √ √
x− x+h x+ x+h
= lim √ √ ×√ √
h→0 h( x x + h) x+ x+h
x − (x + h)
= lim √ √ √ √
h→0 h( x x + h)( x + x + h)
−1
= lim √ √ √ √
h→0 ( x x + h)( x + x + h)
−1
= √
x×2 x
−1
= 3
2x 2
1 3
= − x− 2
2
Exercise
1. Find from the first principles the derived function of the following
(a) y = x3 + 2x
(b) f (x) = x2 + x
(c) g(x) = 4x2 + 2
1
(d) h(x) = 3
2x
(e) y = x4 − x2
1
(f) f (x) =
2x + 3
1
(g) y = 3
x
2. Find the derived function of the following:
dy f (x + h) − f (x)
= lim = f ′ (x).
dx h→0 h
In what follows, we introduce several rules that allow us to find derivatives without the direct
use of the limit definition. We start with the simplest of all functions, the constant function
f (x) = c.
d
[c] = 0.
dx
dy
For example, if y = 7, then = 0.
dx
d
[f (x)] = nxn−1 .
dx
dy
Example 2.2.1. Find if
dx
(a) y = x3
√
(b) y = x
Solution.
dy
= 3x3−1 = 3x2 .
dx
1
(b) We express the function in index form. That is, y = x 2 . Therefore,
dy 1 1 −1
= x2
dx 2
1 −1
= x 2
2
20 CHAPTER 2. DIFFERENTIATION
1 1
= = √
1
2x 22 x
d d
[cf (x)] = c [f (x)].
dx dx
Example 2.2.2. Differentiate the following
(a) y = 6x4
4
(b) f (x) =
x2
Solution.
dy
(a) = 4(6)x4−1 = 24x3
dx
(b) f (x) can be rewritten as f (x) = 4x−2 . Thus,
f ′ (x) = −2(4)x−2−1
= −8x−3
8
= − 3
x
Example 2.2.4. Find the derivative of h(x) = (3x − 2x2 )(5 + 4x).
Solution.
d d
h′ (x) = (3x − 2x2 ) [5 + 4x] + (5 + 4x) [3x − 2x2 ]
dx dx
= (3x − 2x2 )(4) + (5 + 4x)(3 − 4x)
= (12x − 8x2 ) + (15 − 8x − 16x2 )
= −24x2 + 4x + 15
x2 + x − 2 dy
Example 2.2.5. If y = , find
x3 + 6 dx
Solution.
d d
dy (x3 + 6) dx [x2 + x − 2] − (x2 + x − 2) dx [x3 + 6]
=
dx (x3 + 6)2
(x3 + 6)(2x + 1) − (x2 + x − 2)(3x2 )
=
(x3 + 6)2
(2x + x + 12x + 6) − (3x4 + 3x3 − 6x2 )
4 3
=
(x3 + 6)2
−x4 − 2x3 + 6x2 + 12x + 6
=
(x3 + 6)2
Exercise
1. Find y ′ in each of the following
(a) y = 7x5 − 3x4 + x2
2
(b) y = 2t4 − 6t + t − 2
√ t
(c) y = 6 3 x
2. Differentiate the following functions with respect to x:
(a) f (x) = (x3 + 1)(x4 + 1)
(b) g(x) = (x + x3 )(x2 − 1)
dy
3. Find in the following:
dx
x2
(a) y =
x+1
t3 + t
(b) y = 4
t −2
x2
(c) y = √
1+ x
22 CHAPTER 2. DIFFERENTIATION
dy dy du
= × .
dx du dx
Example 2.2.6. Differentiate the following functions:
√
(a) y = x2 + 1
dy dy du
∴ = ×
dx du dx
1
= √ × 2x
2 u
x x
= √ =√
u 2
x +1
(b) Here again, using the chain rule, we let u = 3x2 − 4, then y = u4 and by the general power
rule,
dy du
= 4u3 and = 6x.
du dx
Thus,
dy dy du
= × = 4u3 × 6x
dx du dx
= 4(3x2 − 4)3 × 6x
= 24x(3x2 − 4)3
1
Example 2.2.7. If f (x) = , find f ′ (x).
(3x − 4)2
Solution. Note that you don’t need to use the quotient rule every time you see a quotient. Here
we can rewrite the function as
f (x) = (3x − 4)−2 .
If we let u = 3x − 4, then f (u) = u−2 and by the general power rule,
Thus,
−6
=
(3x − 4)3
f (x + h) − f (x)
f ′ (x) = lim
h→0 h
sin(x + h) − sin x
= lim
h→0 h
sin x cos h + cos x sin h − sin x
= lim
h→0 h
sin x cos h − sin x + cos x sin h
= lim
h→0 h
sin x(cos h − 1) + cos x sin h
= lim
h→0
h
cos h − 1 sin h
= lim sin x + cos x
h→0 h h
cos h − 1 sin h
= lim sin x + lim cos x
h→0 h h→0 h
cos h − 1 sin h
= sin x lim + cos x lim
h→0 h h→0 h
1 − cos h sin h
= − sin x lim + cos x lim
h→0 h h→0 h
= − sin x(0) + cos x(1)
= cos x
Thus,
d
[sin x] = cos x.
dx
Similarly, if f (x) = cos x, then f ′ (x) = − sin x. That is,
d
[cos x] = − sin x. (Prove as an exercise).
dx
Example 2.2.9. Differentiate the following functions:
(a) y = sin 3x
cos x
(b) f (x) =
2
24 CHAPTER 2. DIFFERENTIATION
Solution.
(a) Here, we let u = 3x, then y = sin u by the chain rule. Thus,
dy dy du
= ×
dx du dx
= cos u × 3
= 3 cos u
= 3 cos 3x
cos x 1
(b) Let f (x) = = cos x. Thus,
2 2
1 1
f ′ (x) = × − sin x = − sin x.
2 2
(c) Let u = 4x2 − 3, then g(u) = sin u and by the chain rule,
(d)
dy d d d
= x6 [cos x] + cos x [x6 ] + [2x5 ]
dx dx dx dx
= x6 × (− sin x) + cos x × 6x5 + 10x4
= −x6 sin x + 6x5 cos x + 10x4
= x4 (−x2 sin x + 6x cos x + 10)
(a) tan x
(b) csc x
(c) sin3 x
1 − cos x 2
(d)
sin x
Solution.
sin x
(a) Here, we express tan x as and apply the quotient rule i.e.,
cos x
d d sin x
[tan x] =
dx dx cos x
2.2. TECHNIQUES OF DIFFERENTIATION 25
d d
cos x dx [sin x] − sin x dx [cos x]
= 2
cos x
cos x × cos x − sin x × (− sin x)
=
cos2 x
2 2
cos x + sin x
=
cos2 x
1
= = sec2 x
cos2 x
Thus,
d
[tan x] = sec2 x.
dx
1
(b) Here again, we set csc x = so that we can we can write
sin x
d d 1
[csc x] =
dx dx sin x
d d
sin x dx [1] − 1 × dx [sin x]
=
sin2 x
sin x(0) − cos x
=
sin2 x
cos x
= − 2
sin x
−1 cos x
= ×
sin x sin x
= − csc x cot x
dy dy du
= ×
dx du dx
= 3u2 × cos x
= 3 sin2 x × cos x
2
1 − cos x 1 − cos x
(d) Here again, we let y = and let u = . Then y = u2 and
sin x sin x
dy dy du
= ×
dx du "dx #
d d
sin x dx [1 − cos x] − (1 − cos x) dx [sin x]
= 2u ×
sin2 x
sin x sin x − (1 − cos x) cos x
= 2u ×
sin2 x
2
sin x − cos x + cos2 x
1 − cos x
= 2
sin x sin2 x
1 − cos x 1 − cos x
= 2
sin x sin2 x
26 CHAPTER 2. DIFFERENTIATION
Exercise
1. Differentiate the following functions
2
(a) y =
(x − 13)5
3
sin x
(b) f (x) =
1 + cos x
2 2
(c) g(x) = x −
x
(d) h(x) = (3x2 − 4)4
dy
2. If y = cos x, find using the first principle
dx
3. Find the derivative of each of the following:
Derivative of sin−1 x
dy
If y = sin−1 x, to find , we rewrite as x = sin y. We differentiate this with respect to y and
dx
obtain
dx
= cos y.
dy
Thus,
dy 1
= .
dx cos y
2.2. TECHNIQUES OF DIFFERENTIATION 27
We now express y in terms of x, thus; we know that cos2 y + sin2 y = 1, therefore, cos2 y =
1 − sin2 y = 1 − x2 . So p
cos y = 1 − x2 .
Thus,
dy 1
=√ .
dx 1 − x2
i.e.,
d 1
[sin−1 x] = √ .
dx 1 − x2
Similarly, if y = cos−1 x, we can write as x = cos y. So that
dx
= − sin y.
dy
Thus,
dy −1
= .
dx sin y
√
Expressing sin y in terms of x from cos2 y + sin2 y = 1, we obtain sin y = 1 − x. Therefore,
dy −1
=√ .
dx 1 − x2
That is
d −1
[cos−1 x] = √ .
dx 1 − x2
We can also obtain the derivative of y = tan−1 x by setting x = tan y and differentiating with
respect to y. That is, if x = tan y,
dx dy 1
= sec2 y, or = .
dy dx sec2 y
(a) y = sin−1 3x
(b) y = cos−1 x2
−1 2
(c) y = tan
x
(d) y = x2 cos−1 x
Solution.
dy dy du
= ×
dx du dx
28 CHAPTER 2. DIFFERENTIATION
1
= √ ×3
1 − u2
1
= p ×3
1 − (3x)2
3
= √
1 − 9x2
dy dy du
= ×
dx du dx
−1
= √ × 2x
1 − u2
−2x
= p
1 − (x2 )2
−2x
= √
1 − x4
(c) Let u = 2
x then y = tan−1 u and
dy dy du
= ×
dx du dx
1 2
= × − 2
1 + u2 x
−2
=
x2 (1 + x42 )
−2
= 2
x +4
(d) Exercise
1 − x2
dy
Example 2.2.12. If y = tan−1 2
, find .
1+x dx
1 − x2
Solution. Let u = . Then y = tan−1 u, and
1 + x2
dy dy du
= ×
dx du dx
d d
1 (1 + x2 ) dx [1 − x2 ] − (1 − x2 ) dx [1 + x2 ]
= ×
1 + u2 (1 + x2 )2
1 (1 + x2 )(−2x) − (1 − x2 )(2x)
= 2 ×
1 − x2 (1 + x2 )2
1+
1 + x2
1 −2x − 2x3 − 2x + 2x3
= ×
(1 − x2 )2 (1 + x2 )2
1+
(1 + x2 )2
1
(1+x2 )2 +(1−x2 )2 −4x
= ×
(1 + x2 )2 (1 + x2 )2
2.2. TECHNIQUES OF DIFFERENTIATION 29
(1 + x2 )2 −4x
= 2 2 2 2
×
(1 + x ) + (1 − x ) (1 + x2 )2
−4x
=
1 + 2x + x + 1 − 2x2 + x4
2 4
−4x
=
2 + 2x4
−2x
=
1 + x4
Exercise
1. Find the derivatives of the following functions
(a) y = csc−1 x
(b) y = sec−1 x
(c) y = cot−1 x
(a) x2 y − 5x = 3
(b) x3 + y 3 = 3xy
(c) x2 + y 2 + sin y = 3
Solution.
30 CHAPTER 2. DIFFERENTIATION
dy
x2 × + y × 2x − 5 = 0
dx
dy
x2 + 2xy − 5 = 0
dx
or
dy
x2 = 5 − 2xy
dx
dy 5 − 2xy
∴ =
dx x2
Note that this can also be solved by first solving for y and using the quotient rule.
dy dy
3y 2 − 3x = 3y − 3x2
dx dx
dy
(3y 2 − 3x) = 3y − 3x2
dx
dy y − x2
∴ =
dx y2 − x
(c)
dy dy
2x + 2y + cos y = 0
dx dx
dy
(2y + cos y) = −2x
dx
dy −2x
∴ =
dx 2y + cos y
cos x d2 y
Example 2.3.1. If y = , find
1 − sin x dx2
2.3. HIGHER DERIVATIVES 31
Solution.
d d
dy (1 − sin x) [cos x] − cos x [1 − sin x]
= dx dx
dx (1 − sin x)2
(1 − sin x)(− sin x) − cos x(− cos x)
=
(1 − sin x)2
2
sin x − sin x + cos2 x
=
(1 − sin x)2
1 − sin x
=
(1 − sin x)2
1
=
1 − sin x
d d
d2 y (1 − sin x) dx [1] − (1) dx [1 − sin x]
∴ =
dx2 (1 − sin x) 2
cos x
=
(1 − sin x)2
x−1
Example 2.3.2. If y = , show that
x+1
d2 y dy
(x + 1) 2
+2 =0
dx dx
Solution. Here, we rewrite as y(x + 1) = x − 1. Differentiating implicitly, we have
dy
y + (x + 1) = 1.
dx
Differentiating implicitly again, we have
dy d2 y dy
+ (x + 1) 2 + = 0
dx dx dx
d2 y dy
∴ (x + 1) 2 + 2 = 0.
dx dx
Exercise
1. Differentiate the following functions:
(a) xy = 5
(b) x2 y 2 + x + y = 0
(c) xy + sin y = 2
(d) x2 + y 2 + cos xy = 2
d2 y
2. Find in each of the following
dx2
(a) y = cos2 x
1
(b) y =
2−x
sin x
(c) y =
1 + cos x
32 CHAPTER 2. DIFFERENTIATION
1
3. If y = , show that
1+x
d2 y dy
(1 + x) 2
+2 = 0.
dx dx
dy dy du 1 du
= × =
dx du dx u dx
1
= 3
× 3x2
x +1
3x2
=
x3 + 1
dy dy du 1 du
= × =
dx du dx u dx
1
= × sec x tan x
sec x
= tan x
2.3. HIGHER DERIVATIVES 33
(c) The differentiation becomes easier if we first simplify the given function using the laws of
logarithms. That is,
1
y = ln(x + 1) − ln(x − 2).
2
dy 1 1 1
∴ = −
dx x+1 2 x−2
1 1
= −
x + 1 2x − 4
2x − 4 − x − 1 x−5
= =
(x + 1)(2x − 4) (x + 1)(2x − 4)
Note that a logarithmic function with base a can be expressed in terms of the natural
logarithmic function as follows:
ln x
loga x = .
ln a
Since a is a constant, we can differentiate as follows:
d d ln x 1 d
[loga x] = = [ln x]
dx dx ln a ln a dx
1
=
x ln a
Solution. To use the chain rule, we let u = 2 + sin x. Then f (u) = log10 u and
(b) y = etan x
3
(c) y = x2 e− x
Solution.
34 CHAPTER 2. DIFFERENTIATION
dy dy du du
= × = eu ×
dx du dx dx
2x2 −1
= e × 4x
2 −1
= 4xe2x
dy dy du du
= × = eu ×
dx du dx dx
tan x
= e × sec2 x
(c)
dy d h −3 i 3 d
= x2 e x + e− x [x2 ]
dx dx dx
3 3 3
= x2 × e− x × 2 + e− x × 2x
x
3 3
= 3e− x + 2xe− x
3
= (3 + 2x)e− x
Exercise
1. Differentiate the following functions:
(a) y = esin x
2
(b) y = e−2x
x
(c) y = xe 4
(d) f (x) = 2x3
(e) g(x) = e2x cos 2x
Solution.
dy dx
(a) Let = 4t and = 3t2 + 1. So,
dt dt
dy dy dx
= ÷
dx dt dt
4t
=
3t2 + 1
dy dx
(b) Let = −4 sin 4t and = 2 cos 2t. Thus,
dt dt
dy dy dx
= ÷
dx dt dt
−4 sin 4t
=
2 cos 2t
Exercise
dy
1. Find if
dx
(a) y = sin θ and x = 3 cos θ
1
(b) y = t2 and x =
t
dy d2 y
2. Find and if y = 2x and x = t2
dx dx2
36 CHAPTER 2. DIFFERENTIATION
y = f (x)
B
x
0 a x1 x2 x3 b
Consider the function y = f (x) whose graph is shown above. The point A is a maximum point
of the function y. The point B is a minimum point of y while C is a point of inflexion of y.
All the points A, B and C are called stationary points on the graph or stationary values of y.
dy
Generally, for any curve y = f (x), a stationary point is any point where dx = 0. Also,
d2 y
1. y is maximum when dx2
is negative
d2 y
2. y is minimum when dx2
is positive
d2 y
3. for point of inflexion dx2
=0
Solution.
dy dy 1
(a) = 3x2 − 4x + 1. At the stationary points, = 0. That is 3x2 − 4x + 1 = 0. i.e., x = 3
dx dx
or x = 1. So the stationary points are x = 13 or x = 1.
d2 y d2 y
(b) = 6x − 4. The maximum value of y is obtained when < 0. This holds when
dx2 dx2
x = 13 . i.e., 6( 13 ) − 4 = −2 < 0. So the maximum value of y is
3 2
1 1 1 1 2 1
−2 + +4 = − + +4
3 3 3 27 9 3
112
=
27
2.3. HIGHER DERIVATIVES 37
112 d2 y
So the maximum value of y is . y has a minimum value when > 0. i.e., when
27 dx2
6x − 4 > 0. This is true when x = 1. i.e., 6(1) − 4 = 2 > 0. The value of y when x = 1 is
(1)3 − 2(1)2 + 1 + 4 = 4.
Exercise
1. Find