You are on page 1of 24

Chapter One: Partial Di↵erentiation

1.1 Functions of several variables


1.2 Partial derivatives
1.3 Chain rule of di↵erentiation
1.4 Total di↵erential
1.5 Taylor’s formula
1.6 Relative extreme values
1.7 Lagrange multiplier method
1.8 Numerical methods

ZHANG Haiyu Doris (HKU) Math2014 4 / 51

1.1 Functions of several variables

2D-rectangular coordinates: for example, w = f (x, y) = x2 + y 2 .


2D-polar coordinates: (r, ✓), where r 0 and 0  ✓ < 2⇡.
Polar coordinates and rectangular coordinates are related by the
equations x = r cos ✓ and y = r sin ✓.
3D-spherical coordinates: (⇢, , ✓), where ⇢ 0, 0   ⇡,
0  ✓ < 2⇡.
Spherical coordinates and rectangular coordinates are related by the
equations x = ⇢ sin cos ✓, y = ⇢ sin sin ✓, z = ⇢ cos .
3D-cylindrical coordinates: (r, ✓, z), where r 0 and 0  ✓ < 2⇡,
z 2 R.
Cylindrical coordinates and rectangular coordinates are related by the
equations x = r cos ✓, y = r sin ✓, z = z.

ZHANG Haiyu Doris (HKU) Math2014 5 / 51


Spherical and Cylindrical coordinate systems

Our goal is to find the volume of S.


ZHANG Haiyu Doris (HKU) Math2014 6 / 51

1.1 Functions of several variables: Continuity

A real valued function w = f (x, y) defined on a region D of the xy plane


is said to be continuous at a point (x0 , y0 ) 2 D if

lim f (x, y) = f (x0 , y0 ).


(x,y)!(x0 ,y0 )

If F is continuous at every point in D, it is said to be continuous on D.


Example 1
Prove
8
< p xy , (x, y) 6= (0, 0)
f (x) = x2 +y 2
:0, (x, y) = (0, 0)

is continuous everywhere.

ZHANG Haiyu Doris (HKU) Math2014 7 / 51


1.1 Functions of several variables

Example 2
Is the function
(
xy
x2 +y 2
, (x, y) 6= (0, 0)
f (x) =
0, (x, y) = (0, 0)

continuous at point (0, 0)?

Remark: In order of the limit in

lim f (x, y) = f (x0 , y0 )


(x,y)!(0,0)

to exist, f (x, y) must approach f (x0 , y0 ) for each and every mode of
approach of (x, y) to (x0 , y0 ).

ZHANG Haiyu Doris (HKU) Math2014 8 / 51

Tutorial Exercise 1.1

2x 3y
1. Let f (x, y) = x+y , where x + y 6= 0. Show that

lim f (x, y)
(x,y)!(0,0)

does not exist.


Hint: Consider (x, y) approaches (0, 0) along x axis and y axis.

ZHANG Haiyu Doris (HKU) Math2014 9 / 51


Revision:Derivatives

Definition
For a function w = f (x) and a point x in D, if

f (x + x) f (x) w
f 0 (x) = lim = lim
x!0 x x!0 x
exist, we say f (x) is di↵erentiable at point x. We also use the notations
dw
f 0 (x) and to denote derivatives of w = f (x) at x.
dx

ZHANG Haiyu Doris (HKU) Math2014 10 / 51

1.2 Partial derivatives

Definition
For a function w = f (x, y) and a point (x0 , y0 ) in D, we define the partial
derivatives of f (x, y) at (x0 , y0 ) with respect to x by

f (x0 + x, y0 ) f (x0 , y0 ) w
fx (x0 , y0 ) = lim = lim
x!0 x x!0 x
✓ ◆
@w
We also use the notations to denote partial derivatives of
@x (x0 ,y0 )
w = f (x, y) at (x0 , y0 ) with respect to x in D. If every point in D is
partial di↵erentiable with respect to x, then we have the partial derivative
@w @f
function fx (x, y) (or , , fx ).
@x @x
✓ ◆
@w
Similarly, we can define and fy (x, y).
@y (x0 ,y0 )

ZHANG Haiyu Doris (HKU) Math2014 11 / 51


1.2 Partial derivatives

In other words, a partial derivative of a function of several variables is its


derivative with respect to one of those variables, with the others held
constant.
ZHANG Haiyu Doris (HKU) Math2014 12 / 51

1.2 Partial derivatives

Example 3
Let f (x, y) = x4 + 2x2 y + y 4 . Find fx (x, y), fy (x, y), fx (0, 1), fy (0, 1)

Example 4
Evaluate the partial derivatives of the function u = ln(x + y 2 + z 3 ).

Example 5
Let z = xy (x > 0, x 6= 1). Prove

x @z 1 @z
+ = 2z.
y @x ln x @y

ZHANG Haiyu Doris (HKU) Math2014 13 / 51


1.2 Partial derivatives

In-class exercise
Evaluate the partial derivatives of the following:
1. w = x ln(x2 2y 3 )
p
2. w = x2 3y + z 3

ZHANG Haiyu Doris (HKU) Math2014 14 / 51

1.2 Partial derivatives

Second order partial derivatives


If fx exists at every point of a region D, then fx is a well-defined function
on D, and we can consider partial derivatives of fx with respect to x and
y. Such partial derivatives, if exist, are called second order partial
derivatives of f , can be denoted as fxx and fxy = (fx )y .
Similarly, we can define fyx = (fy )x and fyy = (fy )y . The partial
derivatives fxy and fyx are usually called mixed seconder order partial
derivatives.

Notation
✓ ◆
@2f @ @f @2f
fxx = , fxy = (fx )y = =
@x2 @y ✓ @x ◆ @y@x
@2f @ @f @2f
fyy = , fyx = (fy )x = =
@y 2 @x @y @x@y

ZHANG Haiyu Doris (HKU) Math2014 15 / 51


1.2 Partial derivatives

Question
@2f ? @2f
=
@y@x @x@y

Definition: C k function
A function f is said to be a C k function if all the k th order partial
derivatives of f exist and are continuous in D.

Theorom
@2f @2f
If f is a C 2 function, then = .
@y@x @x@y

ZHANG Haiyu Doris (HKU) Math2014 16 / 51

1.2 Partial derivatives

Example 6
x+y
Calculate all the second order partial derivatives of z = arctan .
1 xy
Recall
1
(sin x)0 = cos x (arcsin x)0 = p
1 x2
1
(cos x)0 = sin x (arccos x)0 = p
1 x2
0 1
(tan x) = 1 + tan2 x (arctan x)0 =
1 + x2

Example 7
2y @2w @2w
Let w = . Prove = .
cos x + y @y@x @x@y
ZHANG Haiyu Doris (HKU) Math2014 17 / 51
Tutorial Exercise 1.2

Compute all first order partial derivatives of the following:


1. w = x sin(2y 3z 2 )
Evaluate the 1st and 2nd order partial derivatives of the following:
2. w = ex cos y + x2 + xy y 2
3. w = ln(x2 + y 2 z 2 )
4. w = e2x+y sin(x y)
@2w @2w
For each of the following, verify that = .
@y@x @x@y
5. w = x2 p
y 2y cos xy + y sin x
6. w = ln x2 + y 2
7. w = xy (x > 0)
8. w = x sin2 y + exy
x2
9. w = y22xy
+sin x+1

ZHANG Haiyu Doris (HKU) Math2014 18 / 51

1.3 Chain rule of di↵erentiation

If w = f (x1 , ..., xn ) and xj = gj (t1 , ...tk ), for j = 1, ..., n, then w becomes


a composite function of t1 , ...tk by taking composition of functions f and
gj , where j = 1, 2, ..., n. In other words,

w = f (g1 (t1 , ..., tk ), ..., gn (t1 , ..., tk )).

Partial derivatives of w with respect to ti , where i = 1, ..., k are given by


n
@w X @w @xj
= ⇥ .
@ti @xj @ti
j=1

ZHANG Haiyu Doris (HKU) Math2014 19 / 51


1.3 Chain rule of di↵erentiation

Example 8
x2 @z @z
If z = y and x = u 2v, y = 2u + v. Calculate @u , @v .

Example 9
@z @z
If z = (2x + y)x+2y , calculate @x , @y .

ZHANG Haiyu Doris (HKU) Math2014 20 / 51

1.3 Chain rule of di↵erentiation

In-class exercise
@w @w
1. If w = xy + cos(x 2y), x = s2 t and y = set , compute @s and @t .

2. Let f (u, v, w) = u2 + vw and u = x + y, v = x2 , w = xy. Compute


fx , fy , fxx , fxy .

3. If f is a di↵erentiable function of one variable, verify that the function


w = f (2x 3y) satisfies the equation 3wx + 2wy = 0.

ZHANG Haiyu Doris (HKU) Math2014 21 / 51


Tutorial Exercise 1.3

⇣ ⌘
x z
1. Suppose that w = g y, y , where g is a di↵erentiable function. Show
that
@w @w @w
x +y +z = 0.
@x @y @z

2. Let w = f (u) and u = x2 + y 2 . Show that y @w @w


@x = x @y .

3. Use the substitution u = x + ct and v = x ct to reduce the wave


2 2 @2w
equation c2 @@xw2 = @@tw2 to the form @u@v = 0.

ZHANG Haiyu Doris (HKU) Math2014 22 / 51

1.4 Total di↵erential

If w = f (x, y) is a C 1 function defined near (x0 , y0 ). We consider a


neighboring point (x0 + x, y0 + y). Let

w = f (x0 + x, y0 + y) f (x0 , y0 ).

Example 10
If w = x3 y 3 + 3xy, calculate w.

ZHANG Haiyu Doris (HKU) Math2014 23 / 51


1.4 Total di↵erential

If w = f (x, y) is a C 1 function defined near (x0 , y0 ), then


p
w = fx (x0 , y0 ) x + fy (x0 , y0 ) y + o( x2 + y 2 ).

When x ! 0 and y ! 0, we can denote x and y by dx, dy. The


expression
w ⇡ dw = fx (x0 , y0 )dx + fy (x0 , y0 )dy
is known as the total di↵erential of the function f (x, y) at the point
(x0 , y0 ), it is the linear approximation for w when (x, y) changes from
(x0 , y0 ) to (x0 + x, y0 + y).

ZHANG Haiyu Doris (HKU) Math2014 24 / 51

1.4 Total di↵erential

Example 11
Calculate the total di↵erential of the function z = exy at the point (2, 1).

Example 12
Calculate the total di↵erential of the function u = x cos y2 + arctan yz .

ZHANG Haiyu Doris (HKU) Math2014 25 / 51


1.4 Total di↵erential

Example 13
p
Use the linear approximation formula to approximate 3.92 + 3.22 .

Example 14
The volume V = ⇡r2 h of a right circular cylinder is to be calculated from
measured values of base radius r and height h. Assume that r is measured
with a relative error of no more than 1.5% and h with a relative error of
no more than 0.5%. Estimate the resulting possible percentage error in the
calculation of V , using the linear approximation formula.

ZHANG Haiyu Doris (HKU) Math2014 26 / 51

1.4 Total di↵erential

In-class exercise
p
1. Use total di↵erential to approximate 9(1.95)2 + (8.1)2
2. The mass of a fluid passing through a pipe of radius R and length L per
R4
unit time satisfies the equation Q = ⇡P
5V L , where V is the viscosity of the
liquid and P is the pressure di↵erence between the two ends of the pipe. It
is known that P , R, V and L are measured with relative error not
exceeding 0.5%, 0.25%, 0.15% and 0.3% respectively. Using total
di↵erential ,find the maximum relative error in the calculated value of Q.

ZHANG Haiyu Doris (HKU) Math2014 27 / 51


1.4 Total di↵erential

Tutorial exercise
1
Use total di↵erential to approximate p
3
(1.9)2 +(2.04)2
Approximate w by dw at the point (1, 1, 0) for the function
w = x2 ye3z . Hence find the approximation value of w at x = 1.01,
y = 1.03 and z = 0.02.

ZHANG Haiyu Doris (HKU) Math2014 28 / 51

1.5 Taylor’s formula

Revision: one variable case


Let g(t) be a C 3 function defined on an open interval I containing t0 .
Then for every t 2 I, we have
Z
g 00 (t0 ) 1 t
g(t) = g(t0 ) + g 0 (t0 )(t t0 ) + (t t0 )2 + (t ⌧ )2 · g 000 (⌧ )d⌧.
2! 2! t0

This formula is known as the second order Taylor’s formula for functions of
one variable. It is one of the most useful formulas in mathematics, and
may be established by the fundamental theorem of calculus and
integration by parts.

ZHANG Haiyu Doris (HKU) Math2014 29 / 51


1.5 Taylor’s formula

Example 15
Use Taylor’s formula to expand f (x) = ex near the point x = 0.

ZHANG Haiyu Doris (HKU) Math2014 30 / 51

1.5 Taylor’s formula

Two variable case


Suppose now that w = f (x, y) is a C 3 function defined in a domain D of
the xy plane, and let (x0 , y0 ) be a point in D. For any x and y, we
define
1
w = [fx (x0 , y0 )) x + fy (x0 , y0 ) y] + [fxx (x0 , y0 ) x2 +
2!
Z
1 1
2fxy (x0 , y0 ) x y + fyy (x0 , y0 ) y 2 ] + (1 t)2 g 000 (t)dt.
2! 0
This is the second order Taylor’s formula for functions of two variables.

ZHANG Haiyu Doris (HKU) Math2014 31 / 51


1.5 Taylor’s formula

Another form of the second order Taylor’s formula


Suppose now that w = f (x, y) is a C 3 function defined in a domain D of
the xy plane, and let (x0 , y0 ) be a point in D. For any x and y, we
define

f (x, y) = f (x0 , y0 ) + [(x x0 )fx (x0 , y0 ) + (y y0 )fy (x0 , y0 ))]

1
+ [(x x0 )2 fxx (x0 , y0 ) + 2(x x0 )(y y0 )fxy (x0 , y0 )
2!
2
+(y y0 ) fyy (x0 , y0 )] + Remainder
This is the second order Taylor’s formula for functions of two variables

ZHANG Haiyu Doris (HKU) Math2014 32 / 51

1.5 Taylor’s formula

Example 16
1
Use Taylor’s formula to expand f (x, y) = 1 2x+y near the point (0, 0).

Example 17
Use Taylor’s formula to approximate (1.08)3.96 .

In-class Exercise
1
Find six terms of the Taylor’s expansion for f (x, y) = 1 x+y at (0, 1).

ZHANG Haiyu Doris (HKU) Math2014 33 / 51


1.5 Taylor’s formula

Tutorial Exercise
Use Taylor’s formula to approximate (8.96)2.03 .

ZHANG Haiyu Doris (HKU) Math2014 34 / 51

1.6 Relative extreme values

Relative extreme values


Let f (x, y) be a function of two independent variables. A point (x0 , y0 ) is
said to be a relative minimum of f (x, y) if f (x, y) f (x0 , y0 ) for all
(x, y) in some neighborhood of (x0 , y0 ). Similarly, a point (x0 , y0 ) is said
to be a relative maximum of f (x, y) if f (x, y)  f (x0 , y0 ) for all (x, y) in
some neighborhood of (x0 , y0 ).

ZHANG Haiyu Doris (HKU) Math2014 35 / 51


1.6 Relative extreme values

Theorem
Let (x0 , y0 ) is a relative extreme value of f (x, y), then fx (x0 , y0 ) = 0 and
fy (x0 , y0 ) = 0.

Critical Point
A point (x0 , y0 ) satisfying fx (x0 , y0 ) = 0 and fy (x0 , y0 ) = 0 is called a
critical point of f (x, y).

ZHANG Haiyu Doris (HKU) Math2014 36 / 51

1.6 Relative extreme values


Theorem
Let (x0 , y0 ) be a critical point of f (x, y) and suppose that
A = fxx (x0 , y0 ), B = fxy (x0 , y0 ), C = fyy (x0 , y0 ) and H = AC B2.
1. If H > 0 and A < 0, then f (x0 , y0 ) is a relative maximum.
2. If H > 0 and A > 0, then f (x0 , y0 ) is a relative minimum.
3. If H < 0, then f (x0 , y0 ) is a saddle point.
4. If H = 0, then the ”second order derivative test” is inconclusive.

ZHANG Haiyu Doris (HKU) Math2014 37 / 51


1.6 Relative extreme values

Example 18
Find the critical points of the function f (x, y) = xy(a x y)(a 6= 0) and
determine their nature.

Example 19
Find the critical points of the function f (x, y) = x2 2xy 2 + y 4 y 5 and
determine their nature.

Example 20
Find the critical points of the function f (x, y) = x3 + y 3 3xy and
determine their nature.

ZHANG Haiyu Doris (HKU) Math2014 38 / 51

1.6 Relative extreme values

In-class exercise
Find the critical points of the following functions and determine their
nature.
1. f (x, y) = x4 + y 4 4xy
2. f (x, y) = 6x2 2x3 + 3y 2 + 6xy
3. f (x, y) = x2 3y 2 + 2y 3 + 4x 12y + 2

ZHANG Haiyu Doris (HKU) Math2014 39 / 51


1.6 Relative extreme values

Tutorial exercise
Find the critical points of the following functions and determine their
nature.
1. f (x, y) = 9x3 4xy + 13 y 3
2. f (x, y) = x3 + y3 12x 3y + 20

ZHANG Haiyu Doris (HKU) Math2014 40 / 51

1.7 Lagrange multiplier method

Constrained optimization problems


In many piratical problems, the extrema to be sought are required to
satisfy certain side conditions(constraints). Problems of this type require
treatment di↵erent from those given in 1.6. As a simple illustration,
consider the geometric problem of finding the point on the plane
2x 3y + 5z = 19 which is nearest p to the origin. This is equivalent to
minimizing the ”distance function” x2 + y 2 + z 2 subject to the
constraint that x, y, z must also satisfy the equation
g(x, y, z) = 2x 3y + 5z 19 = 0.
The method of Lagrange Multiplier is designed to track problems of this
type.

ZHANG Haiyu Doris (HKU) Math2014 41 / 51


1.7 Lagrange multiplier method

Problem
To Maximize or minimize a function f (x, y, z) subject to the constraint
g(x, y, z) = 0.

Lagrange multiplier method


Suppose that f (x, y, z) and g(x, y, z) have continuous partial derivatives.
To find the local maximum and minimum values of f subject to the
constraint g(x, y, z) = 0, find the values of x, y, z and that satisfy the
system of equations:

fx = gx , fy = gy , fz = gz , g = 0.

ZHANG Haiyu Doris (HKU) Math2014 42 / 51

1.7 Lagrange multiplier method

Example 21
p
Minimize the function f (x, y, z) = x2 + y 2 + z 2 subject to the
constraint g(x, y, z) = 2x 3y + 5z 19 = 0

Example 22
Find the maximum and minimum values of the function
f (x, y, z) = x 2y + 5z on the sphere x2 + y 2 + z 2 = 36.

Example 23
A standard oil drum has a capacity of 10m3 . Use the method of Lagrange
Multiplier to find the dimensions of the drum that requires the minimal
amount of material to construct.

ZHANG Haiyu Doris (HKU) Math2014 43 / 51


1.7 Lagrange multiplier method

Example 24
Let f (x, y) = xy + x2 + y 2 2x 2y. Find the absolute minimum values
of f on the region x2 + y 2  4

Find extrema subject to more than one constraint:


Example 25
Maximize f (x, y, z) = xyz, subject to g1 (x, y, z) = x + y + z 40 = 0
and g2 (x, y, z) = x + y z = 0.

ZHANG Haiyu Doris (HKU) Math2014 44 / 51

1.7 Lagrange multiplier method

Tutorial exercise
1. Find the rectangle with largest area that can be inscribed in the
ellipse 9x2 + 4y 2 = 36.
2. Using the Lagrange Multiplier method, find the shortest distance from
the point (1, 1, 2) to the plane x 2y + 5z = 5

ZHANG Haiyu Doris (HKU) Math2014 45 / 51


1.8 Numerical methods

Finding a root for functions of one variable: Newton-Raphson Method

f (xn ) f (xn )
f 0 (xn ) = ) xn+1 = xn
xn xn+1 f 0 (xn )

ZHANG Haiyu Doris (HKU) Math2014 46 / 51

1.8 Numerical methods

Example 26
p
Estimate 2 using Newton-Raphson method.

Example 27
Find the real roots of the cubic equation, arising from an optimization
problem
2x3 + x 1 = 0.

ZHANG Haiyu Doris (HKU) Math2014 47 / 51


1.8 Numerical methods

Solving system of non-linear equations (Newton-Raphson Method):


Consider the system of equations
(
f (x, y) = 0
g(x, y) = 0

where f (x, y), g(x, y) are given functions of x and y. Let (a, b) be a root
of the above system of equations. Suppose that x0 , y0 is an initial
approximation to a, b. Putting

x0 + h = a, y0 + k = b.

ZHANG Haiyu Doris (HKU) Math2014 48 / 51

1.8 Numerical methods

Taylor’s formula gives

0 = f (a, b) = f (x0 +h, y0 +k) = f (x0 , y0 )+fx (x0 , y0 )h+fy (x0 , y0 )k +· · ·

0 = g(a, b) = g(x0 +h, y0 +k) = g(x0 , y0 )+gx (x0 , y0 )h+gy (x0 , y0 )k+· · · ,
i.e. (
fx (x0 , y0 )h + fy (x0 , y0 )k = f (x0 , y0 )
gx (x0 , y0 )h + gy (x0 , y0 )k = g(x0 , y0 ).
We improve our initial approximation by puttingx1 = x0 + h, y1 = y0 + k
and we can repeat the process again.

ZHANG Haiyu Doris (HKU) Math2014 49 / 51


1.8 Numerical methods

Example 28
Use Newton-Raphson Method with initial point (1, 1) and perform two
iterations to find an approximation root for the system of equations
(
4x3 4xy + 2x + 2y 1 = 0
2x2 + 4y + 2x 1 = 0.

In-class exercise
Use Newton-Raphson Method with initial point (1, 2) to find an
approximation to the critical point of (x, y) = x4 + xy + y 2 + 2y
(perform two iterations).

ZHANG Haiyu Doris (HKU) Math2014 50 / 51

1.8 Numerical methods

Tutorial exercise
Solve the system of equations
(
x2 + x y 2 1 = 0
y sin x2 = 0

with initial guess (0.7, 0.5) and perform two iterations.

ZHANG Haiyu Doris (HKU) Math2014 51 / 51

You might also like