You are on page 1of 10

Chapter 4 Multivariable function and its differentiation Page 1

Chapter 4 Multivariable function and its differentiation

4.1 Introduction

For most of the function that we have encountered before is the single variable
function y=f(x), in which the variable and the function value y are also scalar. In
physical world, this kind of function can be used to describe the physical quantity
which is dependent on a single variable. For example, the area of a circle A(r)=r2,
where r is the radius of the circle. We always say the area A(r) is a function of r.
Sometimes, the single variable function will become inadequate as the physical
quantity under interest depends on more than one variable, for example, ideal gas law
states that P=nRT and indeed P is a function of n, R and T and we write P=P(n,R,T).
This kind of function is called multivariable function and is the main theme of this
chapter.

4.2 Multivariable function

Two variable function

A two-variable function is a function such that the function value is dependent


on two variables, or sometimes we say a vector in two dimensional space. That is to
say: f=f(x, y)=f(v), where v=(x, y). One of the practical example is the density of a
non-uniform metal sheet, say (x, y)=(r) is a function of the position vector r=(x, y).
Another example is the kinetic energy EK.E.=EK.E.(m, v)=EK.E.(r), in which r=(m, v) is a
vector in the (m, v) vector space and v is the speed.

z
For the case of a two variable
function, the function can be plotted
(0 , 0 , 1 ) against its variable using the z-axis to
represent the function value. For
example, if the density of the metal
sheet is: (x, y)=(r)= 1  x 2  y 2 ,
2 2
z = 1 - x - y
where r=(x, y), then the density can be
plotted as shown in the figure by using
o y the z-axis to represent the density.
(0 , 1 , 0 )
(1 , 0 , 0 )

Function of n-variable
Def. : A n-variable function is a function such that its range is a subset of the real
number R and its domain is the subset of the n-dimensional vector space Rn. That is
to say f=f(x1,x2.....,xn)=f(v), where v=(x1,x2.....,xn) and f is a scalar.
Chapter 4 Multivariable function and its differentiation Page 2

4.3 Partial derivative of multivariable function

4.3.1 Partial derivative of two variable function

Suppose f=f(x,y), then the we can define the partial derivatives of the function by :

(i) partial derivative of f with respect to x, (i.e. fixing the variable y):
f ( x, y ) f ( x  x, y )  f ( x, y )
 f x ( x, y )  lim (1)
x x  0 x

(ii) partial derivative of f with respect to x, (i.e. fixing the variable x):

f ( x , y ) f ( x , y  y )  f ( x , y )
 f y ( x , y )  lim (2)
y y  0 y

Example : Calculate the partial derivative fx and fy of the following functions :


(i) f(x, y)=x2y+sinxy2
(ii) f(x, y)=(x+y)1/2

Interpretation of fx(x, y) and fy(x, y)

z
p la n e y = y o The surface z=f(x,y) is shown in the
y figure. Notice that the point
ta n g e n t lin e w ith s lo p e  (x0,y0,z0)=( x0,y0,f(x0,y0) ) is on the
x
 f 
surface. fx(x0,y0)=  x  ( x, y )  ( x is
0, y0 )

indeed interpreted as:


( x o , y o , z o) y is fixed at y=y0. (i)
z = f (x , y)
There is an infinitesimal(ii)
small change of x from x0
y
to x0+x and the
corresponding change in
x the function value is
f=f(x0+x, y0)-f(x0, y0).
(iii) fx(x0, y0) is indeed the ratio
of (f/x).
Or graphically, the plane y=y0 is intersected with the surface z=f(x, y) to obtain the
cross section of the surface. The cross section of the surface is indeed functional
dependence of x while keeping y fixed at y0. fx(x0,y0) is indeed the slope of the
tangent of the curve appeared on the cross section at the point x=x0.

Similar interpretation is applied to fy(x0,y0) while keeping x fixed at x=x0 and


observing the functional change as there is a infinitesimal change from y0 to y0+y.
Chapter 4 Multivariable function and its differentiation Page 3

x
ta n g e n t lin e w ith s lo p e 
y

(x o , y o , z o)

p la n e x = x o

z = f (x , y)
y

4.3.2 Partial derivative of n-variable function

Def. : If f(x1,x2,......,xn) is a function of n variables, then the partial derivative of f


with respect to xi is defined as:

f f ( x1 , x 2 , , xi  xi ,, x n )  f ( x1 , x2 , , xi , , xn )
 f xi  lim
xi x i  0 xi
(3)

Example :
(i) Calculate the three partial derivatives of the three variable function :
2
f ( x, y , z )  xz  e y z  xy 2 z 3
(ii) Find all the possible partial derivatives of the function :
f(x)=x12-x22+3x1x2x3-(x4/x1).

4.3.3 Higher order partial derivative

If f is a function of two variables f=f(x, y), then there are four different possibilities of
second partial derivatives :
2 f   f 
(i) differentiate with respect to x twice, i.e. f xx    ;
x 2 x  x 
2 f   f 
(ii) differentiate with respect to y twice i.e. f yy    ;
y 2 y  y 
(iii) differentiate with respect to x first and then with respect to y i.e. :
2 f   f 
f xy    ;
yx y  x 
(iv) differentiate with respect to y first and then with respect to x, i.e.,
2 f   f 
f yx    .
xy x  y 

Example : Let z=f(x, y)=x3y2-xy5, find all the possible second derivatives.

Theorem 1.
Chapter 4 Multivariable function and its differentiation Page 4

Suppose f is a function of two variables f(x,y). If f , fx, fy, fxy and fyx are continuous,
then fxy=fyx.

Note : (i) Most of the functions that appeared in the scope of this course are
continuous.

Theorem 2.
f is a three variable function f(x, y, z) If f, fx, fy, fz and all the mixed second order
derivatives are continuous, then :
fxy=fyx, fxz=fzx, fyz=fzy.

Example :
f(x, y, z)=xy3-zx5+x2yz.
(i) Find all the nine second partial derivatives and check the validity of Theorem 2.
(ii) Find fxxx, fxzy and fzxy.

4.4 Gradient and differentiability

Def. : Let f(x, y, z) be a function of three variables and the gradient of f, denoted by
f is defined as :

f f f
f  i j k (4)
x y z

Example : Find the gradient of the following cases :


(i) f(x, y)=xy
(ii) f(x, y, z)=xy2z3, find f (3,1,2) .

Differentiability

In the previous section, we have studied the partial derivative of a two


variable function f(x, y), which means by calculating the partial derivatives (i.e. fx or
fy), we can know the induced change in f (i.e. f) if there is a very small change in x
(i.e. x) or y (i.e. y) while the other variable is kept fixed. However, if there are
simultaneous small changes in both of the variables (x, y)(x+x, y+y), then the
change in the function value f=f(x, y)- f(x+x, y+y) is not identical to that in the
previous cases. z

z=f(x0+x,y0+y)

z=f(x0+x,y0)
z=f(x0,y0)

z=f(x0,y0+y)

(x0,y0+y,0)

(x0+x,y0,0)
x
(x0+x,y0+y,0)
Chapter 4 Multivariable function and its differentiation Page 5

Def.: Differentiability of two variable function

A two variable function is said to be differentiable at (x0, y0) iff there exists functions
1(x, y) and 2(x, y) such that:
f f
f ( x 0  x , y 0  y )  f ( x 0 , y 0 )  x  y  1 ( x, y )x   2 (x, y )y
x ( x , y ) y ( x , y )
0 0 0 0

lim 1 (x, y )  0
( x, y )  ( x 0 , y 0 )
where .
lim  2 ( x, y )  0
( x, y )  ( x 0 , y 0 )

Or an alternative definition:

Let f be a two variable function f(r), where r=(x,y). f is said to be differentiable at


r0=(x0,y0) iff for any infinitesimal small change in the vector from r0=(x0,y0) to
r0+r=(x0+x,y0+y), the induced function change f=f(r0+r)-f(r0) can be
expressed as :

f (r0  r )  f (r0 )  f (r0 )  r  g ( r )

g ( r )
for some function g such that lim
r  0 r
.

Note : For most of the functions encountered in this course are differentiable.

Theorem 3
If f(r) and g(r) are two multivariable functions and  is some constant scalar, then :

(i) f   f


(ii) ( f  g )  f  g
Chapter 4 Multivariable function and its differentiation Page 6

4.5 Chain Rule

For single variable function y=k(x) and x is a function of t, ie.x=x(t), then


dy dk dx
 and for multivariable function, we have very similar chain rule.
dt dx dt

Theorem 4: Chain Rule 1


If f(r) is a differentiable multivariable function of the vector r and r is a vector
function of a scalar t, i.e. r=r(t), or simply speaking f: n and r: n, then

df d
 f (r )  r (t ) (5)
dt dt

Theorem 5: Chain Rule 2


If f(x, y) is a differentiable function and x, y are function of other two variables r and
s, i.e. x=x(r,s) and y=y(r,s) or simply speaking f: 2, x: 22 and y: 22,
then

f f x f y
 
r x r y r
f f x f y
(6)
 
s x s y s

Example :
df
(i) f(x, y)=xy2, x=cos t and y=sin t. Find .
dt
f f
(ii) f(x, y)=sin(xy2), x=r/s and y=er-s. Find and .
r s
(iii) Extension to higher dimension
PV=nRT, where R is a constant. If now the volume of an ideal gas is
increasing at a rate of 10cm3/min and the pressure is decreasing at a rate of
0.3N/cm2/min. How is the temperature of the gas changing when the volume of 5
mole of a gas is 100cm3 and the pressure is 2N/cm2?

4.6 Tangent plane, normal vector and gradient

Consider we have a surface S represented by S: F(x, y, z)=0 and a point


(x0,y0,z0) is on the surface. Now we construct an arbitrary curve C lying on the
surface S and C is represented by the parametric equation C: g(t)=x(t)i+y(t)j+z(t)k.
Then for all the points on the curve C, of course it must also be on the surface S:
F(x,y,z)=0 and also x=x(t), y=y(t), z=z(t).

Therefore, F(x(t), y(t), z(t))=0


Chapter 4 Multivariable function and its differentiation Page 7

Differentiate both sides w.r.t. t,

dF
 F  g ' (t )  0
dt     
ByChainRule

As g'(t) is the tangent line of the curve C, we can say that F is perpendicular to the
tangent line at any point of the curve C. Because C is arbitrary constructed, we can
conclude:

F(x0, y0, z0) is perpendicular


to the tangent vectors at (x0, y0, z0) to
any curve passing through (x0, y0, z0)
and lying on the surface F(x,y,z)=0.


ΔF(x o )
Def. : Normal line and tangent plane

(i) The normal line to S at x0=(x0, y0, z0)


is the line passing through x0 and have the
 same direction as F(x0).
xo
 (x o , y o , z o )
(ii) The tangent plane to S at x0=(x0, y0,
z0) is the plane that contains the point
x0=(x0,y0,z0) and has a normal vector of
C F(x0).
S u rfa c e
F (x , y, z)= 0

Example :

(i) Find the equation of the tangent plane and the normal line to the surface
 y2   z2 
x2    3 at the point (1,2,3).
 4   9 
   

(ii) Find the tangent plane and the normal line to the surface z=x 3y5 at the point
(2,1,8).

4.7 Directional derivative and the gradient

Suppose f is a function of two variables f(x, y). We have already known that
f f
the partial derivatives and y are the ratio of the induced functional change f
x
to the infinitesimal change x and y respectively as the other variable is kept fixed.
In some of the case, we are interested to know the functional change f if there is a
infinitesimal change of the variables in the u direction, i.e. from r0=(x0,y0)=x0i+y0j to
r0+r=(x0+x)i+(y0+y)j.
Chapter 4 Multivariable function and its differentiation Page 8

z
z = f (x , y )

f (x o + x , y o + y )
f (x o , y o)

o y
(xo + x , yo + y )
u

x (x o , y o) Δr

Def. : Directional derivative

If f(x, y) is a differentiable two variable function and u is a unit vector, then the
directional derivative of f in the direction of u is defined as :

f ( x0  x, y 0  y )  f ( x0 , y 0 )
f ' u (r0 )  lim  f (r0 )  u
r  0 r
(7)

Example : Find the following directional derivatives of f in the direction of the


specified vector:
(i) f(x, y)=xy2, v=2i+3j;
(ii) f(x, y, z)=xlny-exp(xz3), v=i-j+3k.

4.8 Total differential

Def. : If f(r) is a differentiable multivariable function, then if the vector is changed


from r0 to r0+r, then the total differential is defined as :

df  f (r0 )  r (8)

If the magnitude of the infinitesimal vector r small, then

f  f (r0  r )  f (r0 )  df  f (r0 )  r (9)


Chapter 4 Multivariable function and its differentiation Page 9

Example: The radius of a cone is measured to be 15cm and the height of the cone is
measured to be 25cm. There is a maximum error of ±0.02cm in the measurement of
the radius and ±0.05cm in the measurement of the height.
(a) What is the approximate volume of the cone?
(b) What is the maximum error in the calculation of the volume?

4.9 Local maximum, local minimum and saddle point of two variable function.

Def. : Local maximum and minimum


Suppose f(x, y) is a two variable function defined in a neighbourhood of a point
r0=(x0, y0).

(i) r0 is said to be the local maximum of f iff f(r0) f(r) for any r in the neighbourhood
of r0.

(ii) r0 is said to be the local minimum of f iff f(r0)f(r) for any r in the neighbourhood
of r0.

r0 is called the extreme point iff it is a local maximum or minimum.

Def. : Critical Point


f(r) is a differentiable two variable function. r0 is a critical point iff
(i) f(r0)=0 or
(ii) f(r0) does not exist.

Theorem 6
Suppose f(r) is a two variable function. If r0 is a extreme point, then f(r0)=0.

Important : Notice that the reverse of Theorem 6 is not correct, i.e. f(r0)=0 does not
imply that r0 is a extreme point. It may be a saddle point.

Def. : Saddle point


r0 is said to be a saddle point if f(r0)=0 and r0 is not an extreme point.

Example : z

0
y

x
Chapter 4 Multivariable function and its differentiation Page
10

z=y2-x2 at (0,0) is a saddle point because z(0,0)=0 but it is not a maximum nor
minimum.

Theorem 7 Second derivative test


If f(r) is a two variable function and r0 is a critical point, i.e. f(r0)=0. Let
D=fxx(r0)fyy(r0)-[fxy(r0)]2, then

(i) if D>0 and fxx(r0)>0, then r0 is a local minimum.


(ii) if D>0 and fxx(r0)<0, then r0 is a local maximum.
(iii) if D<0, then r0 is a saddle point.
(iv) if D=0, undetermined.

Example : Find all the critical points and determine its nature.
(i) f(x, y)=1+x2+3y2.
(ii) f(x, y)=-x2+2x+4y+5
(iii) f(x, y)=2x3-24xy+16y3.

You might also like