Mathematics for Artificial Intelligence
Lecture 5: Differentiation
Jun-Hyung Park Lecture 5-1 HUFS
Tangents
• The tangent line to the curve 𝑦 = 𝑓(𝑥) at the point 𝑃 𝑎, 𝑓 𝑎 is
the line through 𝑃 with slope
𝑓 𝑥 −𝑓 𝑎
𝑚 = lim
𝑥→𝑎 𝑥−𝑎
provided that this limit exists.
• Another expression
𝑓 𝑎+ℎ −𝑓 𝑎
𝑚 = lim
ℎ→0 ℎ
Jun-Hyung Park Lecture 5-2 HUFS
Examples
• Find an equation of the tangent line to the parabola 𝑦 = 𝑥 2 at the
point 𝑃 1,1
• Find an equation of the tangent line to the parabola 𝑦 = 3/𝑥 at
the point 3,1
Jun-Hyung Park Lecture 5-3 HUFS
Velocities
• Suppose an object moves along a straight line according to an
equation of motion 𝑠 = 𝑓 𝑡 , where 𝑠 is the displacement
(directed distance) of the object from the origin at time 𝑡
• In the time interval from 𝑡 = 𝑎 to 𝑡 = 𝑎 + ℎ the
change in position is 𝑓 𝑎 + ℎ − 𝑓 𝑎 . The
average velocity over this time interval is
𝑓 𝑎+ℎ −𝑓 𝑎
average velocity = displacement/time =
ℎ
• We define the velocity (or instantaneous velocity) 𝑣(𝑎) at time 𝑡 =
𝑎 to be the limit of these average velocities:
𝑓 𝑎+ℎ −𝑓 𝑎
𝑣 𝑎 = lim
ℎ→0 ℎ
Jun-Hyung Park Lecture 5-4 HUFS
Examples
• Suppose that a ball is dropped from the upper observation deck
of a tower, 450m above the ground
• What is the velocity of the ball after 5 seconds?
• How fast is the ball traveling when it hits the ground?
Jun-Hyung Park Lecture 5-5 HUFS
Derivatives
• The limit we have seen arises whenever we calculate a rate of
change in any of the sciences and engineering. So it is given a
special name and notation
• The derivative of a function 𝑓, denoted by 𝑓 ′ 𝑥 is
′
𝑓 𝑥+ℎ −𝑓 𝑥
𝑓 𝑥 = lim
ℎ→0 ℎ
if this limit exists
Jun-Hyung Park Lecture 5-6 HUFS
Examples
• Find the derivative of the function 𝑓 𝑥 = 𝑥 2 − 8𝑥 + 9
• Find an equation of the tangent line to the curve 𝑦 = 𝑓 𝑥 at the
point 𝑎, 𝑓 𝑎
Jun-Hyung Park Lecture 5-7 HUFS
Examples
• The graph of a function 𝑓 is given in the figure. Use it to sketch
the graph of the derivative 𝑓 ′
Jun-Hyung Park Lecture 5-8 HUFS
Examples
• If 𝑓 𝑥 = 𝑥 3 − 𝑥, find a formula for 𝑓 ′ 𝑥
• Illustrate by comparing the graphs of 𝑓 and 𝑓 ′
Jun-Hyung Park Lecture 5-9 HUFS
Examples
• If 𝑓 𝑥 = 𝑥, find the derivative of 𝑓. State the domain of 𝑓 ′
1−𝑥
• Find 𝑓 ′ if 𝑓 𝑥 =
2+𝑥
Jun-Hyung Park Lecture 5-10 HUFS
Derivative Notations
• If we use the traditional notation 𝑦 = 𝑓 𝑥 , some common
alternative notations for the derivative are as follows:
′ ′
𝑑𝑦 𝑑
𝑓 𝑥 =𝑦 = = 𝑓 𝑥 = 𝐷𝑓 𝑥 = 𝐷𝑥 𝑓 𝑥
𝑑𝑥 𝑑𝑥
• Leibnez notation: Useful and suggestive notation when used in
conjunction with increment notation (but NOT a ratio)
𝑑𝑦 ∆𝑦
= lim
𝑑𝑥 ∆𝑥→0 ∆𝑥
𝑑𝑦
ቚ
𝑑𝑥 𝑥=𝑎
Jun-Hyung Park Lecture 5-11 HUFS
Differentiability
• A function 𝑓 is differentiable at 𝑎 if 𝑓 ′ 𝑎 exists, and on an open
interval 𝑎, 𝑏 if it is differentiable at every number in the interval
• If 𝑓 is differentiable at 𝑎, then 𝑓 is continuous at 𝑎. (Its converse
is false)
• When a function fails to be differentiable
Jun-Hyung Park Lecture 5-12 HUFS
Examples
• Where is the function 𝑓 𝑥 = 𝑥 differentiable?
Jun-Hyung Park Lecture 5-13 HUFS
Higher Derivatives
• Second derivative of 𝑓: 𝑓 ′ is a function, so 𝑓′ may have a
derivative of its own, called the second derivative of 𝑓
𝑑 𝑑𝑦 𝑑2 𝑦
𝑓 ′′ 𝑥 = = 2
𝑑𝑥 𝑑𝑥 𝑑𝑥
Jun-Hyung Park Lecture 5-14 HUFS
Examples
• If 𝑓 𝑥 = 𝑥 3 − 𝑥, find and interpret 𝑓 ′′ 𝑥
• If 𝑓 𝑥 = 𝑥 3 − 𝑥, find 𝑓 ′′′ 𝑥 and 𝑓 4
𝑥
Jun-Hyung Park Lecture 5-15 HUFS
Differentiation Rules
• Derivative of a Constant Function
𝑑
𝑐 =0
𝑑𝑥
• Derivative of a Power Function: If 𝑛 is any real number, then
𝑑 𝑛
𝑥 = 𝑛𝑥 𝑛−1
𝑑𝑥
Jun-Hyung Park Lecture 5-16 HUFS
Examples
• Differentiate:
• 𝑓 𝑥 = 𝑥6
• 𝑦 = 𝑥 1000
• 𝑦 = 𝑡4
𝑑
• 𝑟 3 = 3𝑟 2
𝑑𝑟
1
• 𝑓 𝑥 =
𝑥2
3
• 𝑦= 𝑥2
Jun-Hyung Park Lecture 5-17 HUFS
Differentiation Rules
• The Constant Multiple Rule
𝑑 𝑑
𝑐𝑓 𝑥 =𝑐 𝑓 𝑥
𝑑𝑥 𝑑𝑥
• The Sum and Difference Rules
𝑑 𝑑 𝑑
𝑓 𝑥 +𝑔 𝑥 = 𝑓 𝑥 + 𝑔 𝑥
𝑑𝑥 𝑑𝑥 𝑑𝑥
𝑑 𝑑 𝑑
𝑓 𝑥 −𝑔 𝑥 = 𝑓 𝑥 − 𝑔 𝑥
𝑑𝑥 𝑑𝑥 𝑑𝑥
Jun-Hyung Park Lecture 5-18 HUFS
Examples
• Differentiate:
𝑑
• 𝑥 8 + 12𝑥 5 − 4𝑥 4 + 10𝑥 3 − 6𝑥 + 5
𝑑𝑥
• Find the points on the curve 𝑦 = 𝑥 4 − 6𝑥 2 + 4 where the tangent
line is horizontal
Jun-Hyung Park Lecture 5-19 HUFS
Examples
• The equation of motion of a particle is 𝑠 = 2𝑡 3 − 5𝑡 2 + 3𝑡 + 4 ,
where 𝑠 is measured in centimeters and 𝑡 in seconds. Find the
acceleration as a function of time. What is the acceleration after
2 seconds?
Jun-Hyung Park Lecture 5-20 HUFS
Differentiation Rules
• Derivative of a Exponential Function
𝑓 𝑥 = 𝑏𝑥
𝑓′ 𝑥 = 𝑓′ 0 𝑏𝑥
Jun-Hyung Park Lecture 5-21 HUFS
Differentiation Rules
• Definition of the Number 𝑒: 𝑒 is the number such that
𝑒ℎ − 1
lim =1
ℎ→0 ℎ
• Derivative of the Natural Exponential Function
𝑑 𝑥
𝑒 = 𝑒𝑥
𝑑𝑥
Jun-Hyung Park Lecture 5-22 HUFS
Examples
• If 𝑓 𝑥 = 𝑒 𝑥 − 𝑥, find 𝑓 ′ and 𝑓 ′′ . Compare the graphs of 𝑓 ′ and
𝑓 ′′
• At what point on the curve 𝑦 = 𝑒 𝑥 is the tangent line parallel to
the line 𝑦 = 2𝑥
Jun-Hyung Park Lecture 5-23 HUFS
Differentiation Rules
• The Product Rule
𝑑 𝑑 𝑑
𝑓 𝑥 𝑔 𝑥 =𝑓 𝑥 𝑔 𝑥 +𝑔 𝑥 𝑓 𝑥
𝑑𝑥 𝑑𝑥 𝑑𝑥
Jun-Hyung Park Lecture 5-24 HUFS
Examples
• If 𝑓 𝑥 = 𝑥𝑒 𝑥 , find 𝑓 ′ 𝑥 and 𝑓 𝑛
𝑥
• Differentiate the function 𝑓 𝑡 = 𝑡 𝑎 + 𝑏𝑡
Jun-Hyung Park Lecture 5-25 HUFS
Examples
• If 𝑓 𝑥 = 𝑥𝑔 𝑥 , where 𝑔 4 = 2 and 𝑔′ 4
= 3, find 𝑓 ′ 4
Jun-Hyung Park Lecture 5-26 HUFS
Differentiation Rules
• The Quotient Rule
𝑑 𝑑
𝑑 𝑓 𝑥 𝑔 𝑥 𝑓 𝑥 −𝑓 𝑥 𝑔 𝑥
= 𝑑𝑥 𝑑𝑥
𝑑𝑥 𝑔 𝑥 𝑔 𝑥 2
Jun-Hyung Park Lecture 5-27 HUFS
Examples
𝑥 2 +𝑥−2
• Let 𝑦 = . Then
𝑥 3 +6
𝑒𝑥
• Find an equation of the tangent line to the curve 𝑦 = at the
1+𝑥 2
1
point 1, 𝑒
2
Jun-Hyung Park Lecture 5-28 HUFS
Differentiation Rules
• Derivatives of Trigonometric Functions
𝑑 𝑑
sin 𝑥 = cos 𝑥 csc 𝑥 = − csc 𝑥 cot 𝑥
𝑑𝑥 𝑑𝑥
𝑑 𝑑
cos 𝑥 = − sin 𝑥 sec 𝑥 = sec 𝑥 tan 𝑥
𝑑𝑥 𝑑𝑥
𝑑 𝑑
tan 𝑥 = sec 2 𝑥 cot 𝑥 = − csc2 𝑥
𝑑𝑥 𝑑𝑥
Jun-Hyung Park Lecture 5-29 HUFS
Examples
sec 𝑥
• Differentiate 𝑓 𝑥 = . For what values of 𝑥 does the graph
1+tan 𝑥
of 𝑓 have a horizontal tangent?
• An object fastened to the end of a vertical spring is stretched 4cm
beyond its rest position and released at time t = 0. Its position at
time t is
𝑠 = 𝑓 𝑡 = 4 cos 𝑡
Find the velocity and acceleration at time t and use
them to analyzie the motion of the object
Jun-Hyung Park Lecture 5-30 HUFS
Examples
• Find the 27th derivative of cos 𝑥
Jun-Hyung Park Lecture 5-31 HUFS
Differentiation Rules
• The Chain Rule: If 𝑔 is differentiable at 𝑥 and 𝑓 is differentiable at
𝑔 𝑥 , then the composite function 𝐹 = 𝑓 ∘ 𝑔 defined 𝐹 𝑥 =
𝑓 𝑔 𝑥 is differentiable at 𝑥 and 𝐹′ is given by the product
𝐹 ′ 𝑥 = 𝑓 ′ 𝑔 𝑥 𝑔′ 𝑥
• In Leibniz notation, if 𝑦 = 𝑓 𝑢 and 𝑢 = 𝑔 𝑥 are both
differentiable functions, then
𝑑𝑦 𝑑𝑦 𝑑𝑢
=
𝑑𝑥 𝑑𝑢 𝑑𝑥
Jun-Hyung Park Lecture 5-32 HUFS
Examples
• Find 𝐹 ′ 𝑥 if 𝐹 𝑥 = 𝑥 2 + 1
• Differentiate 𝑦 = sin 𝑥 2 and 𝑦 = sin2 𝑥
Jun-Hyung Park Lecture 5-33 HUFS
Differentiation Rules
• Derivative of General Exponential Function
𝑑 𝑥
𝑏 = 𝑏 𝑥 ln 𝑏
𝑑𝑥
Jun-Hyung Park Lecture 5-34 HUFS
Examples
• Find the derivative of each of the functions
• 𝑔 𝑥 = 2𝑥
𝑥2
• ℎ 𝑥 =5
Jun-Hyung Park Lecture 5-35 HUFS
Implicit Differentiation
• 𝑥 2 + 𝑦 2 = 25
• 𝑥 3 + 𝑦 3 = 6𝑥𝑦
Jun-Hyung Park Lecture 5-36 HUFS
Differentiation Rules
• Derivative of Logarithmic Functions
𝑑 1
log 𝑏 𝑥 =
𝑑𝑥 𝑥 ln b
Jun-Hyung Park Lecture 5-37 HUFS
Examples
• Differentiate:
• 𝑦 = ln 𝑥 3 + 1
𝑑
• = ln sin 𝑥
𝑑𝑥
3
𝑥4 𝑥 2 +1
𝑦=
3𝑥+2 5
𝑥
• 𝑦=𝑥
Jun-Hyung Park Lecture 5-38 HUFS
Number 𝑒 as limit
1
𝑒 = lim 1 + 𝑥 𝑥
𝑥→0
𝑛
1
𝑒 = lim 1 +
𝑛→∞ 𝑛
Jun-Hyung Park Lecture 5-39 HUFS
Differentiation Rules
• Derivatives of Inverse Trigonometric Functions
𝑑 −1
1 𝑑 −1
1
sin 𝑥 = csc 𝑥 = −
𝑑𝑥 1 − 𝑥2 𝑑𝑥 𝑥 1 − 𝑥2
𝑑 1 𝑑 1
cos −1 𝑥 = − sec −1 𝑥 =
𝑑𝑥 1 − 𝑥2 𝑑𝑥 𝑥 1 − 𝑥2
𝑑 −1
1 𝑑 −1
1
tan 𝑥 = cot 𝑥 = −
𝑑𝑥 1 + 𝑥2 𝑑𝑥 1 + 𝑥2
Jun-Hyung Park Lecture 5-40 HUFS