MAT6105 3.3 HigherDerivatives PDF
MAT6105 3.3 HigherDerivatives PDF
MAT6105 3.3 HigherDerivatives PDF
3
Higher derivatives – Video 1
Critical points of single-variable functions
Dr Julia Collins
In Module 3.2…
In Module 3.2 we saw how we could use the method of steepest ascent/descent
and the concept of gradient vectors to find maximum and minimum values of
surfaces.
For example, following the gradient vectors leads
to this peak.
In Module 3.2…
In Module 3.2 we saw how we could use the method of steepest ascent/descent
and the concept of gradient vectors to find maximum and minimum values of
surfaces.
For example, following the gradient vectors leads
to this peak.
𝑓 𝑥 = 𝑥 3 − 3𝑥 2 + 4.
𝑑𝑓
A point 𝑎 ∈ ℝ such that 𝑎 = 0 is called a critical point of the
𝑑𝑥
function 𝑓. I.e. a critical point is one where the first derivative is zero.
Example 1
Find the critical points of 𝑓 𝑥 = 𝑥 3 − 3𝑥 2 + 4.
Solution
𝑓 ′ (𝑥) = 3𝑥 2 − 6𝑥 = 3𝑥(𝑥 − 2)
The critical points are when 𝑓′ 𝑥 = 0.
This happens at 𝑥 = 0 and 𝑥 = 2.
Classifying critical points
𝑓′ 𝑝 = 0
𝑓′ 𝑝 > 0 𝑓′ 𝑝 < 0
𝑓 increasing 𝑓 decreasing
𝑓′ 𝑝 = 0
𝑓′ 𝑝 < 0 𝑓′ 𝑝 > 0
𝑓 decreasing 𝑓 increasing
𝑝 𝑝
A different type of critical point…
Example 2
Find the critical points of 𝑓 𝑥 = 𝑥 3 .
Solution
𝑓 ′ (𝑥) = 3𝑥 2 , so there is one critical point
when 𝑥 = 0.
1. Sign test
2. Second derivative test
1. Sign test
𝑑2𝑓
2
𝑎 = 𝑓′′(𝑎) < 0.
𝑑𝑥
Example 1 (revisited)
Use the second derivative test to classify the two critical points of
𝑓 𝑥 = 𝑥 3 − 3𝑥 2 + 4.
Solution
𝑓 ′ 𝑥 = 3𝑥 2 − 6𝑥 and critical points are 𝑥 = 0, 2.
𝑓 ′′ 𝑥 = 6𝑥 − 6.
Examples 2, 3
Find and classify the critical points of 𝑓 𝑥 = 𝑥 3 and 𝑔 𝑥 = 𝑥 4 .
Solution
𝑓 ′ 𝑥 = 3𝑥 2 and 𝑔′ 𝑥 = 4𝑥 3 , each with one critical point at 𝑥 = 0.
𝑓 ′′ 𝑥 = 6𝑥 and 𝑔′′ 𝑥 = 12𝑥 2 so 𝑓 ′′ 0 = 0 = 𝑔′′(0).
So the second derivative test is inconclusive in both cases.
𝑓 𝑥 = 𝑥3 𝑔 𝑥 = 𝑥4
Inflection point at 𝑥 = 0 Local minimum at 𝑥 = 0
Example
Example 4
Find and classify the critical points of 𝑓 𝑥 = 𝑥 + sin(𝑥).
Solution
𝑓 ′ 𝑥 = 1 + cos(𝑥) and critical points are where cos 𝑥 = −1.
Thus the critical points are at 𝑥 = ±𝜋, ±3𝜋, ±5𝜋, …
We see that 𝑓 ′ 𝑥 = 1 + cos(𝑥) ≥ 0 for all 𝑥, so critical points are inflection points.
Examples
Example 4
𝑓 𝑥 = 𝑥 + sin(𝑥)
Infinitely many
inflection points
Examples
Example 5
Find and classify the critical points of 𝑓 𝑥 = |𝑥|, where
𝑥 for 𝑥 ≥ 0
𝑥 =ቊ
−𝑥 for 𝑥 < 0
Solution
The first derivative of 𝑓 is
1 for 𝑥 > 0
𝑓′(𝑥) = ቊ
−1 for 𝑥 < 0
This is a discontinuous function and it is not defined at 𝑥 = 0. If 𝑓 ′ 𝑝 is undefined for a
Although there are no points where 𝑓 ′ 𝑥 = 0, 𝑥 = 0 is point 𝑝 in the domain of 𝑓,
then 𝑝 is also called a
considered to be a critical point. critical point.
MAT6105 Module 3.3
Higher derivatives – Video 2
Critical points of surfaces
Dr Julia Collins
Finding extrema of surfaces
local maximum
Let 𝑓: ℝ × ℝ → ℝ be a function of two variables
and (𝑎, 𝑏) ∈ ℝ × ℝ.
Note that all maxima and minima of surfaces will be critical points, but not all
critical points are maxima or minima.
Critical points of surfaces
Example 1
Find the critical points of 𝑓 𝑥 = 2𝑥 2 + 3𝑦 2 − 5𝑥 + 8𝑦 − 1.
Solution
𝜕𝑓 𝜕𝑓
= 𝑓𝑥 = 4𝑥 − 5 ; = 𝑓𝑦 = 6𝑦 + 8
𝜕𝑥 𝜕𝑦
5 4
This happens at 𝑥 = and 𝑦 = − , so there is a
4 3
single critical point.
Critical points of surfaces
Example 2
Find the critical points of 𝑓 𝑥 = 𝑥 2 − 𝑦 2 .
Solution
𝜕𝑓 𝜕𝑓
= 𝑓𝑥 = 2𝑥 ; = 𝑓𝑦 = −2𝑦
𝜕𝑥 𝜕𝑦
Looking at the plot of the gradient fields, we see that the critical points occur when
the gradient vectors are zero.
𝑓 𝑥 = 2𝑥 2 + 3𝑦 2 − 5𝑥 + 8𝑦 − 1 𝑓 𝑥 = 𝑥2 − 𝑦2
Classifying critical points of surfaces
The best way to determine what type of critical point you have found is to
do the second derivative test for surfaces.
For this we will need to compute second partial derivatives. For a function
of two variables 𝑓(𝑥, 𝑦) there are four of these:
𝜕 𝜕𝑓 𝜕2𝑓 𝜕 𝜕𝑓 𝜕2𝑓
= 2 = 𝑓𝑥𝑥 ; = 2 = 𝑓𝑦𝑦
𝜕𝑥 𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝜕𝑦
𝜕 𝜕𝑓 𝜕2𝑓 𝜕 𝜕𝑓 𝜕2𝑓
= = 𝑓𝑥𝑦 ; = = 𝑓𝑦𝑥
𝜕𝑥 𝜕𝑦 𝜕𝑥𝜕𝑦 𝜕𝑦 𝜕𝑥 𝜕𝑦𝜕𝑥
Classifying critical points of surfaces
Then
• If 𝐷 > 0 and 𝑓𝑥𝑥 𝑎, 𝑏 > 0 then 𝑓(𝑎, 𝑏) is a local minimum
• If 𝐷 > 0 and 𝑓𝑥𝑥 𝑎, 𝑏 < 0 then 𝑓(𝑎, 𝑏) is a local maximum
• If 𝐷 < 0 then 𝑓(𝑎, 𝑏) is a saddle point
• If 𝐷 = 0 then the test is inconclusive (anything can happen!)
Critical points of surfaces
Example 1 revisited
Classify the critical points of 𝑓 𝑥 = 2𝑥 2 + 3𝑦 2 − 5𝑥 + 8𝑦 − 1.
Solution
5 4
We found a critical point at , − .
4 3
𝜕𝑓 𝜕𝑓
= 𝑓𝑥 = 4𝑥 − 5 ; = 𝑓𝑦 = 6𝑦 + 8
𝜕𝑥 𝜕𝑦
so 𝑓𝑥𝑥 = 4, 𝑓𝑦𝑦 = 6, 𝑓𝑥𝑦 = 0 and 𝐷 = 4 × 6 − 02 = 24 for all values of (𝑥, 𝑦).
5 4
Since 𝐷 > 0 and 𝑓𝑥𝑥 > 0, the point ,− is a local minimum (as expected).
4 3
Critical points of surfaces
Example 1 revisited
This result is confirmed by the plot of the gradient field, as all gradient vectors
point outwards, away from the critical point.
Critical points of surfaces
Example 2 revisited
Classify the critical points of 𝑓 𝑥 = 𝑥 2 − 𝑦 2 .
Solution
We found a critical point at 0,0 .
𝜕𝑓 𝜕𝑓
= 𝑓𝑥 = 2𝑥 ; = 𝑓𝑦 = −2𝑦
𝜕𝑥 𝜕𝑦
so 𝑓𝑥𝑥 = 2, 𝑓𝑦𝑦 = −2, 𝑓𝑥𝑦 = 0 and 𝐷 = 2 × −2 − 02 = −4 for all values of (𝑥, 𝑦).
Example 2 revisited
This result is confirmed by the plot of the gradient field, as some gradient vectors
point outwards, away from the critical point, while others point inwards, towards
the critical point.
Critical points of surfaces
Example 3
Classify the critical points of 𝑓 𝑥, 𝑦 = 1 + 4𝑦 2 .
Solution
First we find the critical points:
𝜕𝑓 𝜕𝑓
= 𝑓𝑥 = 0 ; = 𝑓𝑦 = 8𝑦
𝜕𝑥 𝜕𝑦
So setting 𝑓𝑥 = 𝑓𝑦 = 0 we find infinitely many critical points along the line 𝑦 = 0.
We have 𝑓𝑥𝑥 = 0, 𝑓𝑦𝑦 = 8, 𝑓𝑥𝑦 = 0 and 𝐷 = 0 × 8 − 02 = 0 for all values of (𝑥, 𝑦).
Example 3
We can see from the gradient field that all gradient vectors point away from the
line, so each point on this line is a local minimum.
Critical points of surfaces
Example 4
Classify the critical points of 𝑓 𝑥, 𝑦 = 𝑥 3 − 3𝑥𝑦 2 .
Solution
First we find the critical points:
𝜕𝑓 2 2
𝜕𝑓
= 𝑓𝑥 = 3𝑥 − 3𝑦 ; = 𝑓𝑦 = −6𝑥𝑦
𝜕𝑥 𝜕𝑦
So setting 𝑓𝑥 = 𝑓𝑦 = 0 we see that 𝑥 = 𝑦 = 0 so there is a critical point at (0,0).
We have 𝑓𝑥𝑥 = 6𝑥, 𝑓𝑦𝑦 = 6𝑥, 𝑓𝑥𝑦 = −6𝑦 and 𝐷 = 0 × 0 − 02 = 0 at (0,0).
Example 4
This is a strange type of critical point, called a monkey saddle. The contour lines
divide the plane into 3 regions around this point with 𝑓 alternating from positive to
negative as it crosses each line.
MAT6105 Module 3.3
Higher derivatives – Video 3
Global vs local maxima/minima
Dr Julia Collins
Local vs global
So far we have considered local minima and local maxima of curves and
surfaces.
Example
Consider the function 𝑓: ℝ → ℝ
𝑓 𝑥 = 𝑥4
Example
Consider the function 𝑓: [−10,10] → ℝ
global
local
𝑓 𝑥 = 𝑥 cos(𝑥) max
max
local
max
Then 𝑓 has a global max and min local
max
and six local maxima/minima.
local
min
local
min
local
min global
min
Strategy for finding global maximum/minimum
Example
For the function 𝑓: [0, ∞) → ℝ defined by
𝑓 𝑥 = 𝑥𝑒 −𝑥
find and classify all maxima and minima.
Solution
We have 𝑓 ′ 𝑥 = 𝑒 −𝑥 − 𝑥𝑒 −𝑥 = (1 − 𝑥)𝑒 −𝑥
so there is a single critical point at 𝑥 = 1.
When 0 ≤ 𝑥 < 1, 𝑓 ′ 𝑥 > 0, and for 𝑥 > 1, 𝑓 ′ 𝑥 < 0, so this is a local maximum.
At 𝑥 = 0, 𝑓 𝑥 = 0, and as 𝑥 → ∞, 𝑓(𝑥) → 0, So the global min is at 𝑥 = 0 and the
global max is at 𝑥 = 1.
Global vs local extrema for surfaces
The same comparison of local vs global extrema can be done for surfaces as
well as curves.
global
max
local
local
max
max
local
min global
min
Example
Example
2 −𝑥 2 −𝑦 2
For the function on ℝ × ℝ defined by 𝑓 𝑥, 𝑦 = 𝑥 𝑒 find and classify all
extrema.
Solution
First we find the critical points:
𝜕𝑓 2 2 2 2 𝜕𝑓 2 2
= 𝑓𝑥 = 2𝑥𝑒 −𝑥 −𝑦 − 2𝑥 3 𝑒 −𝑥 −𝑦 ; = 𝑓𝑦 = −2𝑥 2 𝑦𝑒 −𝑥 −𝑦
𝜕𝑥 𝜕𝑦
2 −𝑦 2
So setting 𝑓𝑦 = 0 we see that either 𝑥 = 0 or 𝑦 = 0. If 𝑓𝑥 = 2𝑥 1 − 𝑥2 𝑒 −𝑥
=0
then either 𝑥 = 0 or 𝑥 = ±1. Therefore there are 3 critical points: 0, 𝑦 , 1,0 , (−1,0).
Example
2 −𝑥 2 −𝑦 2
For the function on ℝ × ℝ defined by 𝑓 𝑥, 𝑦 = 𝑥 𝑒 find and classify all
extrema.
Solution
You can use MATLAB (!) to check the following:
−𝑥 2 −𝑦 2 2 −𝑥 2 −𝑦 2 4 −𝑥 2 −𝑦 2 −𝑥 2 −𝑦 2
𝑓𝑥𝑥 = 2𝑒 − 10𝑥 𝑒 + 4𝑥 𝑒 = 2𝑒 (1 − 5𝑥 2 + 2𝑥 4 )
2 2 −𝑥 2 −𝑦 2 2 −𝑥 2 −𝑦 2 2 −𝑥 2 −𝑦 2
𝑓𝑦𝑦 = 4𝑥 𝑦 𝑒 − 2𝑥 𝑒 = 2𝑥 𝑒 𝑦2 − 1
3 −𝑥 2 −𝑦 2 −𝑥 2 −𝑦 2 −𝑥 2 −𝑦 2
𝑓𝑥𝑦 = 4𝑥 𝑦𝑒 − 4𝑥𝑦𝑒 = 4𝑥𝑦𝑒 (𝑥 2 − 1)
We now need to evaluate each of these at each critical point.
Example
Example
2 −𝑥 2 −𝑦 2
For the function on ℝ × ℝ defined by 𝑓 𝑥, 𝑦 = 𝑥 𝑒 find and classify all
extrema.
Solution
We see from the analysis that we have two local maxima.
These have the same value and are both global maxima.
The points on the critical line can be seen to be minimum values for the surface.
Critical point (𝒂, 𝒃) 𝒇𝒙𝒙 (𝒂, 𝒃) 𝒇𝒚𝒚 (𝒂, 𝒃) 𝒇𝒙𝒚 (𝒂, 𝒃) 𝑫 Classification
2
(0, 𝑦) 2𝑒 −𝑦 0 0 0 Inconclusive – but points are minima
(1,0) −4𝑒 −1 −2𝑒 −1 0 8𝑒 −2 ≈ 1.08 Local maximum
(−1,0) −4𝑒 −1 −2𝑒 −1 0 8𝑒 −2 ≈ 1.08 Local maximum
Example
The contour plot here also shows the two local maxima which are of equal
height, and the line 𝑥 = 0 which is a local minimum.
𝑥=0
(−1,0) (1,0)
A final warning!