0% found this document useful (0 votes)
3 views

Lecture_FuncMultiVariables

The document outlines the concepts and applications of multivariate calculus, specifically focusing on functions of several variables. It covers topics such as graphs, limits, continuity, partial derivatives, and optimization techniques like Lagrange multipliers. The document includes examples and illustrations to enhance understanding of these concepts.

Uploaded by

vuduchai.32.2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lecture_FuncMultiVariables

The document outlines the concepts and applications of multivariate calculus, specifically focusing on functions of several variables. It covers topics such as graphs, limits, continuity, partial derivatives, and optimization techniques like Lagrange multipliers. The document includes examples and illustrations to enhance understanding of these concepts.

Uploaded by

vuduchai.32.2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 145

Functions of several variables

Samy Tindel

Purdue University

Multivariate calculus - MA 261

Mostly taken from Calculus, Early Transcendentals


by Briggs - Cochran - Gillett - Schulz

Samy T. Several variables Multivariate calculus 1 / 145


Outline
1 Graphs and level curves
2 Limits and continuity
3 Partial derivatives
4 The chain rule
5 Directional derivatives and the gradient
6 Tangent plane and linear approximation
7 Maximum and minimum problems
8 Lagrange multipliers

Samy T. Several variables Multivariate calculus 2 / 145


Outline
1 Graphs and level curves
2 Limits and continuity
3 Partial derivatives
4 The chain rule
5 Directional derivatives and the gradient
6 Tangent plane and linear approximation
7 Maximum and minimum problems
8 Lagrange multipliers

Samy T. Several variables Multivariate calculus 3 / 145


Recalling functions of 1 variable (1)

Example of function:

y = f (x ) = 9 − x2

Questions:
1 Domain of f ?
2 Range of f ?

Samy T. Several variables Multivariate calculus 4 / 145


Recalling functions of 1 variable (2)

Recalling the function:



y = f (x ) = 9 − x2

Domain:
x ∈ [−3, 3]

Range:
y ∈ [0, 3]

Samy T. Several variables Multivariate calculus 5 / 145


Functions of 2 variables: example (1)

Example of function:
√ q
z = f (x , y ) = 9 − x2 − 25 − y 2

Questions:
1 Domain of f ?
2 Range of f ?

Samy T. Several variables Multivariate calculus 6 / 145


Functions of 2 variables: example (2)

Recalling the function:


√ q
z = f (x , y ) = 9 − x2 − 25 − y 2

Domain:
(x , y ) ∈ [−3, 3] × [−5, 5]

Range: Looking at lines x = ±3 and y = ±5, we get

y ∈ [−5, 3]

Samy T. Several variables Multivariate calculus 7 / 145


Contour and level curves

Definition 1.
Contour curve:
Intersection of the surface (x , y , f (x , y )) and plane z = z0

Level curve:
Projection of contour curve on xy -plane

Samy T. Several variables Multivariate calculus 8 / 145


Contour and level curves: illustration

Samy T. Several variables Multivariate calculus 9 / 145


Example of level curves (1)

Function:
f (x , y ) = y − x 2 − 1

Samy T. Several variables Multivariate calculus 10 / 145


Example of level curves (2)
Function:
f (x , y ) = y − x 2 − 1

Level curves: For z0 ∈ R, we get the parabola

y = x 2 + 1 + z0

Samy T. Several variables Multivariate calculus 11 / 145


Example 2 of level curves (1)

Function:  
f (x , y ) = exp −x 2 − y 2

Samy T. Several variables Multivariate calculus 12 / 145


Example 2 of level curves (2)
Function:  
f (x , y ) = exp −x 2 − y 2

Level curves: For z0 ∈ (0, 1], we get the circle

x 2 + y 2 = − ln(z0 )

Samy T. Several variables Multivariate calculus 13 / 145


Example 3 of level curves (1)

Function:
f (x , y ) = 2 + sin(x − y )

Samy T. Several variables Multivariate calculus 14 / 145


Example 3 of level curves (2)
Function:
f (x , y ) = 2 + sin(x − y )

Level curves:
For z0 ∈ [1, 3], we get a family of lines

Level curves for z0 = 2:

y = x − k π, k∈Z

Level curves for z0 = 1:


π
y =x− + 2k π, k∈Z
2

Samy T. Several variables Multivariate calculus 15 / 145


Example 3 of level curves (3)
Function:
f (x , y ) = 2 + sin(x − y )

Depiction of level curves:

Samy T. Several variables Multivariate calculus 16 / 145


Application of functions of 2 variables (1)

Situation:
Fraction of students infected by FV is r on 9/12
We have n random encounters with students on 9/12

Function:
The probability of meeting at least one student with FV is

p(n, r ) = 1 − (1 − r )n

This requires probability theory and is admitted


Question:
Draw level curves

Samy T. Several variables Multivariate calculus 17 / 145


Application of functions of 2 variables (2)

Function:
p(n, r ) = 1 − (1 − r )n

Useful values of z:
For p0 ∈ [0, 1], the curve p(n, r ) = p0 is non empty

Level curves for p0 ∈ [0, 1]:

r = 1 − (1 − p)1/n

Samy T. Several variables Multivariate calculus 18 / 145


Application of functions of 2 variables (3)
Function:
p(n, r ) = 1 − (1 − r )n

Depiction of level curves:

Samy T. Several variables Multivariate calculus 19 / 145


Application of functions of 2 variables (4)
Function:
p(n, r ) = 1 − (1 − r )n

Depiction of function:

Samy T. Several variables Multivariate calculus 20 / 145


Outline
1 Graphs and level curves
2 Limits and continuity
3 Partial derivatives
4 The chain rule
5 Directional derivatives and the gradient
6 Tangent plane and linear approximation
7 Maximum and minimum problems
8 Lagrange multipliers

Samy T. Several variables Multivariate calculus 21 / 145


Continuity for functions of 1 variable (1)

Limit: The assertion


lim f (x ) = L
x →a

means that f (x ) can be made as close to L as we wish


,→ by making x close to a

Remark: If limx →a f (x ) = L, then


the limit should not depend on the way x → a

Samy T. Several variables Multivariate calculus 22 / 145


Continuity for functions of 1 variable (2)

Continuity: The function f is continuous at point a if

lim f (x ) = f (a)
x →a

Examples of continuous functions:


Polynomials
sin, cos, exponential
Rational functions (on their domain)
Log functions (on their domain)

Samy T. Several variables Multivariate calculus 23 / 145


Continuity for functions of 2 variables (1)

Limit: The assertion

lim f (x , y ) = L
(x ,y )→(a,b)

means that f (x , y ) can be made as close to L as we wish


,→ by making (x , y ) close to (a, b)

Remark: If lim(x ,y )→(a,b) f (x , y ) = L, then


the limit should not depend on the way (x , y ) → (a, b)

Samy T. Several variables Multivariate calculus 24 / 145


Continuity for functions of 2 variables (2)

Continuity: The function f is continuous at point a if

lim f (x , y ) = f (a, b)
(x ,y )→(a,b)

Examples of continuous functions:


Polynomials
sin, cos, exponential
Rational functions (on their domain)
Log functions (on their domain)

Samy T. Several variables Multivariate calculus 25 / 145


Logarithmic example (1)

Function:
1 + y2
!
ln
x2

Problem: Continuity at point

(1, 0)

Samy T. Several variables Multivariate calculus 26 / 145


Logarithmic example (2)

Continuity: f is the log of a rational function


,→ Continuous wherever it is defined

Definition at point (1, 0): We have

f (1, 0) = 0

This is well defined

Conclusion: f is continuous at (1, 0), that is

lim f (x , y ) = f (1, 0) = 0
(x ,y )→(1,0)

Samy T. Several variables Multivariate calculus 27 / 145


Rational function example (1)

Function:
y 2 − 4x 2
f (x , y ) =
2x 2 + y 2

Problem: Continuity at point

(0, 0)

Samy T. Several variables Multivariate calculus 28 / 145


Rational function example (2)

Continuity: f is a rational function


,→ Continuous wherever it is defined

Definition at point (0, 0): We have


0
f (0, 0) =
0
This is not well defined, therefore general result cannot be applied

Samy T. Several variables Multivariate calculus 29 / 145


Rational function example (3)

Two paths: We have

y 2 − 4x 2
Along x = 0, lim = 1
(x ,y )→(0,0), x =0 2x 2 + y 2
y 2 − 4x 2
Along y = 0, lim = −2
(x ,y )→(0,0), y =0 2x 2 + y 2
We get 2 different limits

Conclusion:
f is not continuous at point (0, 0)

Samy T. Several variables Multivariate calculus 30 / 145


Another rational function example (1)

Function:
x2 − y2
f (x , y ) =
x +y

Problem: Continuity at point

(0, 0)

Samy T. Several variables Multivariate calculus 31 / 145


Another rational function example (2)

Continuity: f is a rational function


,→ Continuous wherever it is defined

Definition at point (0, 0): We have


0
f (0, 0) =
0
This is not well defined, therefore general result cannot be applied

Samy T. Several variables Multivariate calculus 32 / 145


Another rational function example (3)

Two paths: We have

x2 − y2
Along x = 0, lim = 0
(x ,y )→(0,0), x =0 x +y
x2 − y2
Along y = 0, lim = 0
(x ,y )→(0,0), y =0 x +y
We get the same limit

Partial conclusion:
This is not enough!

Samy T. Several variables Multivariate calculus 33 / 145


Another rational function example (4)
Next steps: Try different paths
y = x 2 , y = x 3 , etc
Those all give a 0 limit
This is still not enough

Key remark: If (x , y ) ̸= (0, 0) we have

x2 − y2
f (x , y ) = =x −y
x +y
The rhs above is continuous

Conclusion: We have

lim f (x , y ) = 0
(x ,y )→(0,0)

Samy T. Several variables Multivariate calculus 34 / 145


Outline
1 Graphs and level curves
2 Limits and continuity
3 Partial derivatives
4 The chain rule
5 Directional derivatives and the gradient
6 Tangent plane and linear approximation
7 Maximum and minimum problems
8 Lagrange multipliers

Samy T. Several variables Multivariate calculus 35 / 145


Motivation
Derivative for functions of 1 variable: Captures the rate of change

f (x + h) − f (x )
f ′ (x ) = lim
h→0 h

Rate of change in the 2-d case: Can be different in x and y directions


,→ Captured by partial derivatives

Samy T. Several variables Multivariate calculus 36 / 145


Partial derivatives

Definition 2.
Consider
f function of 2 variables
Then we set
f (x + h, y ) − f (x , y )
fx (x , y ) = lim
h→0 h
f (x , y + h) − f (x , y )
fy (x , y ) = lim
h→0 h

Samy T. Several variables Multivariate calculus 37 / 145


Some remarks on partial derivatives

Frozen and live variables:


In order to compute fx (x , y )
,→ the x variable is alive and the y variable is frozen
In order to compute fy (x , y )
,→ the y variable is alive and the x variable is frozen

Funny notation: For partial derivatives we also use


∂f ∂f
(x , y ) = fx (x , y ), (x , y ) = fy (x , y )
∂x ∂y

Samy T. Several variables Multivariate calculus 38 / 145


Example of computation (1)

Function:
f (x , y ) = x 8 y 5 + x 3 y

Samy T. Several variables Multivariate calculus 39 / 145


Example of computation (2)

Recall:
f (x , y ) = x 8 y 5 + x 3 y

Partial derivative fx :
fx = 8x 7 y 5 + 3x 2 y

Partial derivative fy :
fy = 5x 8 y 4 + x 3

Samy T. Several variables Multivariate calculus 40 / 145


Second example of computation (1)

Function:
f (x , y ) = e x sin(y )

Samy T. Several variables Multivariate calculus 41 / 145


Second example of computation (2)

Recall:
f (x , y ) = e x sin(y )

Partial derivative fx :
fx = e x sin(y )

Partial derivative fy :
fy = e x cos(y )

Samy T. Several variables Multivariate calculus 42 / 145


Second derivatives
Second derivative fxx , fyy :

∂ 2f ∂ 2f
fxx = (fx )x = , fyy = (fy )y =
∂x 2 ∂y 2

Second derivative fxy :

∂ 2f
fxy = (fx )y =
∂x ∂y

Second derivative fyx :

∂ 2f
fyx = (fy )x =
∂y ∂x

Samy T. Several variables Multivariate calculus 43 / 145


Example of second derivatives

Function:
f (x , y ) = e x sin(y )

Second derivative fxx :

fxx = (fx )x = e x sin(y )

Second derivative fxy :

fxy = (fx )y = e x cos(y )

Samy T. Several variables Multivariate calculus 44 / 145


Order of derivatives

On our running example: We have

fyx = (fy )x = e x cos(y ) = fxy

General result (Clairaut’s theorem):


For a smooth f , the order of the derivatives does not matter

fyx = fxy

Samy T. Several variables Multivariate calculus 45 / 145


Example of order of derivatives (1)

Function:
2y
f (x , y ) = e x

Problem: Check that


fyx = fxy

Samy T. Several variables Multivariate calculus 46 / 145


Example of order of derivatives (2)

Recall:
2y
f (x , y ) = e x

Partial derivative fx :
2y
fx = 2xy e x

Partial derivative fy :
2y
fy = x 2 e x

Mixed derivatives:
  2y
fyx = fxy = 2x x 2 y + 1 e x

Samy T. Several variables Multivariate calculus 47 / 145


Functions of 3 variables (1)

Basic rule: Functions of 3 variables are handled


,→ in the same way as functions of 2 variables

Example:
f (x , y , z) = xyz

First derivatives:

fx = yz, fy = xz, fz = xy

Samy T. Several variables Multivariate calculus 48 / 145


Functions of 3 variables (2)

Second derivatives: We have for instance

fxy = fyx = z

Third derivatives: The only non zero derivatives are

fxyz = fxzy = · · · = fzyx = 1

Samy T. Several variables Multivariate calculus 49 / 145


Outline
1 Graphs and level curves
2 Limits and continuity
3 Partial derivatives
4 The chain rule
5 Directional derivatives and the gradient
6 Tangent plane and linear approximation
7 Maximum and minimum problems
8 Lagrange multipliers

Samy T. Several variables Multivariate calculus 50 / 145


Chain rule for functions of 1 variable

Situation: We have
y = f (x )
x = g(t)

Chain rule:
dy dy dx
=
dt dx dt

Samy T. Several variables Multivariate calculus 51 / 145


Chain rule with 1 independent variable

Theorem 3.
Let
z = z(x , y )
x = x (t) and y = y (t)
z, x , y differentiable

Then
dz ∂z dx ∂z dy
= +
dt ∂x dt ∂y dt

Samy T. Several variables Multivariate calculus 52 / 145


Tree representation of chain rule (2d)

Samy T. Several variables Multivariate calculus 53 / 145


Tree representation of chain rule (3d)

Samy T. Several variables Multivariate calculus 54 / 145


Example of computation (1)
Functions: We consider

z = x 2 − 3y 2 + 20, x = 2 cos(t), y = 2 sin(t)

Derivative: We find
dz ∂z dx ∂z dy
= +
dt ∂x dt ∂y dt
= −16 sin(2t)

Particular value: It t = π4 , then

dz π
 
= −16
dt 4

Samy T. Several variables Multivariate calculus 55 / 145


Example of computation (2)
Other possible strategy:
1 Express z(x (t), y (t)) as a function F (t)
2 Differentiate as usual
Problem: this becomes impractical very soon.

Samy T. Several variables Multivariate calculus 56 / 145


Implicit differentiation

Theorem 4.
Let F (x , y ) be such that
F differentiable
The equation F (x , y ) = 0 defines y = y (x )
x 7→ y (x ) differentiable
Fy ̸= 0
Then we have
dy Fx
=−
dx Fy

Samy T. Several variables Multivariate calculus 57 / 145


Example of implicit differentiation (1)

Equation:
e y sin(x ) = x + xy

Problem: Find
dy
dx

Samy T. Several variables Multivariate calculus 58 / 145


Example of implicit differentiation (2)

Reformulation of the equation: F (x , y ) = 0 with

F (x , y ) = e y sin(x ) − x − xy

Implicit differentiation:

dy Fx e y cos(x ) − 1 − y
=− =−
dx Fy e y sin(x ) − x

Samy T. Several variables Multivariate calculus 59 / 145


Implicit differentiation with 3 variables (1)

Implicit equation: We consider


F (x , y , z) = xy + yz + xz
Equation: F (x , y ) = 3
The equation defines z = z(x , y )

Problem: Find
∂z
∂y

Samy T. Several variables Multivariate calculus 60 / 145


Implicit differentiation with 3 variables (2)

Implicit differentiation:
∂z Fy x +z
=− =−
∂y Fz y +x

Samy T. Several variables Multivariate calculus 61 / 145


Outline
1 Graphs and level curves
2 Limits and continuity
3 Partial derivatives
4 The chain rule
5 Directional derivatives and the gradient
6 Tangent plane and linear approximation
7 Maximum and minimum problems
8 Lagrange multipliers

Samy T. Several variables Multivariate calculus 62 / 145


Objective
Aim: Understand variations of a function
,→ In directions which are not parallel to the axes

Samy T. Several variables Multivariate calculus 63 / 145


Directional derivative

Definition 5.
Let
f differentiable function at (a, b)
u = ⟨u1 , u2 ⟩ unit vector in xy -plane
Then the directional derivative of f
in the direction of u at (a, b) is

f (a + hu1 , b + hu2 ) − f (a, b)


Du f (a, b) = lim
h→0 h

Samy T. Several variables Multivariate calculus 64 / 145


Computation of the directional derivative

Proposition 6.
Let
f differentiable function at (a, b)
u = ⟨u1 , u2 ⟩ unit vector in xy -plane
Then the directional derivative of f
in the direction of u at (a, b) is given by

Du f (a, b) = fx (a, b)u1 + fy (a, b)u2

Remark: One can also write

Du f (a, b) = ⟨fx (a, b), fy (a, b)⟩ · ⟨u1 , u2 ⟩

Samy T. Several variables Multivariate calculus 65 / 145


Example of directional derivative (1)

Function: Paraboloid of the form


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

Unit vector: * +
1 1
u= √ ,√
2 2

Problem: Compute the directional derivative

Du f (3, 2)

Samy T. Several variables Multivariate calculus 66 / 145


Example of directional derivative (2)

Function: Paraboloid of the form


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

Unit vector: * +
1 1
u= √ ,√
2 2

Directional derivative: We get


 * +
3 1 1 7

Du f (3, 2) = ,2 · √ , √ = √ ≃ 2.47
2 2 2 2 2

Samy T. Several variables Multivariate calculus 67 / 145


Example of directional derivative (3)

Samy T. Several variables Multivariate calculus 68 / 145


Gradient

Definition 7.
Let
f differentiable function at (x , y )
Then the gradient of f at (x , y ) is

∇f (x , y ) = ⟨fx (x , y ), fy (x , y )⟩

Samy T. Several variables Multivariate calculus 69 / 145


Example of gradient (1)

Function:
x 2 xy 2
f (x , y ) = 3 − +
10 10

Problem:
1 Compute ∇f (3, −1)
2 Compute the directional derivative of f
,→ at (3, −1) in the direction of the vector ⟨3, 4⟩

Samy T. Several variables Multivariate calculus 70 / 145


Example of gradient (2)

Gradient:
y 2 xy
* +
x
∇f (x , y ) = − + ,
5 10 5
Thus
1 3
 
∇f (3, −1) = − , −
2 5

Samy T. Several variables Multivariate calculus 71 / 145


Example of gradient (3)

Directional derivative: Unit vector in direction of ⟨3, 4⟩ is


3 4
 
u= ,
5 5
Thus directional derivative in direction of ⟨3, 4⟩ is

Du f (x , y ) = ∇f (x , y ) · u

We get
39
Du f (3, −1) = −
50

Samy T. Several variables Multivariate calculus 72 / 145


Interpretation of gradient
Remark: If
u is a unit vector
θ ≡ angle between u and ∇f (x , y )
Then
Du f (x , y ) = |∇f (x , y )| cos(θ)

Information given by the gradient


1 |∇f (x , y )| is the maximal possible directional derivative
∇f (x ,y )
2 The direction u = |∇f (x ,y )|
is the one of maximal ascent
∇f (x ,y )
3 The direction u = − |∇f (x ,y )|
is the one of maximal desccent
4 If u ⊥ ∇f (x , y ), the directional derivative is 0

Samy T. Several variables Multivariate calculus 73 / 145


Interpretation of gradient: illustration

Samy T. Several variables Multivariate calculus 74 / 145


Example of steepest descent (1)
Function:
f (x , y ) = 4 + x 2 + 3y 2

Questions:
1 If you are located on the paraboloid at the point (2, − 21 , 35
4
)
,→ In which direction should you move in order to ascend on the
surface at the maximum rate?
2 If you are located on the paraboloid at the point (2, − 21 , 35
4
)
,→ In which direction should you move in order to descend on
the surface at the maximum rate?
3 At the point (3, 1, 16), in what direction(s) is there no change
in the function values?

Samy T. Several variables Multivariate calculus 75 / 145


Example of steepest descent (2)
Gradient:
∇f (x , y ) = ⟨2x , 6y ⟩
Thus
1
 
∇f 2, − = ⟨4, −3⟩
2

Steepest ascent direction: We get


4 3
 
u= ,− ,
5 5
with rate of ascent
1
 
∇f 2, − =5
2

Samy T. Several variables Multivariate calculus 76 / 145


Example of steepest descent (3)

Steepest descent direction: We get


4 3
 
v = −u = − , ,
5 5
with rate of descent
1
 
− ∇f 2, − = −5
2

Samy T. Several variables Multivariate calculus 77 / 145


Example of steepest descent (4)

Samy T. Several variables Multivariate calculus 78 / 145


Example of steepest descent (5)

Gradient at point (3, 1): Recall that

∇f (x , y ) = ⟨2x , 6y ⟩

Thus
∇f (3, 1) = ⟨6, 6⟩

Direction of 0 change: Any direction ⊥ ⟨6, 6⟩


,→ Unit vectors given by
1 1
u = √ ⟨1, −1⟩ , √ ⟨−1, 1⟩
2 2

Samy T. Several variables Multivariate calculus 79 / 145


Example of steepest descent (6)

Samy T. Several variables Multivariate calculus 80 / 145


Gradient and level curves

Theorem 8.
Let
f differentiable function at (x , y )
Hypothesis: ∇f (a, b) ̸= 0
Then:

The line tangent to the level curve of f at (a, b)


is
orthogonal to ∇f (a, b)

Samy T. Several variables Multivariate calculus 81 / 145


Hyperboloid example (1)

Function: q
z = f (x , y ) = 1 + 2x 2 + y 2

Questions:
1 Verify that the gradient at (1, 1) is orthogonal to the
corresponding level curve at that point.
2 Find an equation of the line tangent to the level curve at (1, 1)

Samy T. Several variables Multivariate calculus 82 / 145


Hyperboloid example (2)

Samy T. Several variables Multivariate calculus 83 / 145


Hyperboloid example (3)
Point on surface:
Given by (1, 1, 2) =⇒ On level curve z = 2

Equation for level curve: Ellipse of the form

1 + 2x 2 + y 2 = 4 ⇐⇒ 2x 2 + y 2 = 3

Implicit derivative:
dy Fx 2x
=− =−
dx Fy y
Thus
dy
(1) = −2
dx

Samy T. Several variables Multivariate calculus 84 / 145


Hyperboloid example (4)
Tangent vector: Proportional to

t = ⟨1, −2⟩

Gradient of f :
* +
2x y
∇f (x , y ) = √ 2 2
, √
1 + 2x + y 1 + 2x 2 + y 2

Thus
1
 
∇f (1, 1) = 1,
2
Orthogonality: We have

t · ∇f (1, 1) = 0

Samy T. Several variables Multivariate calculus 85 / 145


Hyperboloid example (5)

Tangent line to level curve: At point (1, 1) we get

fx (1, 1)(x − 1) + fy (1, 1)(y − 1) = 0,

that is
y = −2x + 3

Samy T. Several variables Multivariate calculus 86 / 145


Generalization to 3 variables
Situation:
We have a function w = f (x , y , z)
Each w0 results in a level surface
f (x , y , z) = w0

Gradient on level surface:


Will be ⊥ to level surface

Samy T. Several variables Multivariate calculus 87 / 145


Example of tangent plane (1)

Function:
f (x , y , z) = xyz

Gradient:
∇f (x , y , z) = ⟨yz, xz, xy ⟩
Thus
∇f (1, 2, 3) = ⟨6, 3, 2⟩

Samy T. Several variables Multivariate calculus 88 / 145


Example of tangent plane (2)

Plane tangent to level surface:

⟨6, 3, 2⟩ · ⟨x − 1, y − 2, z − 3⟩ = 0

We get
6x + 3y + 2z = 18

Samy T. Several variables Multivariate calculus 89 / 145


Outline
1 Graphs and level curves
2 Limits and continuity
3 Partial derivatives
4 The chain rule
5 Directional derivatives and the gradient
6 Tangent plane and linear approximation
7 Maximum and minimum problems
8 Lagrange multipliers

Samy T. Several variables Multivariate calculus 90 / 145


Linear approximation for functions of 1 variable
Situation: We have
y = f (x )

Tangent vector at a:
t = (1, f ′ (a))

Linear approximation: Near a we have

f (x ) ≃ f (a) + f ′ (a)(x − a)

Samy T. Several variables Multivariate calculus 91 / 145


Tangent plane for F (x , y , z) = 0

Definition 9.
Let F (x , y , z) be such that
F differentiable at P(a, b, c)
∇F ̸= 0
S is the surface F (x , y , z) = 0
Then the tangent plane at (a, b, c) is given by

Fx (a, b, c)(x − a) + Fy (a, b, c)(y − b) + Fz (a, b, c)(z − c) = 0

Samy T. Several variables Multivariate calculus 92 / 145


Interpretation of tangent plane
Tangent plane as collection of tangent vectors: If
S is the surface F (x , y , z) = 0
r is a curve passing through (a, b, c) at time t
Then r′ (t) ∈ tangent plane

Samy T. Several variables Multivariate calculus 93 / 145


Example of tangent plane (1)

Surface: Ellipsoid of the form

x2 y2
F (x , y , z) = + + z2 − 1 = 0
9 25

Questions:
1 Tangent plane at (0, 4, 53 )
2 What tangent planes to S are horizontal?

Samy T. Several variables Multivariate calculus 94 / 145


Example of tangent plane (2)

Gradient: We have
2x 2y
 
∇F (x , y , z) = , , 2z
9 25
Thus
3 8 6
 
∇F (0, 4, ) = 0, ,
5 25 5

Tangent plane:
4y + 15z = 25

Samy T. Several variables Multivariate calculus 95 / 145


Example of tangent plane (3)

Samy T. Several variables Multivariate calculus 96 / 145


Example of tangent plane (4)

Horizontal plane: When the normal vector is of the form

n = (0, 0, c), with c ̸= 0

Horizontal tangent plane: When the normal vector ∇F is of the form

∇F (x , y , z) = (0, 0, c) ⇐⇒ Fx = 0, Fy = 0, Fz ̸= 0

Solutions: Horizontal tangent plane for

(0, 0, 1) and (0, 0, −1)

Samy T. Several variables Multivariate calculus 97 / 145


Tangent plane for z = f (x , y )

Definition 10.
Let f (x , y ) be such that
f differentiable at (a, b)
S is the surface z = f (x , y )
Then the tangent plane to S at (a, b, f (a, b)) is given by

z = fx (a, b) (x − a) + fy (a, b) (y − b) + f (a, b)

Samy T. Several variables Multivariate calculus 98 / 145


Example of tangent plane for z = f (x , y ) (1)

Surface: Paraboloid of the form

z = f (x , y ) = 32 − 3x 2 − 4y 2

Question:
Tangent plane at (2, 1, 16)

Samy T. Several variables Multivariate calculus 99 / 145


Example of tangent plane for z = f (x , y ) (2)

Partial derivatives: We have

fx = 6x , fy = −8y

Thus
fx (2, 1) = −12, fy (2, 1) = −8

Tangent plane:
z = −12x − 8y + 48

Samy T. Several variables Multivariate calculus 100 / 145


Linear approx for functions of 1 variable (Repeat)
Situation: We have
y = f (x )

Tangent vector at a:
t = (1, f ′ (a))

Linear approximation: Near a we have

f (x ) ≃ f (a) + f ′ (a)(x − a)

Samy T. Several variables Multivariate calculus 101 / 145


Linear approximation for functions of 2 variables

Definition 11.
Let f (x , y ) be such that
f differentiable at (a, b)
S is the surface z = f (x , y )
Then the linear approximation to S at (a, b, f (a, b)) is given by

L(x , y ) = fx (a, b) (x − a) + fy (a, b) (y − b) + f (a, b)

Remark: Another popular form of the linear approximation is

∆z ≃ fx dx + fy dy

Samy T. Several variables Multivariate calculus 102 / 145


Example of infinitesimal change (1)

Function:
z = f (x , y ) = x 2 y

Question: Evaluate the percentage of change in z if


x is increased by 1%
y is decreased by 3%

Samy T. Several variables Multivariate calculus 103 / 145


Example of infinitesimal change (2)
Small change in z:

dz ≃ fx dx + fy dy = 2xy dx + x 2 dy

Small percentage change in z:

dz 2xy x2 2 1
= dx + dy = dx + dy
z z z x y

dx dy
If x
= .01 and y
= −.03:

dz
= −.01 = −1%
z

Samy T. Several variables Multivariate calculus 104 / 145


Outline
1 Graphs and level curves
2 Limits and continuity
3 Partial derivatives
4 The chain rule
5 Directional derivatives and the gradient
6 Tangent plane and linear approximation
7 Maximum and minimum problems
8 Lagrange multipliers

Samy T. Several variables Multivariate calculus 105 / 145


Max and min for functions of 1 variable

Situation: We have
y = f (x )

Critical point: (c, f (c)) whenever

f ′ (c) = 0

Second derivative test: If (c, f (c)) is critical then


1 If f ′′ (c) > 0, there is a local minimum
2 If f ′′ (c) < 0, there is a local maximum
3 If f ′′ (c) = 0, the test is inconclusive

Samy T. Several variables Multivariate calculus 106 / 145


Critical points for functions of 2 variables

Definition 12.
Let
f function of 2 variables
(a, b) interior point in the domain of f
Then (a, b) is a critical point of f if

fx (a, b) = 0, and fy (a, b) = 0,

or if one of the partial derivatives fx , fy does not exist at (a, b)

Samy T. Several variables Multivariate calculus 107 / 145


Second derivative test

Theorem 13.
For f twice diff. function, define the discriminant of f as

D(x , y ) = fxx (x , y )fyy (x , y ) − (fxy (x , y ))2

Then for a critical point (a, b) the following holds true:


1 If D(a, b) > 0 and fxx (a, b) < 0, we have a local max
2 If D(a, b) > 0 and fxx (a, b) > 0, we have a local min
3 If D(a, b) < 0, we have a saddle point
4 If D(a, b) = 0, the test is inconclusive

Samy T. Several variables Multivariate calculus 108 / 145


Saddle point for an hyperboloid

Samy T. Several variables Multivariate calculus 109 / 145


Hyperboloids in architecture

Samy T. Several variables Multivariate calculus 110 / 145


Hyperboloids in the food industry

Samy T. Several variables Multivariate calculus 111 / 145


Example of critical points analysis (1)

Function:
f (x , y ) = x 2 + 2y 2 − 4x + 4y + 6

Problem:
Use second derivative test to classify the critical points of f

Samy T. Several variables Multivariate calculus 112 / 145


Example of critical points analysis (2)

Partial derivatives:

fx = 2x − 4, fy = 4y + 4

Critical point:
(2, −1)

Critical value of f :
f (2, −1) = 0

Samy T. Several variables Multivariate calculus 113 / 145


Example of critical points analysis (3)

Second derivatives:

fxx = 2, fxy = fyx = 0, fyy = 4

Discriminant:
D(x , y ) = 8 > 0

Second derivative test: We have

D(2, −1) > 0, fxx (2, −1) > 0 =⇒ Local minimum at (2, −1)

Samy T. Several variables Multivariate calculus 114 / 145


Example of critical points analysis (4)

Samy T. Several variables Multivariate calculus 115 / 145


Second example (1)

Function:
f (x , y ) = xy (x − 2)(y + 3)

Problem:
Use second derivative test to classify the critical points of f

Samy T. Several variables Multivariate calculus 116 / 145


Second example (2)

Partial derivatives:

fx = 2y (x − 1)(y + 3), fy = x (x − 2)(2y + 3)

Critical points:
3
(0, 0), (2, 0), (1, − ), (0, −3), (2, −3),
2

Samy T. Several variables Multivariate calculus 117 / 145


Second example (3)
Second derivatives:

fxx = 2y (y + 3), fxy = 2(2y + 3)(x − 1), fyy = 2x (x − 2)

Analysis of critical points:


(x , y ) D(x , y ) fxx Conclusion
(0, 0) −36 0 Saddle point
(2, 0) −36 0 Saddle point
(1, −3/2) 9 −9/2 Local maximum
(0, −3) −36 0 Saddle point
(2, −3) −36 0 Saddle point

Samy T. Several variables Multivariate calculus 118 / 145


Second example (4)

Samy T. Several variables Multivariate calculus 119 / 145


Absolute maximum

Proposition 14.
Let
f continuous function of 2 variables
R closed region of R2
In order to find the maximum of f in R, we proceed as follows:
1 Determine the values of f at all critical points in R.
2 Find the maximum and minimum values of f on the
boundary of R.
3 The greatest function value found in Steps 1 and 2 is the
absolute maximum value of f on R.

Samy T. Several variables Multivariate calculus 120 / 145


Example of global maximum (1)

Function:
z = f (x , y ) = x 2 + y 2 − 2x − 4y

Region:

R = {(x , y ); (x , y ) within triangle with vertices (0, 0), (0, 4), (4, 0)}

Question:
Find global maximum of f on region R

Samy T. Several variables Multivariate calculus 121 / 145


Example of global maximum (2)

Partial derivatives:

fx = 2x − 2, fy = 2y − 4

Critical point:
(1, 2), with f (1, 2) = −5

Samy T. Several variables Multivariate calculus 122 / 145


Example of global maximum (3)

Boundary 1: On y = 0, 0 ≤ x ≤ 4 we have

f (x , y ) = x 2 − 2x ≡ g(x ), g ′ (x ) = 2(x − 1)

Points of interest on boundary 1: We get

(0, 0), (1, 0), (0, 4)

and
f (0, 0) = 0, f (1, 0) = −1, f (4, 0) = 8

Samy T. Several variables Multivariate calculus 123 / 145


Example of global maximum (4)

Boundary 2: On y = 4 − x , 0 ≤ x ≤ 4 we have

f (x , y ) = 2x 2 − 6x ≡ h(x ), h′ (x ) = 4x − 6

Points of interest on boundary 2: We get


3 5
 
(0, 4), , , (4, 0)
2 2
and
3 5 9
 
f (0, 4) = 0, f , =− , f (4, 0) = 8
2 2 2

Samy T. Several variables Multivariate calculus 124 / 145


Example of global maximum (5)

Boundary 3: On x = 0, 0 ≤ y ≤ 4 we have

f (x , y ) = y 2 − 4y ≡ k(y ), k ′ (y ) = 2(y − 2)

Points of interest on boundary 3: We get

(0, 0), (0, 2), (0, 4)

and
f (0, 0) = 0, f (0, 2) = −4, f (0, 4) = 0

Samy T. Several variables Multivariate calculus 125 / 145


Example of global maximum (6)
Summary of points of interest:

f (0, 0) = 0, f (1, 0) = −1, f (4, 0) = 8


3 5 9
 
f (0, 4) = 0, f , =− , f (4, 0) = 8
2 2 2
f (0, 0) = 0, f (0, 2) = −4, f (0, 4) = 0, f (1, 2) = −5

Absolute minimum: at (1, 2) and

f (1, 2) = −5

Absolute maximum: at (4, 0) and

f (4, 0) = 8

Samy T. Several variables Multivariate calculus 126 / 145


Outline
1 Graphs and level curves
2 Limits and continuity
3 Partial derivatives
4 The chain rule
5 Directional derivatives and the gradient
6 Tangent plane and linear approximation
7 Maximum and minimum problems
8 Lagrange multipliers

Samy T. Several variables Multivariate calculus 127 / 145


Global aim

Objective function:
f = f (x , y )

Constraint: We are moving on a curve of the form

g(x , y ) = 0

Optimization problem: Find

max f (x , y ), subject to g(x , y ) = 0

Samy T. Several variables Multivariate calculus 128 / 145


Optimization problem: illustration

Samy T. Several variables Multivariate calculus 129 / 145


Lagrange multipliers intuition (1)

Samy T. Several variables Multivariate calculus 130 / 145


Lagrange multipliers intuition (2)
Some observations from the picture:
1 P(a, b) on the level curve of f
=⇒ Tangent to level curve ⊥ ∇f (a, b)
2 P(a, b) gives a maximum of f on curve C
=⇒ Tangent to level curve ∥ Tangent to constraint curve
3 Constraint is g(x , y ) = 0
=⇒ Tangent to constraint curve ⊥ ∇g(a, b)

Conclusion (Lagrange’s idea):


At the maximum under constraint we have

∇f (a, b) ∥ ∇g(a, b)

Samy T. Several variables Multivariate calculus 131 / 145


Lagrange multipliers procedure

Optimization problem: Find

max f (x , y ), subject to g(x , y ) = 0

Recipe:
1 Find the values of x , y and λ such that

∇f (x , y ) = λ∇g(x , y ), and g(x , y ) = 0

2 Select the largest and smallest corresponding function values.


,→ We get absolute max and min values of f s.t constraint.

Samy T. Several variables Multivariate calculus 132 / 145


Example of Lagrange multipliers (1)

Optimization problem: Find

max f (x , y ), with f (x , y ) = x 2 + y 2 + 2,

subject to the constraint

g(x , y ) = x 2 + xy + y 2 − 4 = 0

Samy T. Several variables Multivariate calculus 133 / 145


Example of Lagrange multipliers (2)

Computing the gradients: We get

∇f (x , y ) = ⟨2x , 2y ⟩ , ∇g(x , y ) = ⟨2x + y , x + 2y ⟩

Lagrange constraint 1:

fx = λgx ⇐⇒ 2x = λ (2x + y ) (1)

Lagrange constraint 2:

fy = λgy ⇐⇒ 2y = λ (x + 2y ) (2)

Samy T. Several variables Multivariate calculus 134 / 145


Example of Lagrange multipliers (3)

System for x , y : Gathering (1) and (2), we get

2(λ − 1)x + λy = 0, λx + 2(λ − 1)y = 0

This has solution (0, 0) unless


2
λ = 2, or λ =
3

Samy T. Several variables Multivariate calculus 135 / 145


Example of Lagrange multipliers (4)

Case λ = 2: We get x = −y . The constraint

x 2 + xy + y 2 − 4 = 0

becomes
x2 − 4 = 0
Solutions:
x = 2, and x = −2

Corresponding values of f : We have

f (2, −2) = f (−2, 2) = 10

Samy T. Several variables Multivariate calculus 136 / 145


Example of Lagrange multipliers (5)
Case λ = 23 : We get x = y . The constraint

x 2 + xy + y 2 − 4 = 0

becomes
3x 2 − 4 = 0
Solutions:
2 2
x=√ , and x = − √
3 3
Corresponding values of f : We have
! !
2 2 2 2 14
f √ ,√ =f −√ , −√ =
3 3 3 3 3

Samy T. Several variables Multivariate calculus 137 / 145


Example of Lagrange multipliers (6)

Absolute maximum:
For function f on the curve C defined by g = 0,

Maximum = 10, obtained for (2, −2) , (−2, 2)

Absolute minimum:
For function f on the curve C defined by g = 0,
! !
14 2 2 2 2
Minimum = , obtained for √ ,√ , −√ , −√
3 3 3 3 3

Samy T. Several variables Multivariate calculus 138 / 145


Example of Lagrange multipliers (7)

Samy T. Several variables Multivariate calculus 139 / 145


Optimization in dimension 3 (1)

Problem: Find the point on the sphere

x 2 + y 2 + z 2 = 1,

closest to the point


(1, 2, 3)

Samy T. Several variables Multivariate calculus 140 / 145


Optimization in dimension 3 (2)

Related minimization problem:


Find

min f (x , y ), with f (x , y ) = (x − 1)2 + (y − 2)2 + (z − 3)2 ,

subject to the constraint

g(x , y ) = x 2 + y 2 + z 2 − 1 = 0

Samy T. Several variables Multivariate calculus 141 / 145


Optimization in dimension 3 (3)

Computing the gradients: We get

∇f (x , y ) = ⟨2(x − 1), 2(y − 2), 2(z − 3)⟩


∇g(x , y ) = ⟨2x , 2y , 2z⟩

Lagrange constraint: We have

∇f (x , y ) = λ ∇g(x , y )
⇐⇒
(λ − 1)x = −1, (λ − 1)y = −2, (λ − 1)z = −3

Samy T. Several variables Multivariate calculus 142 / 145


Optimization in dimension 3 (4)

Solutions of Lagrange constraints:


The Lagrange system has unique solution whenever λ ̸= 1. We get
1 2 1
x =− , y =− = 2x , z =− = 3x
λ−1 λ−1 λ−1

Reporting in constraint g: We have

y = 2x , z = 3x , g(x , y ) = 0,

Thus we get
14x 2 = 1

Samy T. Several variables Multivariate calculus 143 / 145


Optimization in dimension 3 (5)

Solutions:
1 1
x=√ , and x = − √
14 14

Corresponding values of f : We have


!
1 2 3
f √ ,√ ,√ ≃ 7.51
14 14 14
!
1 2 3
f −√ , −√ , −√ ≃ 22.48
14 14 14

Samy T. Several variables Multivariate calculus 144 / 145


Optimization in dimension 3 (6)

Absolute maximum:
Maximal distance from (1, 2, 3) to a point on the sphere is
!
1 2 3
Maximum = 4.74, obtained for −√ , −√ , −√
14 14 14

Absolute minimum:
Minimal distance from (1, 2, 3) to a point on the sphere is

!
1 2 3
Minimum = 2.74 = 7.51, obtained for √ ,√ ,√
14 14 14

Samy T. Several variables Multivariate calculus 145 / 145

You might also like