MAT115 Week 6
MAT115 Week 6
Before diving in, let’s briefly review the trigonometric functions. Specifically, recall that when we define
a function f for all real numbers x by
f (x) = sin x,
the expression sin x refers to the sine of an angle measured in radians. This same convention applies to
the other trigonometric functions: cos, tan, csc, sec, and cot. Also, remember that all these functions are
continuous throughout their respective domains.
To investigate the derivative of f (x) = sin x, consider its graph. Observing the sine curve and using the
geometric interpretation of the derivative as the slope of the tangent line, it appears that the derivative
resembles the cosine curve (see Figure 1).
1.5 y
y = sin(x)
d
y = dx sin(x)
1
0.5
x
−π − π2 π π
2
−0.5
−1
−1.5
Let’s verify that f 0 (x) = cos x using the definition of the derivative:
f (x + h) − f (x)
f 0 (x) = lim
h→0 h
sin(x + h) − sin x
= lim .
h→0 h
Applying the addition formula for sine:
1
Since x is treated as a constant when evaluating the limit as h → 0, the limits involving sin x and cos x
are straightforward:
lim sin x = sin x and lim cos x = cos x.
h→0 h→0
Additionally, we know:
sin h
lim = 1.
h→0 h
It remains to evaluate:
cos h − 1
lim .
h→0 h
We can simplify this limit as follows:
cos x − 1 cos x − 1 cos x + 1
lim = lim ·
x→0 x x→0 x cos x + 1
cos2 x − 1
= lim
x→0 x(cos x + 1)
− sin2 x
= lim
x→0 x(cos x + 1)
sin x − sin x
= lim ·
x→0 x cos x + 1
0
= 1 × = 0.
2
Substituting the evaluated limits back, we get:
f 0 (x) = sin x × 0 + cos x × 1
= cos x.
Thus, we’ve established the derivative of the sine function:
d
(sin x) = cos x.
dx
dy d d
= x2 (sin x) + sin x x2
dx dx dx
= x2 cos x + 2x sin x
Using the same approach as in the previous proof, we can show that:
d
(cos x) = − sin x .
dx
Next, let’s find the derivative of the tangent function. While it is possible to use the definition of the
derivative directly, it’s much more straightforward to apply the Quotient Rule, along with the results we
have already obtained:
d d sin x
(tan x) =
dx dx cos x
d d
cos x · − sin x · dx
dx (sin x) (cos x)
= 2
cos x
cos x · cos x − sin x · (− sin x)
=
cos2 x
cos x + sin2 x
2
=
cos2 x
1
= (since sin2 x + cos2 x = 1)
cos2 x
= sec2 x.
2
Thus,
d
(tan x) = sec2 x
dx
Similarly, the derivatives of the remaining trigonometric functions—csc x, sec x, and cot x—can be derived
using the Quotient Rule and the relationships between the functions. For convenience, we summarize
all the derivatives of the six basic trigonometric functions in the table below. Keep in mind that these
formulas are valid only when x is measured in radians.
d d
(sin x) = cos x (csc x) = − csc x cot x
dx dx
d d
(cos x) = − sin x (sec x) = sec x tan x
dx dx
d d
(tan x) = sec2 x (cot x) = − csc2 x
dx dx
3
Example 1.3 Differentiate
sec x
f (x) =
1 + tan x
For what values of x does the graph of f have a horizontal tangent?
Because sec x is never 0, we see that f 0 (x) = 0 when tan x = 1, and this occurs when x = π/4+nπ,
where n is an integer.
y f (x)
2
x
−π − 3π − π2 − π4 π π 3π π
4 4 2 4
−2
Example 1.4 Determine the equation of the tangent line to the curve
π 3
y = cos x at
2
,
6 4
4
Example 1.5 Find the 27th derivative of cos x.
f 0 (x) = − sin x
f 00 (x) = − cos x
f 000 (x) = sin x
f (4) (x) = cos x
f (5) (x) = − sin x
We see that the successive derivatives occur in a cycle of length 4 and, in particular, f (n) (x) = cos x
whenever n is a multiple of 4. Therefore
The differentiation rules we have learned so far are not immediately helpful for calculating
√ F 0 (x).
However, notice that F is a composite function. Specifically, if we let y = f (u) = u and u = g(x) =
5
x2 + 1, we can express F as: p
F (x) = f (g(x)) = x2 + 1.
We already know how to differentiate both f (u) and g(x). What we need is a rule that allows us to
differentiate the composite function F (x) = f (g(x)) in terms of the derivatives of f and g.
James Gregory
The Chain Rule was first formulated by the Scottish mathematician James Gregory (1638–1675), who
is also credited with designing the first practical reflecting telescope (the Gregorian telescope). Gregory
made significant contributions to the early development of calculus, independently of Newton. He was
appointed the first Professor of Mathematics at the University of St. Andrews and later held the same
post at the University of Edinburgh. Tragically, Gregory passed away at the young age of 36, just a year
after taking up his position in Edinburgh.
du
represent the rate of change of u with respect to x,
dx
dy
represent the rate of change of y with respect to u,
du
dy
represent the rate of change of y with respect to x.
dx
If u changes twice as fast as x, and y changes three times as fast as u, then naturally, y would change six
times as fast as x. Therefore, it is reasonable to expect that:
dy dy du
= × .
dx du dx
This is precisely what the Chain Rule states, and in the next section, we will formalize and prove it.
In Leibniz notation, if y = f (u) and u = g(x) are both differentiable functions, then
dy dy du
= (2)
dx du dx
The Leibniz formula is easy to remember because if we think of dy/du and du/dx as quotients, then
we could cancel du; however, du has not been defined and du/dx should not be considered as an actual
quotient.
6
√
Example 2.1 Find F 0 (x) if F (x) = x2 + 1.
Solution 1 (using Formula 1): √At the beginning of this section we expressed F as F (x) =
(f ◦ g)(x) = f (g(x)) where f (u) = u and g(x) = x2 + 1. Since
1 −1/2 1
f 0 (u) = u = √ and g 0 (x) = 2x
2 2 u
we have
F 0 (x) = f 0 (g(x)) · g 0 (x)
1 x
= √ · 2x = √
2 x2 + 1 x2 + 1
√
Solution 2 (using Formula 2): If we let u = x2 + 1 and y = u, then
dy du 1 1 x
F 0 (x) = = √ (2x) = √ (2x) = √
du dx 2 u 2
2 x +1 2
x +1
When using Formula 2 (the Leibniz formula) we should bear in mind that dy/dx refers to the derivative
of y when y is considered as a function of x (the derivative of y with respect to x), whereas dy/du refers
to the derivative of y when considered as a function of u (the derivative
√ of y with respect to u). For
instance,
√ in Example 1, y can be considered as a function of x y = x 2 + 1 and also as a function of
dy x dy 1
= F 0 (x) = √ whereas = f 0 (u) = √
dx x2 + 1 du 2 u
√
Let u = x2 + x. Then
1
y= = u−400
u400
According to the Chain Rule,
√ −401
dy dy du 1 1
= · = −400u−401 · 2x + √ = −400 x2 + x · 2x + √
dx du dx 2 x 2 x
√ √
q
dy d
q
= cos x+ x · x+ x
dx dx
√ √
q
1 d
= cos x+ x · p √ · x+ x
2 x + x dx
√
q
1 1
= cos x+ x · p √ · 1+ √
2 x+ x 2 x
7
Example 2.4 Find the derivative of the function
9
t−2
g(t) =
2t + 1
Combining the Power Rule, Chain Rule, and Quotient Rule, we get
8
t−2 d t−2
g 0 (t) = 9
2t + 1 dt 2t + 1
8
45(t − 2)8
t−2 (2t + 1) · 1 − 2(t − 2)
=9 =
2t + 1 (2t + 1)2 (2t + 1)10
The reason for the name “Chain Rule” becomes clear when we make a longer chain by adding another
link. Suppose that y = f (u), u = g(x), and x = h(t) where f, g, and h are differentiable functions. Then,
to compute the derivative of y with respect to t, we use the Chain Rule twice:
dy dy dx dy du dx
= =
dt dx dt du dx dt
d
f 0 (x) = cos(cos(tan x)) cos(tan x)
dx
d
= cos(cos(tan x))[− sin(tan x)] (tan x)
dx
2
= − cos(cos(tan x)) sin(tan x) sec x
The outer function is the exponential function, the middle function is the secant function, and the
inner function is the tripling function. So we have
dy d
= esec 3θ (sec 3θ)
dθ dθ
d
= esec 3θ sec 3θ tan 3θ (3θ)
dθ
= 3esec 3θ sec 3θ tan 3θ
8
Example 2.7 Differentiate
y = cos (x◦ )
where x is measured in degrees.
Remember: Our differentiation formulas for trigonometric functions are only valid when the
angle is measured in radians!
Thus, first convert x◦ to radians:
πx
x◦ =
180
Thus,
πx
y = cos
180
According to the Chain Rule
dy πx π π
= − sin · =− sin (x◦ )
dx 180 180 180
We can use the Chain Rule to differentiate an exponential function with any base b > 0. Recall
bx = e(lnb)x
d x
(b ) = bx ln b
dx
1. g(x) = 2x
2. h(x) = 5x
2
2. The outer function is an exponential function and the inner function is the squaring function,
so we use the previous formula and the Chain Rule to get
d x2 2 d 2
h0 (x) = = 5x ln 5 · x2 = 2x · 5x ln 5
5
dx dx
3. Implicit Differentiation
Up to this point, the functions we’ve encountered have typically been written by explicitly expressing
one variable in terms of another. For example:
y = x3 + 1 or y = x sin x,
p
9
However, not all functions are conveniently described in this way. Some are defined implicitly by a
relationship between x and y, such as:
x2 + y 2 = 25
or
x3 + y 3 = 6xy.
In certain cases, it is possible to solve such an equation explicitly for y as a function (or even multiple
functions) of x. For instance, solving the first equation for y yields:
p
y = ± 25 − x2 ,
√ √
which represents two separate functions: f (x) = 25 − x2 and g(x) = − 25 − x2 . The graphs of these
functions correspond to the upper and lower semicircles of the circle defined by x2 + y 2 = 25.
5 y √
y = 25 − x2
√
4 y = − 25 − x2
x
−5 −4 −3 −2 −1 1 2 3 4 5
−1
−2
−3
−4
−5
On the other hand, solving the second equation explicitly for y is not straightforward. Even with the
aid of technology, the expressions involved become quite unwieldy. Nevertheless, the equation defines a
well-known curve called the folium of Descartes. It implicitly determines y as one or more functions of
x. Specifically, when we say that f is defined implicitly by the equation
we mean that this relationship holds true for all x within the domain of f .
Fortunately, we do not need to solve such an equation explicitly for y to find the derivative of y with
respect to x. Instead, we can apply a technique called implicit differentiation. This method involves
differentiating both sides of the equation with respect to x, treating y as an implicit function of x, and
then solving for dx
dy
.
In all the examples and exercises in this section, it is assumed that the given relation defines y implicitly
as a differentiable function of x, so that implicit differentiation can be applied safely.
The next example demonstrates that even when an equation can be solved explicitly for y, implicit
differentiation often provides a more efficient and elegant approach.
10
Example 3.1 If x2 + y 2 = 25, find dx dy
. Then find an equation of the tangent to the
circle x2 + y 2 = 25 at the point (3, 4).
d d dy dy
y2 = y2
= 2y
dx dy dx dx
Thus
dy
2x + 2y =0
dx
Now we solve this equation for dy/dx:
dy x
=−
dx y
At the point (3, 4) we have x = 3 and y = 4, so
dy 3
=−
dx 4
An equation of the tangent to the circle at (3, 4) is therefore
3
y − 4 = − (x − 3) or 3x + 4y = 25
4
√
Alternative Solution: Solving the equation
√ x2 +y 2 = 25 for y, we get y = ± 25 − x2 . √
The point
(3, 4) lies on the upper semicircle y = 25 − x2 and so we consider the function f (x) = 25 − x2 .
Differentiating f using the Chain Rule, we have
1 −1/2 d
f 0 (x) = 25 − x2 25 − x2
2 dx
1 2 −1/2
x
= 25 − x (−2x) = − √
2 25 − x2
At the point (3, 4) we have
3 3
f 0 (3) = − √ =−
25 − 3 2 4
and, as in the first solution, an equation of the tangent is 3x + 4y = 25.
11
Example 3.2
1. Find y 0 if x3 + y 3 = 6xy.
2. Find the tangent to the folium of Descartes x3 + y 3 = 6xy at the point (3, 3).
3. At what point in the first quadrant is the tangent line horizontal?
3x2 + 3y 2 y 0 = 6xy 0 + 6y
x2 + y 2 y 0 = 2xy 0 + 2y
2y − x2
y0 =
y 2 − 2x
2. When x = y = 3,
2 · 3 − 32
y0 = = −1
32 − 2 · 3
So an equation of the tangent to the folium at (3, 3) is
y − 3 = −1(x − 3) or x+y =6
3. The tangent line is horizontal if y 0 = 0. Using the expression for y 0 from part 1, we see that
y 0 = 0 when 2y − x2 = 0 (provided that y 2 − 2x 6= 0). Substituting y = 12 x2 in the equation
of the curve, we get
3
3 1 2 1 2
x + x = 6x x
2 2
which simplifies to x6 = 16x3 . Since 6= 0 in the first quadrant, we have x3 = 16. If
x5/3
x = 16 1/3
= 2 , then y = 2 2
4/3 1 8/3
= 2 . Thus the tangent is horizontal at 24/3 , 25/3 ,
which is approximately (2.5198, 3.1748).
12
Example 3.3 Determine dy
dx using implicit differentiation:
1. x2 + xy − y 2 = 9 sin y
2. x + y = cos xy 2
1.
dy
(x − 2y − 9 cos y) = −2x − y
dx
dy 2x + y
=−
dx x − 2y − 9 cos y
2.
dy d
= − sin xy 2 · xy 2
1+
dx dx
2
2 dy
= − sin xy · y + 2xy
dx
dy
1 + 2xy sin xy 2 = −y 2 sin xy 2 − 1
dx
dy y 2 sin xy 2 + 1
=−
dx 1 + 2xy sin (xy 2 )
1 · (1 + y 3 ) − x · (0 + 3y 2 y 0 )
= 0 + sec2 yy 0
(1 + y 3 )2
1 + y 3 − 3xy 2 y 0
= sec2 yy 0
(1 + y 3 )2
1 + y 3 − 3xy 2 y 0 = (1 + y 3 )2 sec2 yy 0
− 3xy 2 + (1 + y 3 )2 sec2 y y 0 = −1 − y 3
1 + y3
y0 =
3xy 2 + (1 + y 3 )2 sec2 y
13
Example 3.5 Determine the equation of the tangent line to the curve
First, determine y 0 :
dy 2 · 2 + 2(−1) + 1 3 1
=− =− =−
dx (x,y)=(2,−1) 2 · 2 − 2(−1) 6 2
The equation of the tangent line is
1 1
y = − (x − 2) − 1 = − x
2 2
Example 3.6 Determine all points where the tangent line to the curve
x2 y 2 + xy = 2
dy dy
0= 2x · y 2 + x2 · 2y + y+x
dx dx
dy
− 2x2 y + x = 2xy 2 + y
dx
dy 2xy 2 + y y(2xy + 1) y
=− 2 =− =−
dx 2x y + x x(2xy + 1) x
For tangent lines with gradients of -1, we must have
dy y
= − = −1 =⇒ y = x
dx x
So the points on the curve where the gradient of the tangent lines is -1 are precisely the points
where the x and y coordinates are equal. But those points must also lie on the curve, i.e., they
must satisfy the (implicit) equation. For y = x, we have
x2 x2 + xx = 2
x4 + x2 − 2 = 0
(x2 + 2)(x2 − 1) = 0
x2 = −2 or x2 = 1
x = −1 or x = 1
Thus, the points where there are tangent lines with gradient -1 are (1, 1) and (−1, −1).
14
Example 3.7 If x3 + y 3 = 8, determine d2 y
dx2 using implicit differentiation.
We have
3x2 + 3y 2 y 0 = 0
3x2 x2
y0 = − = −
3y 2 y2
2x · y 2 − x2 · 2yy 0
2
00 d 0 d x
y = y = − 2 =−
dx dx y (y 2 )2
2
2xy 2 − 2x2 y · − xy2
4
2xy 2 + 2xy
=− =−
y4 y4
2xy 3 + 2x4 2x(y 3 + x3 )
=− 5
=−
y y5
y q = xp .
dy pxp−1
= p q−1
dx
q xq
p p−1− pq (q−1)
= x
q
p p−1− p− pq
= x
q
p pq −1
= x .
q
Thus, we have shown that:
d pq p pq −1
x = x = nxn−1 .
dx q
This completes the proof that the Power Rule is valid for all rational exponents.
15