You are on page 1of 16

Unit 1: Continuity & Differentiability of Functions of Several Variables

MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

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.

With each differentiable function, there associated a vector called gradient.


The gradient is used extensively when finding extreme values of a function.
They are discussed in subsequent sessions.

To understand how the changes in the independent variables affect the


dependent variable in a multivariable function, we need an analog for the
ordinary derivative. This leads us to our first definition in this session.

Copyright © 2018, The Open University of Sri Lanka


26
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

2.1 Partial differentiation of n variable functions

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 𝑓𝑥� (𝒂),

is said to be exist if the limit


𝑓�𝑎1 , … , 𝑎� + ℎ, … , 𝑎𝑛 � − 𝑓(𝑎1 , … , 𝑎� , … , 𝑎𝑛 )
lim exists.
ℎ→0 ℎ

Moreover, the value of the derivative is defined as


𝜕𝑓 𝑓�𝑎1 , … , 𝑎� + ℎ, … , 𝑎𝑛 � − 𝑓(𝑎1 , … , 𝑎� , … , 𝑎𝑛 )
(𝑎) = lim .
𝜕𝑥� ℎ→0 ℎ

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 𝑥� .

Partial derivatives follow the same rules pertaining to the ordinary


derivatives, except the chain rule. Chain rule will be discussed in a latter
session and for now, we list some of the other rules.

Let 𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) and 𝑔(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) be two real-valued functions


defined on an open set 𝐷 ⊆ ℝ𝑛 . Suppose 𝑓, 𝑔 have first order partial
derivatives with respect to 𝑥� at 𝒂 ∈ 𝐷.

Then,
𝜕(𝑓𝑔)
1. (𝒂) = 𝑓(𝒂)𝑔𝑥� (𝒂) + 𝑔(𝒂)𝑓𝑥� (𝒂).
𝜕𝑥�

𝑓
𝜕� �
𝑔
𝑔(𝒂)𝑓𝑥� (𝒂)−𝑓(𝒂)𝑔𝑥� (𝒂)
2. (𝒂) = [𝑔(𝒂)]2
provided 𝑔(𝒂) ≠ 0.
𝜕𝑥�

Copyright © 2018, The Open University of Sri Lanka


27
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

𝜕𝑓 𝑘
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).

However, as we shall see later, if 𝑓 is differentiable at 𝒙𝟎 ∈ ℝ𝑛 , then 𝑓 is


continuous at 𝒙𝟎 .

2.2 Differentiation of n variable functions

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

𝑓(𝒙𝟎 + 𝚫𝒙) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝚫𝒙


lim = 0.
𝚫𝒙→𝟎 ‖𝚫𝒙‖

Here, ‖⋅‖ is defined as ‖𝒙‖ = 𝑑(𝒙, 𝟎) for all 𝒙 ∈ ℝ𝑛 , where 𝟎 =


(0, … , 0) ∈ ℝ𝑛 . Also, for all 𝒂 = (𝑎1 , 𝑎2 , … , 𝑎𝑛 ), 𝒃 = (𝑏1 , 𝑏2 , … , 𝑏𝑛 ) ∈ ℝ𝑛 ,
𝒂 ⋅ 𝒃stands for the usual dot product, i.e. 𝒂 ⋅ 𝒃 = ∑𝑛𝑖=1 𝑎𝑖 𝑏𝑖 . Moreover, the
derivative of 𝑓 at 𝒙𝟎 is denoted by 𝑓 � (𝒙𝟎 ) and is defined as the

Copyright © 2018, The Open University of Sri Lanka


28
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

vector value of 𝐿(𝒙𝟎 ). 𝑓 is said to be differentiable on 𝐷 if 𝑓 is


differentiable at each point in 𝐷.

In the above definition,

𝑓(𝒙𝟎 + 𝚫𝒙) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝚫𝒙


lim =0
𝚫𝒙→𝟎 ‖𝚫𝒙‖

is equivalent to saying that 𝑓(𝒙𝟎 + 𝚫𝒙) = 𝑓(𝒙𝟎 ) + 𝐿(𝒙𝟎 ) ⋅ 𝚫𝒙 +


𝑜(𝚫𝒙) 𝑎𝑠 𝚫𝒙 → 𝟎 (for a real-valued function 𝑔 defined at least on an open
ball 𝐵(𝟎, 𝑟) in ℝ𝑛 except possibly at 𝟎, we write 𝑔(𝒙) = 𝑜(𝒙) 𝑎𝑠 𝒙 →
𝑔(𝒙)
𝟎 and say 𝑔(𝒙) is little oh of 𝒙 if lim = 0). Also, one may write it as
𝒙→𝟎 ‖𝒙‖

𝑓(𝒙𝟎 + 𝚫𝒙) = 𝑓(𝒙𝟎 ) + 𝐿(𝒙𝟎 ) ⋅ 𝚫𝒙 + 𝑜(‖𝚫𝒙‖) 𝑎𝑠 𝚫𝒙 → 𝟎 since 𝑔(𝒙) =


𝑜(𝒙) and 𝑔(𝒙) = 𝑜(‖𝒙‖) mean same thing.

Note:

In the theory of functions of a single variable, differentiability was discussed


for points in an open interval. Here also, whenever we say that 𝑓 is
differentiable at a point 𝒙, you should be understood that 𝒙 is an interior
point of Domn(𝑓).

Definition of Linear transformation in ℝ𝒏


The linear transformation 𝑇𝒙𝟎 : ℝ𝑛 → ℝ, defined by 𝑇𝒙𝟎 (𝒙) = 𝐿(𝒙𝟎 ) ⋅ 𝒙 for
each 𝒙 ∈ ℝ𝑛 , is called the total derivative of 𝑓 at 𝒙𝟎 , where 𝐿(𝑥0 ) is given
in definition 2.2.

Example 2.1
Let 𝑓: ℝ2 → ℝ defined by 𝑓(𝑥, 𝑦) = sin 𝑥 for all (𝑥, 𝑦) ∈ ℝ2 . Let 𝒙 =
(𝑥0 , 𝑦0 ) ∈ ℝ2 .

Copyright © 2018, The Open University of Sri Lanka


29
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

Define 𝐿: ℝ2 → ℝ by 𝐿(𝑥, 𝑦) = (cos 𝑥0 ). 𝑥 for all (𝑥, 𝑦) ∈ ℝ2


Then
𝑓(𝑥0 + ∆𝑥) − 𝑓(𝑥0 ) − 𝐿(𝑥0 ). ∆𝑥
lim
∆𝑥→0 ‖∆𝑥‖
sin(𝑥0 + ∆𝑥) − sin 𝑥0 − (cos 𝑥0 )𝑥0 . ∆𝑥
= lim
∆𝑥→0 ‖∆𝑥‖
=0
Hence, f is differentiable at (𝑥0 , 𝑦0 ) at the total derivative of 𝑓 at 𝑥0 =
𝑇𝑥0 (𝑥) = 𝐿(𝑥0 ). 𝑥 = (cos 𝑥0 ). 𝑥

Important: The total derivative 𝑇𝒙𝟎 of 𝑓 at 𝒙𝟎 is a linear transformation and


is not a number. The function value 𝑇𝒙𝟎 (𝒙) is however a real number and
𝑇𝒙𝟎 is defined for each 𝒙 ∈ ℝ𝑛 .

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 𝒄 = 𝟎.

Copyright © 2018, The Open University of Sri Lanka


30
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

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

approaches 0 no matter how 𝒉 approaches 𝟎.


So, let us first assume that 𝒉 has the form 𝒉 = (ℎ1 , 0,0, … ,0), where ℎ1 ∈
ℝ ∖ {0} (think for example about three variable case).
Then
𝒄 ⋅ 𝒉 (𝑐1 , 𝑐2 , … , 𝑐𝑛 ) ⋅ (ℎ1 , 0, … , 0) 𝑐1 ℎ1
= = .
‖𝒉‖ ‖𝒉‖ |ℎ1 |

Now, it follows that


𝑐1 ℎ1
lim = 0.
𝒉→𝟎 |ℎ1 |

But then
|𝑐1 ||ℎ1 |
lim =0
𝒉→𝟎 |ℎ1 |

or equivalently
lim |𝑐1 | = 0.
𝒉→𝟎

As a result 𝑐1 = 0 (being a constant).


In a similar way we can show that for each 𝑖 = 2, … , 𝑛, 𝑐𝑖 = 0.
Therefore 𝒄 = 𝟎.
Example 2.3
Let 𝑓 be a real-valued function defined on some open ball 𝐵(𝒙, 𝑟) ⊆ ℝ𝑛 and
let 𝒚, 𝒛 be two constants in ℝ𝑛 .

𝑓(𝒙+𝒉)−𝑓(𝒙)−𝒚⋅𝒉 𝑓(𝒙+𝒉)−𝑓(𝒙)−𝒛⋅𝒉
Show that if lim ‖𝒉‖
= 0 and lim ‖𝒉‖
= 0, then 𝒚 =
𝒉→𝟎 𝒉→𝟎

𝒛.

Copyright © 2018, The Open University of Sri Lanka


31
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

Solution
Notice that
(𝒚 − 𝒛) ⋅ 𝒉 [𝑓(𝒙 + 𝒉) − 𝑓(𝒙) − 𝒛 ⋅ 𝒉] [𝑓(𝒙 + 𝒉) − 𝑓(𝒙) − 𝒚 ⋅ 𝒉]
= − .
‖𝒉‖ ‖𝒉‖ ‖𝒉‖

By taking limits of both sides as 𝒉 → 𝟎 we get,

[𝑓(𝒙 + 𝒉) − 𝑓(𝒙) − 𝒛 ⋅ 𝒉] [𝑓(𝒙 + 𝒉) − 𝑓(𝒙) − 𝒚 ⋅ 𝒉]


lim = lim � − �
𝒉→𝟎 𝒉→𝟎 ‖𝒉‖ ‖𝒉‖

[𝑓(𝒙 + 𝒉) − 𝑓(𝒙) − 𝒛 ⋅ 𝒉] [𝑓(𝒙 + 𝒉) − 𝑓(𝒙) − 𝒚 ⋅ 𝒉]


= lim − lim
𝒉→𝟎 ‖𝒉‖ 𝒉→𝟎 ‖𝒉‖
= 0−0
=0

Thus, by previous problem 𝒚 − 𝒛 = 𝟎. Therefore 𝒚 = 𝒛.

It is clear from the above problem that if there exists a vector 𝐿(𝒙𝟎 ) such
that
𝑓(𝒙𝟎 + 𝚫𝒙) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝚫𝒙
lim = 0,
𝚫𝒙→𝟎 ‖𝚫𝒙‖

then it is unique. We call this unique vector “the gradient of 𝑓 at 𝒙𝟎 ” and


denote it by ∇𝑓(𝒙𝟎 ).

Definition of the gradient of a function


Suppose 𝑓is differentiable at 𝒙. The gradient of 𝑓 at 𝒙 is the unique vector
∇𝑓(𝒙) such that

𝑓(𝒙 + 𝚫𝒙) − 𝑓(𝒙) − ∇𝑓(𝒙) ⋅ 𝚫𝒙


lim = 0.
𝚫𝒙→𝟎 ‖𝚫𝒙‖

Example 2.4

Copyright © 2018, The Open University of Sri Lanka


32
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

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𝑦) ⋅ ∆𝒙
𝑔(∆𝒙) =
‖∆𝒙‖

Then, 𝑔 is defined for each ∆𝒙 = (Δ𝑥, Δ𝑦) ≠ 𝟎.

Let 𝜖 > 0. Put 𝛿 = 𝜖. Suppose 0 < 𝑑(∆𝒙, 𝟎) < 𝛿. Observe that


(𝑥 + ∆𝑥)2 − (𝑦 + ∆𝑦)2 − 𝑥 2 + 𝑦 2 − (2𝑥, −2𝑦) ⋅ (∆𝑥, ∆𝑦)
|𝑔(∆𝒙) − 0| = � �
�(∆𝑥)2 + (∆𝑦)2
|(∆𝑥)2 − (∆𝑦)2 | |(∆𝑥)2 | + |(∆𝑦)2 |
= ≤ = �(∆𝑥)2 + (∆𝑦)2
�(∆𝑥)2 + (∆𝑦)2 �(∆𝑥)2 + (∆𝑦)2
< 𝛿 = 𝜖.

Therefore lim 𝑔(∆𝒙) = 0. Hence ∇𝑓(𝒙) = (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𝑧).

Copyright © 2018, The Open University of Sri Lanka


33
Unit 1: Continuity & Differentiability of Functions of Several Variables

So, we need to show that

𝑓(𝒙 + ∆𝒙) − 𝑓(𝒙) − (𝑦 + 1, 𝑥 + 1, 4𝑧) ⋅ ∆𝒙


lim = 0.
∆𝒙→𝟎 ‖∆𝒙‖
Let
𝑓(𝒙 + ∆𝒙) − 𝑓(𝒙) − (𝑦 + 1, 𝑥 + 1, 4𝑧) ⋅ ∆𝒙
𝑔(∆𝒙) = .
‖∆𝒙‖

Then 𝑔 is defined for each ∆𝒙 = (Δ𝑥, Δ𝑦, ∆𝑧) ≠ 𝟎.

𝜖
Let 𝜖 > 0. Put 𝛿 = . Let (∆𝑥, ∆𝑦, ∆𝑧) ∈ Domn(𝑔) and suppose 0 <
3

𝑑�(∆𝑥, ∆𝑦, ∆𝑧), (0, 0, 0)� < 𝛿 .

Observe that
|𝑔(∆𝑥, ∆𝑦, ∆𝑧) − 0|
(𝑥+∆𝑥)(𝑦+∆𝑦)+2(𝑧+∆𝑧)2 +(𝑥+∆𝑥)+(𝑦+∆𝑦)−𝑥𝑦−2𝑧 2 −𝑥−𝑦−(𝑦+1,𝑥+1,4𝑧)⋅(∆𝑥,∆𝑦,∆𝑧)
=� �
�(∆𝑥)2 +(∆𝑦)2 +(∆𝑧)2

|∆𝑥∆𝑦 + 2(∆𝑧)2 |
=
�(∆𝑥)2 + (∆𝑦)2 + (∆𝑧)2
|∆𝑥||∆𝑦| + 2(∆𝑧)2

�(∆𝑥)2 + (∆𝑦)2 + (∆𝑧)2

≤ 3�(∆𝑥)2 + (∆𝑦)2 + (∆𝑧)2


𝜖
< 3 ⋅ = 𝜖.
3

Therefore lim 𝑔(∆𝒙) = 0. Hence, ∇𝑓(𝒙) = (𝑦 + 1, 𝑥 + 1, 4𝑧).


∆𝒙→𝟎

It is sometimes hard to check the differentiability of a function at a given


point using the Definition 2.2 directly. The following theorem however
provides a sufficient condition, which can be verified easily in most of the

34
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

cases, to check the differentiability of a function at a point or on an open set


D ⊆ ℝn .

2.3 Methods of finding gradient:

Theorem 2.1

Let 𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) be a real-valued function defined on some open


set 𝐷 ⊆ ℝ𝑛 . If all the first-order partial derivatives of 𝑓 exists on
𝐵(𝒙𝟎 , 𝛿) ⊆ 𝐷, 𝛿 > 0, and are continuous at 𝑥0 , then 𝑓 is
𝜕𝑓 𝜕𝑓
differentiable at 𝑥0 and 𝛻𝑓(𝒙𝟎 ) = �𝜕𝑥 (𝒙𝟎 ), … , 𝜕𝑥 (𝒙𝟎 )� .
1 𝑛

Theorem 2.2

Let 𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) be a real-valued function defined on some open


set 𝐷 ⊆ ℝ𝑛 . If all the first-order partial derivatives of 𝑓 exist and
are continuous on 𝐷, then 𝑓 is differentiable on 𝐷 and
𝜕𝑓 𝜕𝑓
𝛻𝑓(𝒙) = �𝜕𝑥 (𝒙), … , 𝜕𝑥 (𝒙)� .
1 𝑛

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 .

Copyright © 2018, The Open University of Sri Lanka


35
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

𝜕𝑓 𝜕𝑓
Also, 𝜕𝑥 = 2𝑥𝑒 𝑦 + 𝑦 2 𝑒 𝑥 and 𝜕𝑦
= 𝑥 2 𝑒 𝑦 + 2𝑦𝑒 𝑥 are continuous at each

point (𝑥, 𝑦) ∈ ℝ2 . Therefore 𝑓 is differentiable on ℝ2 and the gradient of 𝑓


at (𝑥, 𝑦) is given by ∇𝑓(𝑥, 𝑦) = (2𝑥𝑒 𝑦 + 𝑦 2 𝑒 𝑥 , 𝑥 2 𝑒 𝑦 + 2𝑦𝑒 𝑥 ).

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 ) + 𝑥𝑦
𝜕𝑧

are continuous at each point in ℝ3 . Therefore 𝑓 is differentiable on ℝ3 and


the gradient of 𝑓 at (𝑥, 𝑦, 𝑧) is given by

∇𝑓(𝑥, 𝑦, 𝑧) = (−2𝑥𝑦𝑧 3 sin(𝑥 2 𝑦𝑧 3 ) + 𝑦𝑧, − 𝑥 2 𝑧 3 sin(𝑥 2 𝑦𝑧 3 ) +


𝑥𝑧, −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(𝜋𝑧)).

Copyright © 2018, The Open University of Sri Lanka


36
Unit 1: Continuity & Differentiability of Functions of Several Variables
MHZ4553: Unit I Session 2: Partial Derivatives, Differentiability and Gradients

Therefore
∇𝑓(0, 1, −1) = (cos 𝜋 , sin 𝜋 , −𝜋 cos 𝜋) = (−1, 0, 𝜋).

Theorem 2.3

If 𝑓 is differentiable at 𝒙𝟎 ∈ ℝ𝑛 , then 𝑓 is continuous at 𝒙𝟎 .

Theorem 2.4

Let 𝑓 and 𝑔 be two real-valued functions defined on an open set


𝐷 ⊆ ℝ𝑛 which are differentiable at 𝒙 ∈ 𝐷. Also, let 𝑐 ∈ ℝ. Then 𝑐𝑓
and 𝑓 + 𝑔 are differentiable at 𝒙. Moreover, 𝛻(𝑐𝑓)(𝒙) = 𝑐𝛻𝑓(𝒙)
and 𝛻(𝑓 + 𝑔)(𝒙) = 𝛻𝑓(𝒙) + 𝛻𝑔(𝒙).

Definition of a directional derivative of a function in ℝ𝒏


Let 𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) be a real-valued function defined on 𝐷 ⊆ ℝ𝑛 and let 𝒙𝟎
be an interior point of 𝐷. Also, let 𝒚 ∈ ℝ𝑛 be arbitrary.
If
𝑓(𝒙𝟎 + ℎ𝒚) − 𝑓(𝒙𝟎 )
lim
ℎ→0 ℎ
exists, we call it as the derivative of 𝑓 at 𝒙𝟎 with respect to 𝒚 and we
denote it by 𝑓 � (𝒙𝟎 , 𝒚).

Definition
In the above definition suppose ‖𝒚‖ = 1 and
𝑓(𝒙𝟎 + ℎ𝒚) − 𝑓(𝒙𝟎 )
𝑓 � (𝒙𝟎 , 𝒚) = lim
ℎ→0 ℎ

exists. Then the derivative 𝑓 � (𝒙𝟎 , 𝒚) is called the directional derivative of 𝑓


at 𝒙𝟎 in the direction of 𝒚.

Remark

Copyright © 2018, The Open University of Sri Lanka


37
Unit 1: Continuity & Differentiability of Functions of Several Variables

Let 𝑘 be an integer such that 1 ≤ 𝑘 ≤ 𝑛.


Let 𝒆𝒌 = (𝑒𝑘1 , 𝑒𝑘2 , … , 𝑒𝑘𝑛 ), where
0 𝑖𝑓 𝑖 ≠ 𝑘
𝑒𝑘𝑖 = � .
1 𝑖𝑓 𝑖 = 𝑘

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

Let 𝑓 be a real-valued function defined on an open set 𝐷 ⊆ ℝ𝑛 .


Suppose 𝑓 is differentiable at 𝒙𝟎 ∈ 𝐷. Then the derivative
𝑓 � (𝒙𝟎 , 𝒚) exists for each 𝒚 ∈ ℝ𝑛 and
𝑇𝒙𝟎 (𝒚) = 𝑓 � (𝒙𝟎 , 𝒚) = 𝛻𝑓(𝒙𝟎 ) ⋅ 𝒚,
where 𝑇𝒙𝟎 is the total derivative of 𝑓 at 𝒙𝟎 .

Theorem 2.6

Let 𝑓(𝑥1 , 𝑥2 , … , 𝑥𝑛 ) be a real-valued function defined on 𝐷 ⊆ ℝ𝑛


and let 𝒙𝟎 be an interior point of 𝐷. Suppose 𝑓 is differentiable at
𝑥0 . Then all the first order partial derivatives of 𝑓 exist at 𝒙𝟎 and
𝜕𝑓 𝜕𝑓
𝛻𝑓(𝒙𝟎 ) = �𝜕𝑥 (𝒙𝟎 ), … , 𝜕𝑥 (𝒙𝟎 )�.
1 𝑛

The above theorem provides us a way of computing the gradient of a


function at a point given that the function is differentiable at that point.
Recall that we

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

Suppose 𝑓 is differentiable at 𝒙𝟎 . Then there exists a vector-valued function 𝐿: 𝐷 → ℝ𝑛


such that
𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝒉
lim = 0.
𝒉→𝟎 ‖𝒉‖

For each 𝒙 ∈ ℝ𝑛 , define 𝑇𝒙𝟎 : ℝ𝑛 → ℝ by 𝑇𝒙𝟎 (𝒙) = 𝐿(𝒙𝟎 ) ⋅ 𝒙.It can be easily verified that
𝑇𝒙𝟎 is a linear transformation.

Also, for each 𝒉 ∈ ℝ𝑛 such that ‖𝒉‖ < 𝑟, define 𝐸(𝒙𝟎 , 𝒉): 𝐵(𝟎, 𝑟) → ℝ by
𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝒉
𝑖𝑓 𝒉 ≠ 𝟎
𝐸(𝒙𝟎 , 𝒉) = � ‖𝒉‖ .
0 𝑖𝑓 𝒉 = 𝟎

Clearly 𝐸(𝒙𝟎 , 𝒉) is a well-defined function on 𝐵(𝟎, 𝑟).

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 𝑖 =

1, … , 𝑛, 𝒆𝒊 ∈ ℝ𝑛 is the vector whose only non-zero component is the 𝑖 �ℎ component with

the value 1. Then 𝐿(𝒙𝟎 ) = �𝑇𝒙𝟎 (𝒆𝟏 ), … , 𝑇𝒙𝟎 (𝒆𝒏 )�.

Let 𝒉 = (ℎ1 , ℎ2 , … , ℎ𝑛 ) ∈ ℝ𝑛 be such that ‖𝒉‖ < 𝑟.

Notice that

𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝒉 = 𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − ��𝑇𝒙𝟎 (𝒆𝟏 ), … , 𝑇𝒙𝟎 (𝒆𝒏 )� ⋅ (ℎ1 , … , ℎ𝑛 )�

= 𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − �𝑇𝒙𝟎 (ℎ1 𝒆𝟏 ) + ⋯ + 𝑇𝒙𝟎 (ℎ𝑛 𝒆𝒏 )�


= 𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝑇𝒙𝟎 (𝒉).

Thus,
𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝐿(𝒙𝟎 ) ⋅ 𝒉 �𝑓(𝒙𝟎 + 𝒉) − 𝑓(𝒙𝟎 ) − 𝑇𝒙𝟎 (𝒉)�
lim = lim
𝒉→𝟎 ‖𝒉‖ 𝒉→𝟎 ‖𝒉‖
= lim 𝐸(𝒙𝟎 , 𝒉) = 0 (how? ).
𝒉→𝟎

Therefore 𝑓 is differentiable at 𝒙𝟎 .

Summary

 In practice, for a function 𝑓 of several variables with 𝑥� as an


𝜕𝑓
independent variable, 𝜕𝑥 - the partial derivative of 𝑓 with respect to 𝑥� -

can be interpreted as the “rate of change of 𝑓” with respect to 𝑥� when


the other independent variables are held as constants. Suppose that
𝑓(𝑥, 𝑦) is a function of the two variables 𝑥, 𝑦 and that (𝑎, 𝑏) is an
𝜕𝑓
interior point of the domain of 𝑓. Then, geometrically, 𝜕𝑥
(𝑎, 𝑏) can be

interpreted as the slope of the tangent to the curve of intersection of the


graph of 𝑓 (assuming that the graph of 𝑓 is possible to draw) and the
𝜕𝑓
plane 𝑦 = 𝑏 at the point (𝑎, 𝑏). The value (𝑎, 𝑏) can also be
𝜕𝑦

interpreted in a similar way.

40
Unit 1: Continuity & Differentiability of Functions of Several Variables

 Existence of partial derivatives of a function at a point doesn’t always


imply that the function is differentiable at that point. Examples can be

41

You might also like