Section 3.4-3.6 The Chain Rule and Implicit Differentiation with

Section 3.4-3.6 The Chain Rule and Implicit
Differentiation with Application on Derivative of
Logarithm Functions
Ruipeng Shen
September 23rd, 25th
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
1 / 23
The Chain Rule: Derivative of a Composite Function
Assume y = f (u) and u = g (x). Then y = F (x) = f ◦ g (x) is a composite
function.
Theorem (The Chain Rule)
If g is differentiable at x and f is differentiable at g (x), then the composite
function F = f ◦ g defined by F (x) = f (g (x)) is differentiable at x and F 0 is given
by the product
F 0 (x) = f 0 (g (x)) · g 0 (x)
In Leibniz notation, if y = f (u) and u = g (x) are both differentiable functions,
then
dy du
dy
=
·
dx
du dx
Idea Let u = g (x). We have
f (g (x)) − f (g (a))
f (u) − f (g (a)) g (x) − g (a)
=
·
.
x −a
u − g (a)
x −a
x → a ⇒ u = g (x) → g (a). As a result, we obtain (f ◦ g )0 (a) = f 0 (g (a)) · g 0 (a).
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
2 / 23
The First Example
Example
Find the derivative of F (x) =
√
x 2 + 1.
Solution 1 We can express F (x) = (f ◦ g )(x) = f (g (x)) where f (u) =
1
g (x) = x 2 + 1. Since f 0 (u) = √ and g 0 (x) = 2x, we have
2 u
√
u and
1
x
F 0 (x) = f 0 (g (x)) · g 0 (x) = √
· 2x = √
.
2
2
2 x +1
x +1
√
Solution 2 If we let u = x 2 + 1 and y = u, then y = F (x). Thus
F 0 (x) =
Ruipeng Shen
dy
dy du
1
x
=
= √ · 2x = √
.
2
dx
du dx
2 u
x +1
MATH 1ZA3
September 23rd, 25th
3 / 23
Make the Calculation Easier: Combined Rules
Let us consider the general case: If y is a composition of a power function
y = f (u) = u n and another function u = g (x), then
dy
dy du
du
=
= nu n−1 .
dx
du dx
dx
Formula (The Power Rule Combined with the Chain Rule)
If n is any number and u = g (x) is differentiable, then
d n
du
(u ) = nu n−1
dx
dx
(g n )0 = ng n−1 · g 0
Example
Find the derivative of F (x) = (x 2 + x + 1)9 .
Solution F 0 (x) = 9(x 2 + x + 1)8 (x 2 + x + 1)0 = 9(x 2 + x + 1)8 (2x + 1).
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
4 / 23
More Combined Rules
Formula (Combined Rules)
If f (x) be a differentiable function, then
d
[sin f (x)] = [cos f (x)] · f 0 (x)
dx
d
[tan f (x)] = [sec2 f (x)] · f 0 (x)
dx
d f (x)
(e ) = e f (x) f 0 (x)
dx
d
[cos f (x)] = [− sin f (x)] · f 0 (x)
dx
Example
Differentiate the function F (x) = xe x
2
Solution By the product rule, we have
2 0
2
2
2
2
F 0 (x) = (x)0 e x + x e x
= e x + x(e x · 2x) = (2x 2 + 1)e x .
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
5 / 23
More Examples
Example
Differentiate the function G (x) = cos
1−x
1+x
Solution By the chain rule and the quotient rule
1−x
d 1−x
G 0 (x) =
− sin
·
1+x
dx 1 + x
1−x
(1 − x)0 · (1 + x) − (1 − x) · (1 + x)0
− sin
·
=
1+x
(1 + x)2
−(1 + x) − (1 − x)
1−x
·
=
− sin
1+x
(1 + x)2
1−x
−2
=
− sin
·
1+x
(1 + x)2
2
1−x
=
.
sin
2
(1 + x)
1+x
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
6 / 23
More Examples
Example
Differentiate the function F (x) = e sin(cos x) .
Solution 1 If y = e u , u = sin w , w = cos x, then y = F (x). Applying the chain
rule twice, we have
F 0 (x) =
dy
dy du
dy du dw
=
=
.
dx
du dx
du dw dx
Thus F 0 (x) = (e u )(cos w )(− sin x) = −e sin(cos x) [cos(cos x)] sin x.
Solution 2 By the combined rules,
F 0 (x) =
x)
e| sin(cos
{z }
·
cos(cos x)
| {z }
Combined Rule
Combined Rule
with Exponential
with Sine
·
(− sin x)
| {z }
Derivative of cos x
F 0 (x) = −e sin(cosx) cos(cos x) sin x.
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
7 / 23
Application on the Derivative of Exponential Functions
Formula
If a > 0, then
d x
(a ) = ax ln a;
dx
d f (x)
(a ) = (ax ln a)f 0 (x).
dx
Proof: We have ax = (e ln a )x = e x ln a . By the chain rule, we obtain
d x ln a
d
d x
(a ) =
(e
) = e x ln a ·
(x ln a) = ax ln a.
dx
dx
dx
Example
Differentiate the function f (x) = 2tan x .
Solution By the combined rule,
f 0 (x) = 2tan x ln 2 · (tan x)0 = (ln 2)2tan x sec2 x.
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
8 / 23
Implicit Differentiation: Example
Example
Consider the curve C defined by the equation x 3 + y 3 = 6xy . Find the tangent
line to C at the point P(4/3, 8/3).
5
2.5
y=f1(x)
P
x3+ y3=6xy
-7.5
-5
A
y=f2(x)
-2.5
0
-2.5
2.5
5
7.5
10
y=f3(x)
x=a
-5
Ruipeng Shen
MATH 1ZA3
B
September 23rd, 25th
9 / 23
Implicit Differentiation: Example (Continued)
Let us assume y is a function of x. Differentiating both sides of the equation
x 3 + y 3 = 6xy , we obtain
x 3 + y 3 = 6xy
x 3 + [y (x)]3 = 6x[y (x)]
⇒3x 2 + 3y 2 y 0 = 6x 0 y + 6xy 0
⇒3x 2 + 3y 2 y 0 = 6y + 6xy 0
3x 2 + 3[y (x)]2 y 0 (x) = 6y + 6x · y 0 (x)
⇒(3y 2 − 6x)y 0 = 6y − 3x 2
⇒y 0 =
2y − x 2
y 2 − 2x
y 0 (x) =
2y (x) − x 2
[y (x)]2 − 2x
Thus we can calculate the slope of the tangent line at P(4/3, 8/3):
slope = y 0 (4/3) =
2 · (8/3) − (4/3)2
4
= .
2
(8/3) − 2 · (4/3)
5
As a result, we obtain the equation of the tangent line: y −
Ruipeng Shen
MATH 1ZA3
8
4
4
= (x − ).
3
5
3
September 23rd, 25th
10 / 23
Implicit Differentiation: Example (Continued)
Question Find the point A(a, b) where the tangent line to C is vertical.
The tangent line at A(a, b) is vertical. Thus the derivative
dy
2y − x 2
= 2
dx
y − 2x
is not well defined at A. This implies the denominator y 2 − 2x is equal to zero at
(a, b). We have (a, b) satisfies the equation
2
b − 2a = 0;
a3 + b 3 = 6ab.
Plugging a = b 2 /2 into the second equation, we have
b2
2
3
3
+b =6
b2
2
b⇒
b6
+ b 3 = 3b 3 ⇒ b 6 = 16b 3 ⇒ b 3 = 16.
8
Thus b = 24/3 =⇒ a = b 2 /2 = 28/3 · 2−1 = 25/3 . Therefore A is (25/3 , 24/3 ).
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
11 / 23
Implicit Differentiation
Proposition
Let y be an implicit function of x defined by an implicit equation. In order to
express the derivative dy /dx in terms of x and y , one can differentiate both sides
of the equation with respect to x and then solve the resulting equation for dy /dx
(or y 0 ).
Remark An implicit equation is usually given by F (x, y ) = G (x, y ).
Example
Find y 0 and y 00 if x 4 + y 4 = r 4 .
Solution By implicit differentiation, we have
x 4 + y 4 = r 4 =⇒ 4x 3 + 4y 3 · y 0 = 0 =⇒ y 0 = −
Ruipeng Shen
MATH 1ZA3
x3
.
y3
September 23rd, 25th
12 / 23
Example: Find the Second Derivative (Continued)
In order to express f 00 in term of x and y , we can differentiate y 0 and obtain
3 0
x
(x 3 )0 · y 3 − x 3 · (y 3 )0
y = (y ) = − 3 = −
y
y6
3x 2 y 2 (y − xy 0 )
3x 2 y 3 − x 3 · 3y 2 y 0
=
−
.
=−
y6
y6
00
0 0
Plugging in y 0 = −x 3 /y 3 , we have the answer
x3
x4
2 2
2 3
3x y y − x · (− 3 )
3x y y + 3
y
y
y 00 = −
=
−
6
7
y
y
3x 2 y 4 + x 4
3r 4 x 2
=− 7 .
=−
y7
y
In the last step, we use the equation x 4 + y 4 = r 4 .
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
13 / 23
Application: Derivative of Inverse Sine Function
Recall the definition of the inverse sine function (arcsine function)
y = sin−1 x
⇐⇒
sin y = x and
π
−π
≤y ≤ .
2
2
Differentiating the equation sin y = x, we obtain
(cos y ) ·
dy
=1
dx
=⇒
dy
1
=
.
dx
cos y
By the identity
cos2 y = 1 − sin2 y = 1 − x 2 and the fact cos y ≥ 0, we have
√
cos y = 1 − x 2 . Therefore
dy
1
1
=
=√
.
dx
cos y
1 − x2
Formula
d
1
sin−1 x = √
,
dx
1 − x2
Ruipeng Shen
if − 1 < x < 1.
MATH 1ZA3
September 23rd, 25th
14 / 23
Application: Derivative of Inverse Tangent Function
Recall the definition of the inverse tangent function (arctangent function)
y = tan−1 x
⇐⇒
tan y = x and
π
−π
<y < .
2
2
Differentiating the equation tan y = x, we obtain
(sec2 y ) ·
dy
=1
dx
=⇒
dy
1
=
.
dx
sec2 y
By the identity sec2 y = 1 + tan2 y = 1 + x 2 . Therefore
dy
1
1
=
=
.
2
dx
sec y
1 + x2
Formula
1
d
tan−1 x =
.
dx
1 + x2
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
15 / 23
Derivatives of Inverse Trigonometric Function
Formula
Derivatives of inverse trigonometric functions are given by
d
dx
d
dx
d
dx
d
dx
1
sin−1 x = √
1 − x2
1
cos−1 x = − √
1 − x2
1
tan−1 x =
1 + x2
f 0 (x)
sin−1 f (x) = p
1 − [f (x)]2
d
dx
d
dx
d
dx
d
dx
1
csc−1 x = − √
x x2 − 1
1
sec−1 x = √
x x2 − 1
1
cot−1 x = −
1 + x2
f 0 (x)
tan−1 f (x) =
1 + [f (x)]2
Example
If F (x) = tan−1 (x 2 ), then F 0 (x) =
Ruipeng Shen
2x
1
· (x 2 )0 =
.
1 + (x 2 )2
1 + x4
MATH 1ZA3
September 23rd, 25th
16 / 23
Derivative of an Inverse Function
If f (x) is a one-to-one differentiable function and its inverse function f −1 is also
differentiable, then we can differentiate both sides of the identity f (f −1 (x)) = x
and obtain
f 0 (f −1 (x)) · (f −1 )0 (x) = 1 =⇒ (f −1 )0 (x) =
1
f
0 (f −1 (x))
,
provided f 0 (f −1 (x)) 6= 0.
Theorem
If f (x) is a one-to-one differentiable function and f 0 (f −1 (a)) 6= 0, then f −1 is
differentiable at a and
1
(f −1 )0 (a) = 0 −1
.
f (f (a))
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
17 / 23
Derivative of Logarithm Functions
If f (x) = ax then f −1 (x) = loga x. Since f 0 (x) = ax ln a 6= 0, we can apply the
formula for derivative of the inverse function and obtain
1
1
1
1
d
(loga x) = (f −1 )0 (x) = 0 −1
= 0
= log x
=
.
dx
f (f (x))
f (loga x)
a a ln a
x ln a
Formula (Derivative of Logarithm Functions)
If a > 0 and a 6= 1, then
d
1
(loga x) =
.
dx
x ln a
In particular, if a = e, we have
d
1
(ln x) = ,
dx
x
Ruipeng Shen
d
1 du
(ln u) =
,
dx
u dx
MATH 1ZA3
0
[ln g (x)] =
g 0 (x)
.
g (x)
September 23rd, 25th
18 / 23
Examples
Example
Let f (x) = ln |x|. Find the derivative f 0 (x).
Solution (I) If x > 0, then f (x) = ln x. Therefore f 0 (x) = 1/x.
(II) If x < 0, then f (x) = ln(−x). By the combined rule
f 0 (x) =
In summary, we have
1
d
1
·
(−x) = .
−x dx
x
d
1
ln |x| = .
dx
x
Example
Differentiate the function f (x) = ln(sin x).
Solution By the combined rule, we have
f 0 (x) =
Ruipeng Shen
(sin x)0
cos x
=
= cot x.
sin x
sin x
MATH 1ZA3
September 23rd, 25th
19 / 23
More Examples
Example
Differentiate the function g (x) = ln(x +
√
x 2 + 1).
Solution We can apply the chain rule and basic formulas:
g 0 (x)
=
=
=
=
=
1
√
x + x2 + 1
1
√
x + x2 + 1
1
√
x + x2 + 1
1
√
x + x2 + 1
1
√
.
2
x +1
Ruipeng Shen
p
d x + x2 + 1
dx
1
d 2
(x + 1)
· 1+ √
·
2 x 2 + 1 dx
x
· 1+ √
2
x +1
√
x2 + 1 + x
· √
x2 + 1
·
MATH 1ZA3
1 du
d
(ln u) = ·
dx
u dx
d √
1
du
( u) = √ ·
dx
2 u dx
September 23rd, 25th
20 / 23
Example of Logarithmic Differentiation
Example
√
Differentiate the function y = x
x
Solution Take natural logarithms of both sides and differentiate
√
√
ln y = ln(x x ) = x ln x
√
1 dy
d √
d
=
( x) · ln x + x ·
(ln x)
y dx
dx
dx
√ 1
1
√ · ln x + x ·
=
x
2 x
ln x + 2
√
=
2 x
√
dy
ln x + 2
ln x + 2
= y· √
=x x· √ .
dx
2 x
2 x
√
Alternative Method We can also use the identity y = x
and differentiate by the chain rule.
Ruipeng Shen
MATH 1ZA3
x
√
= (e ln x )
x
=e
√
x ln x
September 23rd, 25th
21 / 23
Logarithmic Differentiation
Proposition (Steps in Logarithmic Differentiation)
(I) Take natural logarithms of both sides of an equation y = f (x) and use the
Laws of Logarithms to simplify.
(II) Differentiate implicitly with respect to x.
(III) Solve the resulting equation for y 0 .
Example
Prove the formula
d n
(x ) = nx n−1 for an arbitrary real number n.
dx
Solution Let y = x n . Applying the Logarithmic Differentiation, we obtain
ln y
1 dy
y dx
dy
dx
Ruipeng Shen
= n ln x;
1
= n· ;
x
n
n
= y · = x n · = nx n−1 .
x
x
MATH 1ZA3
September 23rd, 25th
22 / 23
Example
Example
Differentiate the function y =
√
x
x
x2 + 1
.
Solution Applying the Logarithmic Differentiation, we obtain
x
p
x
1
ln y = ln √
= x ln x − ln x 2 + 1 = x ln x − ln(x 2 + 1)
2
x2 + 1
2
0
1
1
1
(x
+
1)
1 dy
= x 0 ln x − ln(x 2 + 1) + x
−
y dx
2
x
2 x2 + 1
1
1
x
x2 + 1
x2
− 2
,→ 2
− 2
= ln x − ln(x 2 + 1) + x
2
x
x +1
x +1 x +1
1
1
= ln x − ln(x 2 + 1) + 2
2
x +1
x dy
x
1
1
2
√
=
ln x − ln(x + 1) + 2
.
dx
2
x +1
x2 + 1
Ruipeng Shen
MATH 1ZA3
September 23rd, 25th
23 / 23