Nothing Special   »   [go: up one dir, main page]

Multivariate Calculus Unit Two: M. A. Boateng, PHD., Mima

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

MULTIVARIATE CALCULUS

UNIT TWO

M. A. BOATENG, PhD., MIMA

July 6, 2022
Gradiant of a function of n variables:
Let w = f (x , y , z) be a function of three variables such that fx , fy ,


and fz exist. The vector ∇f (x , y , z) is called gradient of f and is
given as:


∇f (x , y , z) = fx (x , y , z)î + fy (x , y , z)ĵ + fz (x , y , z)k̂


∇f (x , y , z) can be written as grad f(x,y,z).
Example:
Find the gradient of f (x , y , z) = x 2 y + z 3 x
solution
fx = 2xy + z 3 , fy = x 2 , fz = 3z 2 x


∇f (x , y , z) = (2xy + z 3 )î + x 2 ĵ + 3z 2 x k̂

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 2 / 26


Find the grad of the following functions:

x 2 −3y 3 +z 2
1. f (x , y , z) = 2x +y −4z

2. f (x , y , z) = e −2z sin2xcos3y 4

3. f (x , y , z) = 3x 2 + xy − 4yz − z 2 + 2xz

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 3 / 26


DEFINITIONS

Directional Derivatives: Suppose that f is a function of n variables.


If U = ni=1 ai xi is a unit vector where xi are unit vectors in the
P

direction of xi , then the directional derivatives of f in the direction of


Ui denoted by Du f , is given by:

f (P + hU) − f (P)
Du f (P) = lim ,
h→0 h
if the limit exists.
.

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 4 / 26


Suppose the function T (x , y , z) gives the temperature at points (x,y,z) in
space, and we might want to know the rate at which the temperature
changes as we move in a specific direction.

Let f : R n → R, let A ∈ R n , and let u ∈ R n be a vector that |u| = 1.


Then the directional derivative of f at A in the direction of the vector u is
defined to be:
d
Du f (A) = f (A + tu)|t=0
dt
or Using the chain rule, we have:

d
Du f (A) = f (A + tu)|t=0 = ▽f (A) · u
dt

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 5 / 26


Example

The temperature in space is given by T (x , y , z) = x 2 y + yz 3 . From


the point (1,1,1) in which direction does the temperature increases
most rapidly.
Solution
The directional derivative is given by ▽T · u = |▽T |cosθ, where θ is
the angle between ▽T and u. This would be largest when θ = 0.
Thus T increases most rapidly in the direction of the gradient of T.
The direction becomes [2xy , x 2 + z 3 , 3yz 2 ]. At (1,1,1), this becomes
[2,2,3]

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 6 / 26


Find the directional derivative given f (x , y , z) = x 2 z + y 3 z 2 − xyz in the
direction u = (−1, 0, 3)

Solution
First we find a unit vector in the direction of the vector given.



u = (−1,0,3)
√ = √1 (−1, 0, 3)
1+0+9 10

fx = 2xz − yz, fy = 3y 2 z 2 − xz, fz = x 2 + 2y 3 z − xy

−1 √3 (x 2
Du f = √
10
(2xz − yz) + 0(3y 2 z 2 − xz) + 10
+ 2y 3 z − xy )

Du f = √1 (−2xz + yz + 3x 2 + 6y 3 z − 3xy )
10

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 7 / 26


Find the directional derivatives of the following functions
1. Du f (1, 2) where f = x 2 y in the direction →

u = (3, 2)

2. Dv f (3, 1, 0) where f (x , y , z) = 4x − y 2 e xz in the direction




v = (−4, 4, 2)

3. Du f where f (x , y , z) = e 2x cos(y − 2z) in the direction →



u = (4, 4, 2)

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 8 / 26


Derivative f : R n → R p

Let f : D → R n , where D ⊂ R, and let Po ∈ int D. Then f is


differentiable at P0 if there is a linear function L such that
1
lim [f (P0 + h) − f (P0 ) − L(h)] = 0
h→0 |h|

The linear function L is called the Derivative of f at P0 and L is


represented by an P × n matrix.
NB: When n = p = 1, the matrix L is simply the 1 × 1 matrix whose entry
is the derivative of j.

Suppose j has a derivative at P0 . First, let


h = te = (0, 0, . . . , 0, t, 0, . . . , 0). Then

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 9 / 26


 
f1 (x1 , x2 , ldots, x + t, . . . xn )
f (P0 + h) = f (x1 , x2 , . . . , x1 + t, . . . , xn ) = f2 (x1 , x2 , ldots, x + t, . . . xn )
 
fn (x1 , x2 , ldots, x + t, . . . xn )

and
 
0
0
    
m11 m12 . . . m1n  m1j t
 ..  m t 

m21 m22 . . . m2n 

.  2j 
Lh = 
 .. .. ..  
 =
 .. 

 . . t
.    . 
 
.
mp1 mp2 mpn   ..  mpj t
0

where P0 = (x1 , x2 , . . . , . . . xn ), etc. Then

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 10 / 26


1
|h| [f (P0 + h) − f (P0 ) − L(h)] =
 
f1 (x1 , x2 , . . . , xj + t, . . . xn ) − f1 (x1 , x2 , . . . , . . . xn ) − m1j t
 f2 (x1 , x2 , . . . , xj + t, . . . xn ) − f2 (x1 , x2 , . . . xn ) − m2j t 
 
1
t  .. 
.

 
fp (x1 , x2 , . . . , xj + t, . . . xn ) − f2 (x1 , x2 , . . . xn ) − m2j t
 
f1 (x1 ,x2 ,...,xj +t,...xn )−f2 (x1 ,x2 ,...xn )
t − m1j
 f2 (x1 ,x2 ,...,xj +t,...xn )−f2 (x1 ,x2 ,...xn )


t − m2j 
=
 
.. 

 . 

fp (x1 ,x2 ,...,xj +t,...xn )−f2 (x1 ,x2 ,...xn )
t − mpj
For each component
(x ,x ,...,x +t,...xn )−f2 (x1 ,x2 ,...xn ) d
lim 1 2 j t = ds fi (x1 , x2 , ..., s, ..., xn )|s=xj
t→0
The above derivative is called the partial derivative of fi with respect to
the j th variable
M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 11 / 26
Example
" #
3x sinx2
Let f : R2→ R2be given by f (x1 , x2 ) = 3 1 . Assume f is
x1 + x1 x22
differentiable, find the derivative (more precisely, the matrix of the
derivatives) of f.

" #
Solution
m11 m12
L= . Now f1 (x1 , x2 ) = 3x1 sinx2 , and f2 (x1 , x2 ) = x13 + x1 x22
m21 m22
Computing the partial derivatives we have
δf1 δf1
δx1 = 3sinx2 δx2 = 3x1 cosx2
δf2 2 2 δf2 = 2x x
δx1 = 3x1 + x2
" x2 1 2
#
3sinx2 3x1 cosx2
∴L=
3x12 + x22 2x1 x2

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 12 / 26


Trial

Find all the first order partial derivatives of the given functions:
1. f (x , y ) = x 2 y 3

2. f (x , y , z) = x 2 yz + zcos(xy )
ysin(e x )
3. h(w , x , y , z) = y +z

xy (x 2 −y 2 )
4. w (x , y , z) = x 2 +y 2

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 13 / 26


Suppose x1 (t) for i = 1, . . . , n are the parametric equations of x1 . Let
f : D → R p , where D ⊂ R n and f is differentiable at P, then the total
differential of fis given by the p × 1 matrix dfdt(P) , i.e ,
dx1
  
m11 m12 . . . m1n dt
  dx

df (P)  m21 m22 . . . m2n   dt2 

= . .. .. 
  .. 
 
dt  .. . ... .  . 

mp1 mp2 . . . mpn dxn
dt

or   
m11 m12 . . . m1n dx1
df (P)  21 m22
m . . . m2n 
 dx2 
  

= . .. ..   .. 
 
dt  .. . ... .  . 

mp1 mp2 . . . mpn dxn

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 14 / 26


Chain Rule/Composite Functions

Chain Rule:
Let f : R n → R p and g : R p → R q . Suppose the derivative of f at A
is L and the derivative of g at f(A) is M. We now seek for the
derivative of the composite function g ◦ f : R n → R q at A. Let
r = g ◦ f and consider r (A + h) − r (A) = g(f (A + h)) − g(f (A)).

Example:
Let f (t) = (t 2 , 1 + t 3 ) and g(x1 , x2 ) = (2x1 − x2 )3 , and let r = g ◦ f .
Find the derivative of r at r=2.
Solution
df 2
dt = L = (2t, 3t ) and derivative of g is:
M = [6(2x1 − x2 )2 ) − 3(2x1 − x2 )2 ]
At r=2, L = (4, 12) and at g(f (2)) = g(4, 9)M = [6, −3]

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 15 / 26


" #
h i 4
ML = 6 −3 = −12
12
ALTERNATIVELY
r (t) = g(f (t)) = g(t 2 , 1 + t 3 ) = (2t 2 − 1 − t 3 )3 .

r (t) = 3(2t 2 − 1 − t 3 )2 (4t − 3t 2 )

r (2) = −12

Trial
Let f (x , y , z) = x 2 + y 2 + z 2 and g(s, t) = (e s cost, e s sint, t) find f ◦ g at
(s,t)=(1,3)

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 16 / 26


Normals to Surfaces

Let f : R 3 → R be a function and let c be some constant. The set


S = {(x , y , z) ∈ R 3 : f (x , y , z) = c} is called a level set, or level surface of
the function f.

Suppose r (t) = x (t)i + y (t)j + z(t)k describes a curve in R 3 that lies on


the surface S. This means that, f (r (t)) = f (x (t), y (t), z(t)) − c. Now
look at the derivative with respect to of this equation:
d
dt f (r (t)) = ∇f · ⃗
r (t) = 0

NB: The gradient ∇f is thus perpendicular, or normal to the surface


f (x , y , z) = c

Example: Find an equation for the plane tangent to the surface.


z = x 2 + 2y 2 at the point (1,1,3)

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 17 / 26


Solution
Let f (x , y , z) = z − x 2 + 2y 2 , ∇f (1, 1, 3) = [−2, −4, 1]. Hence equation
of tangent plane at (1,1,3) is
[−2, −4, 1] · [x − 1, y − 1, z − 3] = 0
−2(x − 1) − 4(y − 1) + 1(z − 3) = 0
TRIAL
1. Find equation for the plane tangent to the surface z = ln(x 2 + y 2 ) at
the point (1,0,0).

2. Find equation for the plane tangent to the surface x 2 + 3y 2 + 2z 2 = 12


at the point (1,-1,2)

3. Find equation for the plane tangent to the curve of intersection of the
surfaces x 3 + 3x 2 y 2 + y 3 + 4xy − z = 0 and x 2 + y 2 + z 2 − 11 at the
point (1,1,3)

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 18 / 26


Extrema (Maxima and Minima)

Relative Minimum:
A function f (x , y ) has a relative minimum at the point (a,b) if
f (x , y ) ≥ f (a, b) for all points (x,y) in some region around (a,b).
Relative Maximum:
A function f (x , y ) has a relative maximum at the point (a,b) if
f (x , y ) ≤ f (a, b) for all points (x,y) in some region around (a,b).
The point (a,b) is a critical point (or a stationary point) of f (x , y )
provided one of the following is true;
1. ∇f (a, b) = ⃗0 (this is equivalent to saying that fx = (a, b) = 0 and
fy (a, b) = 0 )
2. fx (a, b) and/or fy (a, b) does not exist

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 19 / 26


We define

D = D(a, b) = fxx (a, b)fyy (a, b) − [fxy (a, b)]2


We have the following classifications of the critical point.
1 If D > 0 and fxx (a, b) > 0 then there is a relative/local minimum at
(a,b)
2 If D > 0 and fxx (a, b) < 0 then there is a relative/local maximum at
(a,b)
3 If D < 0 then the point (a,b) is a saddle point.
4 If D = 0 then the point (a,b) may be local minimum, local maximum
or a saddle point. Other techniques would need to be used to classify
the critical point.

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 20 / 26


Find and classify all the critical points of

f (x , y ) = 4x 3 + y 3 − 3xy

Solution
fx2 − 3y , fxx = 6x , fy = 3y 2 − 3x , fyy = 6y , fxy = −3
Solving for the critical points, we solve fx and fy simultaneously.
3x 2 − 3y = 0 · · · (1)
3y 2 − 3x = 0 · · · (2)
Solving the two yields the critical points (0,0) and (1,1).
We then classify the points;
D = D(a, b) = fxx (a, b)fyy (a, b) − [fxy (a, b)]2
D1 = 6(0) · 6(0) − (−3)2 = −9
Hence D1 (0, 0) is a saddle point.
D2 = 6(1) · 6(1) − (−3)2 = 27 and fxx (1, 1) = 6
Hence D2 (1, 1) is a relative minimum.

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 21 / 26


TRIAL

Find all the critical points and describe them for the functions below

f (x , y ) = 3x 2 y + y 3 − 3x 2 − 3y 2 = 2

f (x , y ) = y − x 2

f (x , y ) = x 2 + 2xy

Determine the point on the plane 4x − 2y + z = 1 that is closest to


the point (-2,-1,5)

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 22 / 26


Least Square

Suppose we have a set of n points in the plane, say


(x1 , y1 ), (x2 , y2 ), · · · (xn , yn ), and we seek the straight line that best fits
this collection of points.
The line of best fits is the line that minimizes the sum of the squares of
the of the vertical distances from the points to the line.
We can describe all non-vertical lines in the world by means of two
variables traditionally called m and b.
Thus every such line has the form y = mx + b. Our quest is thus for the
values of m and b at which the function
n
X
f (m, b) = (mxi + b − yi )2
i=1

has its minimum value.

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 23 / 26


Applying the gradient brings about solving the two linear systems
n
X n
X n
X
m xi2 + b xi = xi yi
i=0 i=1 i=1

and
n
X n
X
m xi + nb = yi
n=1 i=1

simultaneously.

Example: Suppose we have the following table of values

xi 0 1 2 3 4 5 7 8 9 10 12 15
yi 1 2 4 3.5 5 4 7 9 12 18 21 29

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 24 / 26


Find the straight line that "best" fits this collection of points given in the
table above.

Solution

The linear system for m and b is

718m + 76bb = 1156.5


76m + 12b = 115.5

255
Solving this system simultaneously gives m = 142 and b = − 993
568 .

255 993
The line of of best fit becomes y = 142 x − 568

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 25 / 26


Trial

Suppose we have the following table of values

xi 1 75 155 219 271 351 425 503 575 626


yi 1761 1771 1772 1775 1777 1780 1783 1786 1789 1791
Find the line of best fit of the data above.

M. A. BOATENG, PhD., MIMA MULTIVARIATE CALCULUS UNIT TWO July 6, 2022 26 / 26

You might also like