Professional Documents
Culture Documents
Session 2
Partial Derivatives, Differentiability
and Gradients
Contents
Introduction, p 25
2.1 Partial differentiation of n variable functions, p 26
2.2 Differentiation of n variable functions, p 27
2.3 Methods of finding gradient, p 34
Solutions of Activities, p 38
Summary, p 39
Learning Outcomes, p 40
Introduction
In this session, you will learn about partial derivatives and differentiability
of a real-valued function of several variables. You will see that they are not
exactly the same thing.
Definition
Let 𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) be a real-valued function of 𝑛 variables 𝑥1 , 𝑥2 , … , 𝑥𝑛
defined on some open set 𝐷 ⊆ ℝ𝑛 and let 𝒂 = (𝑎1 , 𝑎2 , … , 𝑎𝑛 ) ∈ 𝐷. The
𝜕𝑓
partial derivative of 𝑓 with respect to 𝑥� at 𝒂, denoted by 𝜕𝑥 (𝒂) or 𝑓𝑥� (𝒂),
�
So, when taking the partial derivative of 𝑓 with respect to 𝑥� , just treat all
the remaining variables as constants. In this way you can view the function
𝑓 as a function of the single variable 𝑥� . Then differentiate the function’s
formula with respect to the independent variable 𝑥� .
Then,
𝜕(𝑓𝑔)
1. (𝒂) = 𝑓(𝒂)𝑔𝑥� (𝒂) + 𝑔(𝒂)𝑓𝑥� (𝒂).
𝜕𝑥�
𝑓
𝜕� �
𝑔
𝑔(𝒂)𝑓𝑥� (𝒂)−𝑓(𝒂)𝑔𝑥� (𝒂)
2. (𝒂) = [𝑔(𝒂)]2
provided 𝑔(𝒂) ≠ 0.
𝜕𝑥�
𝜕𝑓 𝑘
1. (𝒂) = 𝑘[𝑓(𝒂)]𝑘−1 𝑓𝑥� (𝒂).
𝜕𝑥�
Note
Recall that for functions of a single variable the existence of the derivative
guarantees continuity. However, for functions of several variables the
existence of partial derivatives fails to guarantee continuity (can you think
why?). For let define 𝑓: ℝ2 → ℝ by
𝑥𝑦
; (𝑥, 𝑦) ≠ (0, 0)
𝑓(𝑥, 𝑦) = � + 𝑦 2
𝑥2 .
0 ; (𝑥, 𝑦) = (0, 0)
Observe that since both 𝑓(𝑥, 0) and 𝑓(0, 𝑦) are constantly zero, both partials
exist (and are zero) at (0, 0). But, 𝑓(𝑥, 𝑦) is discontinuous at (0, 0) (Activity
1.1).
Definition
Let 𝑓 be a function defined on an open set 𝐷 ⊆ ℝ𝑛 and let 𝒙𝟎 ∈ 𝐷. Then 𝑓
is said to be differentiable at 𝒙𝟎 if there exists a linear transformation
𝐿: 𝐷 → ℝ𝑚 such that
Note:
Example 2.1
Let 𝑓: ℝ2 → ℝ defined by 𝑓(𝑥, 𝑦) = sin 𝑥 for all (𝑥, 𝑦) ∈ ℝ2 . Let 𝒙 =
(𝑥0 , 𝑦0 ) ∈ ℝ2 .
Activity 2.1
Let 𝑓 be a real-valued function defined on some open set 𝐷 ⊆ ℝ𝑛 and let 𝒙𝟎 ∈ 𝐷. Let
𝑟 > 0 be such that 𝐵(𝒙𝟎 , 𝑟) ⊆ 𝐷. Prove that 𝑓 is differentiable at 𝒙𝟎 if and only if there
exists a linear transformation 𝑇𝒙𝟎 : ℝ𝑛 → ℝ and a scalar function 𝐸(𝒙𝟎 , 𝒉) such
that 𝑓(𝒙𝟎 + 𝒉) = 𝑓(𝒙𝟎 ) + 𝑇𝒙𝟎 (𝒉) + ‖𝒉‖𝐸(𝒙𝟎 , 𝒉), for ‖𝒉‖ < 𝑟, where 𝐸(𝒙𝟎 , 𝒉) → 0 as
‖𝒉‖ → 0.
Example 2.2
Let 𝑐 = (𝑐1 , 𝑐2 , … , 𝑐𝑛 ) ∈ ℝ𝑛 be a constant. Show that if
𝒄⋅𝒉
lim = 0,
𝒉→𝟎 ‖𝒉‖
then 𝒄 = 𝟎.
Solution
𝒄⋅𝒉
First, observe that the function ‖𝒉‖ is defined for all 𝒉 ≠ 𝟎. Now suppose
𝒄⋅𝒉
𝑙𝑖𝑚 ‖𝒉‖ = 0. Recall that if 𝑙𝑖𝑚 𝑓(𝒙) exists, then 𝑓(𝒙) must approaches the
𝒉→𝟎 𝒙→𝒙𝟎
𝒄⋅𝒉
same limit no matter how 𝒙 approaches 𝒙𝟎 . Thus, in our case, ‖𝒉‖ must
But then
|𝑐1 ||ℎ1 |
lim =0
𝒉→𝟎 |ℎ1 |
or equivalently
lim |𝑐1 | = 0.
𝒉→𝟎
𝑓(𝒙+𝒉)−𝑓(𝒙)−𝒚⋅𝒉 𝑓(𝒙+𝒉)−𝑓(𝒙)−𝒛⋅𝒉
Show that if lim ‖𝒉‖
= 0 and lim ‖𝒉‖
= 0, then 𝒚 =
𝒉→𝟎 𝒉→𝟎
𝒛.
Solution
Notice that
(𝒚 − 𝒛) ⋅ 𝒉 [𝑓(𝒙 + 𝒉) − 𝑓(𝒙) − 𝒛 ⋅ 𝒉] [𝑓(𝒙 + 𝒉) − 𝑓(𝒙) − 𝒚 ⋅ 𝒉]
= − .
‖𝒉‖ ‖𝒉‖ ‖𝒉‖
It is clear from the above problem that if there exists a vector 𝐿(𝒙𝟎 ) such
that
𝑓(𝒙𝟎 + 𝚫𝒙) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝚫𝒙
lim = 0,
𝚫𝒙→𝟎 ‖𝚫𝒙‖
Example 2.4
Find the gradient, ∇𝑓(𝒙), for the function 𝑓(𝑥, 𝑦) = 𝑥 2 − 𝑦 2 using the
definition.
Solution
We will prove that gradient of 𝑓 at (𝑥, 𝑦) is (2𝑥, −2𝑦). To this end we need
to show that
𝑓(𝒙 + ∆𝒙) − 𝑓(𝒙) − (2𝑥, −2𝑦) ⋅ ∆𝒙
lim = 0.
∆𝒙→𝟎 ‖∆𝒙‖
Let
𝑓(𝒙 + ∆𝒙) − 𝑓(𝒙) − (2𝑥, −2𝑦) ⋅ ∆𝒙
𝑔(∆𝒙) =
‖∆𝒙‖
Example 2.5
Show that (𝑦 + 1, 𝑥 + 1, 4𝑧) is ∇𝑓(𝒙), for the function 𝑓(𝑥, 𝑦, 𝑧) = 𝑥𝑦 +
2𝑧 2 + 𝑥 + 𝑦 using the definition.
Solution
We will prove that gradient of 𝑓 at (𝑥, 𝑦, 𝑧) is (𝑦 + 1, 𝑥 + 1, 4𝑧).
𝜖
Let 𝜖 > 0. Put 𝛿 = . Let (∆𝑥, ∆𝑦, ∆𝑧) ∈ Domn(𝑔) and suppose 0 <
3
Observe that
|𝑔(∆𝑥, ∆𝑦, ∆𝑧) − 0|
(𝑥+∆𝑥)(𝑦+∆𝑦)+2(𝑧+∆𝑧)2 +(𝑥+∆𝑥)+(𝑦+∆𝑦)−𝑥𝑦−2𝑧 2 −𝑥−𝑦−(𝑦+1,𝑥+1,4𝑧)⋅(∆𝑥,∆𝑦,∆𝑧)
=� �
�(∆𝑥)2 +(∆𝑦)2 +(∆𝑧)2
|∆𝑥∆𝑦 + 2(∆𝑧)2 |
=
�(∆𝑥)2 + (∆𝑦)2 + (∆𝑧)2
|∆𝑥||∆𝑦| + 2(∆𝑧)2
≤
�(∆𝑥)2 + (∆𝑦)2 + (∆𝑧)2
34
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients
Theorem 2.1
Theorem 2.2
The converse of Theorem 2.1 is not always true. There are differentiable
functions with discontinuous first-order partials. We will see, however, that
differentiability implies the existence of first-order partial derivatives.
Example 2.6
Find ∇𝑓 for 𝑓(𝑥, 𝑦) = 𝑥 2 𝑒 𝑦 + 𝑦 2 𝑒 𝑥 .
Solution
Clearly 𝑓 is defined for each (𝑥, 𝑦) ∈ ℝ2 .
𝜕𝑓 𝜕𝑓
Also, 𝜕𝑥 = 2𝑥𝑒 𝑦 + 𝑦 2 𝑒 𝑥 and 𝜕𝑦
= 𝑥 2 𝑒 𝑦 + 2𝑦𝑒 𝑥 are continuous at each
Example 2.7
Find ∇𝑓 for 𝑓(𝑥, 𝑦, 𝑧) = cos(𝑥 2 𝑦𝑧 3 ) + 𝑥𝑦𝑧.
Solution
Clearly 𝑓 is defined for each (𝑥, 𝑦, 𝑧) ∈ ℝ3 .
Also,
𝜕𝑓
= −2𝑥𝑦𝑧 3 sin(𝑥 2 𝑦𝑧 3 ) + 𝑦𝑧,
𝜕𝑥
𝜕𝑓
= −𝑥 2 𝑧 3 sin(𝑥 2 𝑦𝑧 3 ) + 𝑥𝑧 and
𝜕𝑦
𝜕𝑓
= −3𝑥 2 𝑦𝑧 2 sin(𝑥 2 𝑦𝑧 3 ) + 𝑥𝑦
𝜕𝑧
Example 2.8
Let 𝑓 be the function defined by 𝑓(𝑥, 𝑦, 𝑧) = 𝑥 cos(𝜋𝑦) − 𝑦 sin(𝜋𝑧).
Evaluate ∇𝑓 at (0, 1, −1).
Solution
Notice that 𝑓 is differentiable on ℝ3 and
∇𝑓(𝑥, 𝑦, 𝑧) = (cos(𝜋𝑦), −𝜋𝑥 sin(𝜋𝑦) − sin(𝜋𝑧), −𝜋𝑦 cos(𝜋𝑧)).
Therefore
∇𝑓(0, 1, −1) = (cos 𝜋 , sin 𝜋 , −𝜋 cos 𝜋) = (−1, 0, 𝜋).
Theorem 2.3
Theorem 2.4
Definition
In the above definition suppose ‖𝒚‖ = 1 and
𝑓(𝒙𝟎 + ℎ𝒚) − 𝑓(𝒙𝟎 )
𝑓 � (𝒙𝟎 , 𝒚) = lim
ℎ→0 ℎ
Remark
i.e. 𝑘th coordinate of 𝒆𝒌 is equal to 1 and all the other coordinates are equal
to 0. Then, 𝑓 � (𝒙𝟎 , 𝒆𝒌 ), if exists, is the partial derivative of 𝑓 with respect to
𝑥𝑘 at 𝒙𝟎 .
Remark
𝑓 � (𝒙𝟎 , 𝒚), where ‖𝒚‖ = 1, gives the rate of change of 𝑓at 𝒙𝟎 in the direction
of 𝒚.
Theorem 2.5
Theorem 2.6
38
Unit 1: Continuity & Differentiability of Functions of Several Variables
got the same formula for ∇𝑓(𝒙𝟎 ) provided that the function 𝑓 satisfies the
hypothesis in Theorem 2.1.
Solutions of Activities
Activity 2.1
For each 𝒙 ∈ ℝ𝑛 , define 𝑇𝒙𝟎 : ℝ𝑛 → ℝ by 𝑇𝒙𝟎 (𝒙) = 𝐿(𝒙𝟎 ) ⋅ 𝒙.It can be easily verified that
𝑇𝒙𝟎 is a linear transformation.
Also, for each 𝒉 ∈ ℝ𝑛 such that ‖𝒉‖ < 𝑟, define 𝐸(𝒙𝟎 , 𝒉): 𝐵(𝟎, 𝑟) → ℝ by
𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝒉
𝑖𝑓 𝒉 ≠ 𝟎
𝐸(𝒙𝟎 , 𝒉) = � ‖𝒉‖ .
0 𝑖𝑓 𝒉 = 𝟎
Notice that for each 𝒉 ∈ 𝐵(𝟎, 𝑟) ∖ {𝟎}, 𝑓(𝒙𝟎 + 𝒉) = 𝑓(𝒙𝟎 ) + 𝐿(𝒙𝟎 ) ⋅ 𝒉 + ‖𝒉‖𝐸(𝒙𝟎 , 𝒉) =
𝑓(𝒙𝟎 ) + 𝑇𝒙𝟎 (𝒉) + ‖𝒉‖𝐸(𝒙𝟎 , 𝒉) and for 𝒉 = 𝟎, 𝑓(𝒙𝟎 + 𝒉) = 𝑓(𝒙𝟎 ) = 𝑓(𝒙𝟎 ) + 𝑇𝒙𝟎 (𝟎) +
‖𝟎‖𝐸(𝒙𝟎 , 𝟎). Therefore, for each 𝒉 ∈ 𝐵(𝟎, 𝑟), 𝑓(𝒙𝟎 + 𝒉) = 𝑓(𝒙𝟎 ) + 𝑇𝒙𝟎 (𝒉) + ‖𝒉‖𝐸(𝒙𝟎 , 𝒉).
Moreover,
𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝒉
lim 𝐸(𝒙𝟎 , 𝒉) = lim � � = 0.
𝒉→𝟎 𝒉→𝟎 ‖𝒉‖
Conversely suppose that there exists a linear transformation 𝑇𝒙𝟎 : ℝ𝑛 → ℝ and a scalar
function 𝐸(𝒙𝟎 , 𝒉) such that 𝑓(𝒙𝟎 + 𝒉) = 𝑓(𝒙𝟎 ) + 𝑇𝒙𝟎 (𝒉) + ‖𝒉‖𝐸(𝒙𝟎 , 𝒉) for ‖𝒉‖ < 𝑟, where
𝐸(𝒙𝟎 , 𝒉) → 0 as ‖𝒉‖ → 0.
39
Unit 1: Continuity & Differentiability of Functions of Several Variables
Let 𝐿: 𝐷 → ℝ𝑛 be the constant function 𝐿(𝒙) = �𝑇𝒙𝟎 (𝒆𝟏 ), … , 𝑇𝒙𝟎 (𝒆𝒏 )�, where for each 𝑖 =
Notice that
𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝒉 = 𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − ��𝑇𝒙𝟎 (𝒆𝟏 ), … , 𝑇𝒙𝟎 (𝒆𝒏 )� ⋅ (ℎ1 , … , ℎ𝑛 )�
Thus,
𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝒉 �𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝑇𝒙𝟎 (𝒉)�
lim = lim
𝒉→𝟎 ‖𝒉‖ 𝒉→𝟎 ‖𝒉‖
= lim 𝐸(𝒙𝟎 , 𝒉) = 0 (how? ).
𝒉→𝟎
Therefore 𝑓 is differentiable at 𝒙𝟎 .
Summary
40
Unit 1: Continuity & Differentiability of Functions of Several Variables
41