Chapter 4 Partial Derivatives Script SS 2022 - Orrected New
Chapter 4 Partial Derivatives Script SS 2022 - Orrected New
Chapter 4 Partial Derivatives Script SS 2022 - Orrected New
In the following we will be using the notation 𝑓𝑓(𝑥𝑥1 , 𝑥𝑥2 , … , 𝑥𝑥𝑛𝑛 ) or 𝑓𝑓(𝑥𝑥, 𝑦𝑦, 𝑧𝑧, … ) to denote such
functions.
Example 1:
The functions 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = 2𝑥𝑥 2 𝑦𝑦 3 and 𝑓𝑓(𝑥𝑥, 𝑦𝑦, 𝑧𝑧) = 3𝑥𝑥 3 𝑦𝑦 5 𝑧𝑧 + 𝑥𝑥 2 𝑧𝑧 4 are functions in two and
three variables respectively.
Partial Derivatives:
In chapter 2 we introduced the derivatives for functions in one variable. For a function 𝑦𝑦 =
𝑓𝑓(𝑥𝑥) we derived the function 𝑓𝑓’(𝑥𝑥) as the first derivative of 𝑓𝑓(𝑥𝑥). This was interpreted as the
rate of change of the function as 𝑥𝑥 changes. We saw also that the derivative at any point 𝑥𝑥0 is
given by
𝑓𝑓(𝑥𝑥0 + ℎ) − 𝑓𝑓(𝑥𝑥0 )
𝑓𝑓’(𝑥𝑥0 ) = lim
ℎ→0 ℎ
For functions with more than one variable the problem is we have more than one variable.
However we if we are interested in evaluating the rate of change of the function with respect
to this variable while keeping all other variables constant (fixed). In this section we will
develop procedures to evaluate such rates of change (partial derivatives)
To illustrate this, let us start with an example: Consider the function (𝑥𝑥, 𝑦𝑦) = 2𝑥𝑥 2 𝑦𝑦 3 , let us
determine the rate of change of the function at a point (𝑎𝑎, 𝑏𝑏) if we hold y fixed and allow x to
vary. This means that the value of 𝑦𝑦 will always be equal to 𝑏𝑏, so we can write the function as
a function 𝑔𝑔(𝑥𝑥) in one variable as
1
𝑓𝑓𝑥𝑥 (𝑎𝑎, 𝑏𝑏) = 𝑔𝑔′ (𝑎𝑎) = 4𝑥𝑥𝑏𝑏 3
In a similar way, keeping 𝑥𝑥 fixed and allowing 𝑦𝑦 varying, we can evaluate the partial
∂𝑓𝑓
derivative of 𝑓𝑓(𝑥𝑥, 𝑦𝑦) with respect to 𝑦𝑦 (Notation: 𝑓𝑓𝑦𝑦 or ∂y ) at (𝑎𝑎, 𝑏𝑏) as
𝑓𝑓𝑦𝑦 (𝑎𝑎, 𝑏𝑏) = 6𝑎𝑎2 𝑦𝑦 2
These derivatives are also called first order partial derivatives of 𝑓𝑓(𝑥𝑥, 𝑦𝑦).
Given a function 𝑓𝑓(𝑥𝑥, 𝑦𝑦, 𝑧𝑧, … ) with multi variables As we can think of a partial derivative of a
multi variable function with respect to one of the variables as a function in one variable we
evaluate the derivatives as the limits:
and
More Notations:
For the function 𝑓𝑓(𝑥𝑥, 𝑦𝑦) usually the following notation will be used
∂𝑓𝑓 ∂
𝑓𝑓𝑥𝑥 , 𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦), ∂x or ∂x
𝑓𝑓(𝑥𝑥, 𝑦𝑦)
∂𝑓𝑓 ∂
𝑓𝑓𝑦𝑦 , 𝑓𝑓𝑦𝑦 (𝑥𝑥, 𝑦𝑦), ∂y or ∂y 𝑓𝑓(𝑥𝑥, 𝑦𝑦)
Before we proceed to the examples, keep in mind that all variables, other than the one we are
differentiating with respect to, are treated as constants while differentiating as we did for the
one variable functions.
Example 2:
Find all of the first order partial derivatives for the following functions.
1. 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = 𝑥𝑥 2 𝑦𝑦 3
2
2. 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = 𝑥𝑥 4 + 6�𝑦𝑦 − 10
3. 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = 2𝑥𝑥 3 + 𝑥𝑥 2 𝑦𝑦 − 4𝑥𝑥𝑦𝑦 2 − 𝑒𝑒 𝑥𝑥 + 𝑙𝑙𝑙𝑙(𝑦𝑦)
4. 𝑓𝑓(𝑥𝑥, 𝑦𝑦, 𝑧𝑧) = 𝑥𝑥 2 𝑦𝑦 − 10𝑦𝑦 2 𝑧𝑧 3 + 43𝑥𝑥 − 7 tan(4𝑦𝑦)
Solution:
1. 𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = 2𝑥𝑥𝑦𝑦 3
𝑓𝑓𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = 3𝑥𝑥 2 𝑦𝑦 2
2. 𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = 4𝑥𝑥 3
3
𝑓𝑓𝑦𝑦 (𝑥𝑥, 𝑦𝑦) =
�𝑦𝑦
3. 𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = 6𝑥𝑥 2 + 2𝑥𝑥𝑥𝑥 − 4𝑦𝑦 2 − 𝑒𝑒 𝑥𝑥
1
𝑓𝑓𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = 𝑥𝑥 2 − 8𝑥𝑥𝑥𝑥 +
𝑦𝑦
4. 𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦, 𝑧𝑧) = 2𝑥𝑥𝑥𝑥 + 43
As in the one variable functions, we can differentiate the first order partial derivatives further
to get second order, third order,…etc. derivatives. However, there is a major difference here;
for each of the first order derivative we can differentiate further with respect to any of the
variables.
For example if 𝑓𝑓 is a function with two variables 𝑓𝑓(𝑥𝑥, 𝑦𝑦), there will be 2𝑛𝑛 possibilities for
each higher order derivative, where 𝑛𝑛 is the order. So there are 4 second order derivatives
since each first order derivative could be differentiated further with respect to either 𝑥𝑥 or 𝑦𝑦.
We will use the notation
∂2 𝑓𝑓 ∂ ∂
𝑓𝑓𝑥𝑥𝑥𝑥 , 𝑓𝑓𝑥𝑥𝑥𝑥 (𝑥𝑥, 𝑦𝑦), ∂x2 = ∂x (∂x)
∂2 𝑓𝑓 ∂ ∂
𝑓𝑓𝑥𝑥𝑥𝑥 , 𝑓𝑓𝑥𝑥𝑥𝑥 (𝑥𝑥, 𝑦𝑦), = ( )
∂yx ∂y ∂x
∂2 𝑓𝑓 ∂ ∂
𝑓𝑓𝑦𝑦𝑦𝑦 , 𝑓𝑓𝑦𝑦𝑦𝑦 (𝑥𝑥, 𝑦𝑦), ∂y2 = ∂y (∂y)
∂2 𝑓𝑓 ∂ ∂
𝑓𝑓𝑦𝑦𝑦𝑦 , 𝑓𝑓𝑦𝑦𝑦𝑦 (𝑥𝑥, 𝑦𝑦), = ( )
∂xy ∂x ∂y
to represent those 4 partial derivatives.
Important note:
• When using the notation 𝑓𝑓𝑥𝑥𝑥𝑥 for higher order derivatives, we start evaluating the
derivatives from left to right.
∂2 𝑓𝑓 ∂ ∂
• When using the ∂yx = ∂y (∂x) notation, we start evaluating from right to left.
3
Example 3:
Find all 2nd order partial derivatives of 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = 𝑥𝑥 2 𝑦𝑦 3
Solution:
∂ ∂
The 1st order derivatives are: 𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = ∂x 𝑓𝑓 = 2𝑥𝑥𝑦𝑦 3 and 𝑓𝑓𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = ∂y 𝑓𝑓 = 3𝑥𝑥 2 𝑦𝑦 2
If we differentiate 𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = 2𝑥𝑥𝑦𝑦 3 further with respect to both variables (x and y), we get
∂2 𝑓𝑓
𝑓𝑓𝑥𝑥𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = 2 = 2𝑦𝑦 3
∂x
∂2 𝑓𝑓
𝑓𝑓𝑥𝑥𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = = 6𝑥𝑥𝑦𝑦 2
∂yx
Differentiating 𝑓𝑓𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = 3𝑥𝑥 2 𝑦𝑦 2 further with respect x and y we get
∂2 𝑓𝑓
𝑓𝑓𝑦𝑦𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = = 6𝑥𝑥𝑦𝑦 2
∂yx
∂2 𝑓𝑓
𝑓𝑓𝑦𝑦𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = 2 = 6𝑥𝑥 2 𝑦𝑦
∂y
The derivatives 𝑓𝑓𝑥𝑥𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = 6𝑥𝑥𝑦𝑦 2 and 𝑓𝑓𝑦𝑦𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = 6𝑥𝑥𝑦𝑦 2 are called mixed derivatives. In
this example they are equal, however this is in general not always true as we will see later
in this section.
Example 4:
Find all 2nd order partial derivatives of 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = sin(𝑥𝑥) 𝑦𝑦 2
Solution:
The 1st order derivatives are:
∂ ∂
𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = ∂x 𝑓𝑓 = cos(𝑥𝑥) 𝑦𝑦 2 and 𝑓𝑓𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = ∂y 𝑓𝑓 = 2sin(𝑥𝑥) 𝑦𝑦
∂2 𝑓𝑓
𝑓𝑓𝑥𝑥𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = = +1
∂yx
∂2 𝑓𝑓
𝑓𝑓𝑦𝑦𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = = −1
∂yx
(You might check wikipedia.org for a reasonable explanation!)
In a similar way we can differentiate further to get the 3rd order, 4th order, 5th order derivatives
∂5 𝑓𝑓
and so on…; for example the 5th order derivatives 𝑓𝑓𝑥𝑥𝑥𝑥𝑥𝑥𝑥𝑥𝑥𝑥 = 𝑓𝑓𝑥𝑥𝑥𝑥𝑥𝑥𝑥𝑥𝑥𝑥 (𝑥𝑥, 𝑦𝑦, 𝑧𝑧) = ∂y2 zyx
5
∂f
⎡ ⎤
⎢∂x⎥ 𝑓𝑓𝑥𝑥
∂f
⎢ ⎥ 𝑓𝑓
∇𝑓𝑓 = ⎢∂y⎥ = � 𝑦𝑦 �
𝑓𝑓𝑧𝑧
⎢ ∂f ⎥
⋮
⎢∂z ⎥
⎣⋮⎦
Example 6:
The gradient of the function in example 4 is
cos(𝑥𝑥) 𝑦𝑦 2
∇𝑓𝑓 = � �
2sin(𝑥𝑥) 𝑦𝑦
Example 7:
The gradient of the function 𝑓𝑓(𝑥𝑥, 𝑦𝑦, 𝑧𝑧) = 𝑥𝑥 − 𝑥𝑥𝑥𝑥 + 𝑧𝑧 2 is
∂f
⎡ ⎤
⎢∂x⎥ 1 − 𝑦𝑦
⎢ ∂f ⎥
∇𝑓𝑓 = ⎢ ⎥ = � −𝑥𝑥 �
∂y
⎢ ⎥ 2𝑧𝑧
⎢ ∂f ⎥
⎣∂z ⎦
Hessian’s Matrix:
If 𝑓𝑓(𝑥𝑥1 , 𝑥𝑥2 , … , 𝑥𝑥𝑛𝑛 ) is differentiable twice, then the Hessian’s matrix 𝐻𝐻(𝑥𝑥) of 𝑓𝑓 is given by:
𝑓𝑓𝑥𝑥1 𝑥𝑥1 ⋯ 𝑓𝑓𝑥𝑥1 𝑥𝑥𝑛𝑛
𝐻𝐻(𝑥𝑥) = � ⋮ ⋱ ⋮ �
𝑓𝑓𝑥𝑥𝑛𝑛𝑥𝑥1 ⋯ 𝑓𝑓𝑥𝑥𝑛𝑛𝑥𝑥𝑛𝑛
Example 8:
The Hessian’s matrix of the function in example 4 is
−sin(𝑥𝑥) 𝑦𝑦 2 2 cos(𝑥𝑥) 𝑦𝑦
H(x) = � �
2 cos(𝑥𝑥) 𝑦𝑦 2 sin(𝑥𝑥)
Example 9:
Determine the Hessian’s matrix of the function 𝑓𝑓(𝑥𝑥1 , 𝑥𝑥2 , 𝑥𝑥3 ) = 𝑥𝑥13 + 𝑥𝑥22 𝑥𝑥3 + 𝑥𝑥3
Solution:
𝑓𝑓𝑥𝑥1 = 3𝑥𝑥12
𝑓𝑓𝑥𝑥2 = 2𝑥𝑥2 𝑥𝑥3
𝑓𝑓𝑥𝑥3 = 𝑥𝑥22 + 1
2nd order derivatives:
6
𝑓𝑓𝑥𝑥1 𝑥𝑥1 = 6𝑥𝑥1 , 𝑓𝑓𝑥𝑥1 𝑥𝑥2 = 0, 𝑓𝑓𝑥𝑥1 𝑥𝑥3 = 0
𝑓𝑓𝑥𝑥2 𝑥𝑥1 = 0, 𝑓𝑓𝑥𝑥2 𝑥𝑥2 = 2𝑥𝑥3 , 𝑓𝑓𝑥𝑥2 𝑥𝑥3 = 2𝑥𝑥2
𝑓𝑓𝑥𝑥3 𝑥𝑥1 = 0, 𝑓𝑓𝑥𝑥3 𝑥𝑥2 = 2𝑥𝑥2 , 𝑓𝑓𝑥𝑥3 𝑥𝑥3 = 0
Example 10:
Evaluate all of the 1st order partial derivatives for each of the functions:
9𝑥𝑥
1. 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = 𝑥𝑥 2 +5𝑦𝑦
𝑥𝑥 sin 𝑦𝑦
2. 𝑓𝑓(𝑥𝑥, 𝑦𝑦, 𝑧𝑧) = 𝑧𝑧 2
3. 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = �𝑥𝑥 2 + ln(5𝑥𝑥 − 3𝑦𝑦 2
Solution:
9𝑥𝑥
1. 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = 𝑥𝑥 2 +5𝑦𝑦, here we need to apply the quotient rule since we have x both in the
nominator and denominator
9�𝑥𝑥 2 +5𝑦𝑦�−9𝑥𝑥(2𝑥𝑥) 9�𝑥𝑥 2 +5𝑦𝑦�−18𝑥𝑥 2 9𝑥𝑥 2 +45𝑦𝑦−18𝑥𝑥 2 −9𝑥𝑥 2 +45𝑦𝑦
𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = (𝑥𝑥 2 +5𝑦𝑦)2
= (𝑥𝑥 2 +5𝑦𝑦)2
= (𝑥𝑥 2 +5𝑦𝑦)2
= (𝑥𝑥 2 +5𝑦𝑦)2
0�𝑥𝑥 2 +5𝑦𝑦�−9𝑥𝑥(5) −45𝑥𝑥
and 𝑓𝑓𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = (𝑥𝑥 2 +5𝑦𝑦)2
= (𝑥𝑥 2 +5𝑦𝑦)2
𝑥𝑥 sin 𝑦𝑦
2. 𝑓𝑓(𝑥𝑥, 𝑦𝑦, 𝑧𝑧) = 𝑧𝑧 2
= 𝑥𝑥 (sin 𝑦𝑦)𝑧𝑧 −2 , so there is no need for the quotient rule!
sin 𝑦𝑦
𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦, 𝑧𝑧) = (sin 𝑦𝑦)𝑧𝑧 −2 = 2
𝑧𝑧
−2
𝑥𝑥 cos 𝑦𝑦
𝑓𝑓𝑦𝑦 (𝑥𝑥, 𝑦𝑦, 𝑧𝑧) = 𝑥𝑥 (cos 𝑦𝑦)𝑧𝑧 =
𝑧𝑧 2
−2𝑥𝑥 sin 𝑦𝑦
𝑓𝑓𝑧𝑧 (𝑥𝑥, 𝑦𝑦, 𝑧𝑧) = −2𝑥𝑥 (sin 𝑦𝑦)𝑧𝑧 −3 =
𝑧𝑧 3
1
3. 𝑓𝑓(𝑥𝑥, 𝑦𝑦) = �𝑥𝑥 2 + ln(5𝑥𝑥 − 3𝑦𝑦 2 ) = (𝑥𝑥 2 + ln(5𝑥𝑥 − 3𝑦𝑦 2 ))2
1 1 ∂𝑓𝑓
𝑓𝑓𝑥𝑥 (𝑥𝑥, 𝑦𝑦) = (𝑥𝑥 2 + ln(5𝑥𝑥 − 3𝑦𝑦 2 ))−2 ((𝑥𝑥 2 + ln(5𝑥𝑥 − 3𝑦𝑦 2 ))
2 ∂x
1 2 1 5
= (𝑥𝑥 + ln(5𝑥𝑥 − 3𝑦𝑦 2 ))−2 �2𝑥𝑥 + �
2 5𝑥𝑥 − 3𝑦𝑦 2
7
1 2 1 ∂𝑓𝑓
𝑓𝑓𝑦𝑦 (𝑥𝑥, 𝑦𝑦) = (𝑥𝑥 + ln(5𝑥𝑥 − 3𝑦𝑦 2 ))−2 ((𝑥𝑥 2 + ln(5𝑥𝑥 − 3𝑦𝑦 2 ))
2 ∂y
1 2 1 −6𝑦𝑦
= (𝑥𝑥 + ln(5𝑥𝑥 − 3𝑦𝑦 2 ))−2 �0 + �
2 5𝑥𝑥 − 3𝑦𝑦 2
−3𝑦𝑦 2 2 −2
1
=� � (𝑥𝑥 + ln (5𝑥𝑥 − 3𝑦𝑦 ))
5𝑥𝑥 − 3𝑦𝑦 2