0% found this document useful (0 votes)
8 views33 pages

Directional Derivative-2

The document discusses directional derivatives, which extend partial derivatives to measure the rate of change of a function in a specified direction. It includes definitions, formulas using gradients, geometric interpretations, and examples, particularly focusing on the function f(x, y) = x^2 + y^2. Additionally, it explores concepts such as steepest ascent and descent, and provides problems related to tangent vectors and gradients in various contexts.

Uploaded by

saeed032098
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)
8 views33 pages

Directional Derivative-2

The document discusses directional derivatives, which extend partial derivatives to measure the rate of change of a function in a specified direction. It includes definitions, formulas using gradients, geometric interpretations, and examples, particularly focusing on the function f(x, y) = x^2 + y^2. Additionally, it explores concepts such as steepest ascent and descent, and provides problems related to tangent vectors and gradients in various contexts.

Uploaded by

saeed032098
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/ 33

Functions of several variables

Dr. Jamshed Khan


Lecturer in Mathematics
GPGC Lakki Marwat
January 12, 2025

Directional Derivatives
Directional derivatives are an extension of partial derivatives that measure the rate of change of a func-
tion f (x, y, z) in a given direction, rather than along the coordinate axes.

Definition
| {z }
The directional derivative of a scalar-valued function f (x1 , x2 , . . . , xn ) at a point p = (p1 , p2 , . . . , pn )
in the direction of a unit vector u = (u1 , u2 , . . . , un ) is defined as:

f (p + tu) − f (p)
Du f (p) = lim .
t→0 t
Formula Using the Gradient

The directional derivative can also be expressed in terms of the gradient of f :

Du f (p) = ∇f (p) · u,

where:
• ∇f (p) is the gradient of f at p, defined as:
 
∂f ∂f ∂f
∇f (p) = , ,..., .
∂x1 ∂x2 ∂xn

• u is a unit vector indicating the direction.


If u is not a unit vector, normalize it first by dividing it by its magnitude:
v
q
u= , kvk = v12 + v22 + · · · + vn2 .
kvk

Geometric Interpretation

• The gradient ∇f (p) points in the direction of the steepest increase of f at p.


• The magnitude of the directional derivative Du f (p) gives the rate of change of f in the direction
of u.
• If u points perpendicular to ∇f (p), the directional derivative is zero, indicating no change in f
along that direction.

Example

Let f (x, y) = x2 + y 2 , and let p = (1, 2). Find the directional derivative of f in the direction of
u = (3, 4).

1
1. Compute the gradient:  
∂f ∂f
∇f (x, y) = , = (2x, 2y).
∂x ∂y
At p = (1, 2),
∇f (1, 2) = (2 · 1, 2 · 2) = (2, 4).

2. Normalize u:  
p 3 4
kuk = 32 + 42 = 5, u= , .
5 5

3. Compute the directional derivative:


 
3 4 6 16 22
Du f (p) = ∇f (p) · u = (2, 4) · , = + = .
5 5 5 5 5

22
The rate of change of f at p in the direction of u is 5 .

Problem: Find a tangent vector to z = x2 + y 2 at (1, 2) in the direction of the vector h3, 4i and
show that it is parallel to the tangent plane at that point.

Solution:

The given surface is z = x2 + y 2 , which can also be written in implicit form as:

F (x, y, z) = x2 + y 2 − z.

Step 1: First, we calculate the gradient of F , which is given by:


 
∂F ∂F ∂F
∇F (x, y, z) = , , .
∂x ∂y ∂z

The partial derivatives are:


∂F ∂F ∂F
= 2x, = 2y, = −1.
∂x ∂y ∂z
Thus, the gradient is:
∇F (x, y, z) = h2x, 2y, −1i.
At the point (1, 2), the gradient becomes:

∇F (1, 2, 5) = h2(1), 2(2), −1i = h2, 4, −1i.

This represents the normal to the tangent plane at (1, 2).


Step 2: Next, we find the tangent vector to the surface z = x2 + y 2 at (1, 2, 5) in the direction of h3, 4i.
First, we normalize h3, 4i: p
kh3, 4ik = 32 + 42 = 5.
The unit vector in the direction of h3, 4i is:
 
3 4
u= , .
5 5

To convert this into tangent vector, we adding the z-component.


Since the slope of z = x2 + y 2 is given by,
6 16 22
h2, 4i · h3/5, 4/5i = + = .
5 5 5
Thus, the tangent vector is:
3 4 22
v = h , , i.
5 5 5

2
Step 3: To show that the tangent vector is parallel to the tangent plane, consider the dot product
of the tangent vector and normal vector to the surface:
3 4 22 6 16 22
h2, 4, −1i · h , , i = + − = 0.
5 5 5 5 5 5
Since the dot product of tangent vector and normal vector turns out to be zero. Therefore, the tangent
vector is parallel to the tangent plane.

Direction of Steepest Ascent and Descent:


| {z }

• Points in the direction of steepest ascent (maximum rate of increase of f ).


• Opposite of the gradient (−∇f (x, y)) points in the direction of steepest descent (maximum rate of
decrease of f ).
1. Gradient Vector (∇f (x, y)):

(a) If f is a function of x and y, then the gradient of f is defined by:

∇f (x, y) = fx (x, y)i + fy (x, y)j.

(b) If f is a function of x, y, and z, then the gradient of f is defined by:

∇f (x, y, z) = fx (x, y, z)i + fy (x, y, z)j + fz (x, y, z)k.

2. Directional Derivative Formula:

Du f = ∇f · u = k∇f k cos θ

• θ is the angle between the gradient (∇f ) and the unit vector u (direction of motion).
3. Key Angles:

• θ = 0◦ : Steepest ascent (∇f direction).

• θ = 180◦ : Steepest descent (−∇f direction).


• θ = 90◦ : Flat slope (perpendicular to ∇f , tangent to level curves).
4. Flat Slope Directions:

• In directions perpendicular to ∇f (x, y), the slope is zero (Du f = 0).


• These directions lie along level curves in 2D or the tangent plane in 3D.
5. 3D Case:

• The gradient ∇f (x, y, z) is normal (perpendicular) to the tangent plane of the surface.
Question 1:
Investigate the direction of steepest ascent and descent for z = x2 + y 2 .
Solution:
We are solving for the directions of steepest ascent and descent of z = x2 + y 2 .
Step 1: Compute the Gradient The gradient ∇f (x, y) is given by:
 
∂f ∂f
∇f (x, y) = , .
∂x ∂y

3
For f (x, y) = x2 + y 2 :
∂f ∂f
= 2x, = 2y.
∂x ∂y
Thus,
∇f (x, y) = h2x, 2yi = 2hx, yi.
Step 2: Direction of Steepest Ascent
The direction of steepest ascent is given by the gradient ∇f (x, y). Since ∇f (x, y) = 2hx, yi, the direction
of steepest ascent is directly away from the origin at any point (x, y).
Step 3: Direction of Steepest Descent
The direction of steepest descent is opposite to the gradient, −∇f (x, y). Hence, the direction of steepest
descent is directly toward the origin.
Step 4: Special Case at the Origin
At the origin (0, 0):
∇f (0, 0) = h0, 0i.
Since the gradient is zero, there is no direction of ascent or descent at this point. The surface
z = x2 + y 2 has a minimum at the origin, and the slope is flat in all directions.
Step 5: Perpendicular Directions (Flat Slope)
The slope is zero in directions perpendicular to the gradient ∇f (x, y). A vector perpendicular to
∇f (x, y) = h2x, 2yi can be:
hy, −xi or h−y, xi.
These vectors are tangent to the level curve z = constant, meaning the surface is flat in these directions.
Question:2
Suppose the temperature at a point in space is given by:
T0
T (x, y, z) = ,
1 + x2 + y 2 + z 2
where T0 > 0 is the temperature at the origin. The temperature decreases as we move farther from the
origin. Find the gradient of T and explain its significance.
Solution:
We are solving to find the gradient of T (x, y, z) and interpreting its physical meaning.
Step 1: Temperature Function
The temperature at a point (x, y, z) is given by:

T0
T (x, y, z) = ,
1+ x2 + y2 + z2

where T0 > 0 is the temperature at the origin, and the denominator 1+x2 +y 2 +z 2 causes the temperature
to decrease as the distance from the origin increases.
Step 2: Compute the Gradient
The gradient ∇T represents the direction of the steepest increase in temperature. To compute it, we
find the partial derivatives of T with respect to x, y, and z.
∂T −2T0 x ∂T −2T0 y ∂T −2T0 z
= , = , = .
∂x (1 + x2 + y 2 + z 2 )2 ∂y (1 + x2 + y 2 + z 2 )2 ∂z (1 + x2 + y 2 + z 2 )2
Thus, the gradient is:
 
−2T0 x −2T0 y −2T0 z
∇T = , , .
(1 + x2 + y 2 + z 2 )2 (1 + x2 + y 2 + z 2 )2 (1 + x2 + y 2 + z 2 )2

Factoring out the common term, this can be rewritten as:


−2T0
∇T = hx, y, zi.
(1 + x2
+ y 2 + z 2 )2

Step 3: Direction of the Gradient


(i) . The gradient ∇T points directly toward the origin from any point (x, y, z).

4
(ii). Physically, this means that by moving directly toward the heat source at the origin, the temperature
increases as quickly as possible.
(iii). Conversely, moving away from the origin decreases the temperature most rapidly.

Question:3 Find the points on the surface defined by

x2 + 2y 2 + 3z 2 = 1

where the tangent plane is parallel to the plane defined by:

3x − y + 3z = 1.

Solution:
We need to find points on the surface x2 + 2y 2 + 3z 2 = 1 where the tangent plane is parallel to the
given plane.
Step 1: Condition for Parallel Planes
Two planes are parallel if their normal vectors are parallel or anti-parallel. - The normal vector of the
given plane 3x − y + 3z = 1 is h3, −1, 3i. - The tangent plane to the surface x2 + 2y 2 + 3z 2 = 1 at any
point has a normal vector given by the gradient of f = x2 + 2y 2 + 3z 2 , which is:

∇f = h2x, 4y, 6zi.

We are looking for points where:

∇f = kh3, −1, 3i, for some scalar k.

Step 2: Set Up the Equations


If ∇f = kh3, −1, 3i, then:
2x = 3k, 4y = −k, 6z = 3k.
Solving for x, y, z in terms of k:
3k −k 3k k
x= , y= , z= = .
2 4 6 2
Step 3: Use the Surface Equation
The points must also lie on the surface x2 + 2y 2 + 3z 2 = 1. Substituting x, y, z into this equation:
 2  2  2
3k −k k
+2 +3 = 1.
2 4 2
Simplify each term:
2 2  2
9k 2 2k 2 k2 3k 2
 
3k −k k
= , 2 = = , 3 = .
2 4 4 16 8 2 4
Add these terms:
9k 2 k2 3k 2
+ + = 1.
4 8 4
Combine into a single fraction:

9k 2 3k 2 12k 2 k2 24k 2 k2 25k 2


+ = = 3k 2 , so 3k 2 + = + = .
4 4 4 8 8 8 8
Equating to 1: √
25k 2 2 8 2 2
=1 =⇒ k = =⇒ k=± .
8 25 5
Step 4: Solve for Points

−k
Using k = ± 2 5 2 , substitute back into x = 3k k
2 , y = 4 , z = 2:

2 2
For k = 5 :
√ √ √ √ √ √
3 2 2 3 2 −1 2 2 − 2 1 2 2 2
x= · = , y= · = , z= · = .
2 5 5 4 5 10 2 5 5

5

For k = − 2 5 2 :
√ ! √ √ ! √ √ ! √
3 2 2 3 2 −1 2 2 2 1 2 2 2
x= · − =− , y= · − = , z= · − =− .
2 5 5 4 5 10 2 5 5

Question:4
Find Du f for f (x, y) = x2 + xy + y 2 in the direction of v = h2, 1i at the point (1, 1).

Solution:

Step 1: Calculate the Gradient ∇f


I start with the given function f (x, y) = x2 + xy + y 2 . I calculate the partial derivatives:

∂ 2 ∂ 2
fx = (x + xy + y 2 ) = 2x + y, fy = (x + xy + y 2 ) = x + 2y.
∂x ∂y
So, the gradient is:
∇f = h2x + y, x + 2yi.
At the point (1, 1), substituting x = 1 and y = 1:

∇f = h2(1) + 1, 1 + 2(1)i = h3, 3i.

Step 2: Find the Unit Vector u


The direction vector is v = h2, 1i. To find the unit vector u, I calculate the magnitude of v:
p √ √
kvk = 22 + 12 = 4 + 1 = 5.

Then, divide v by its magnitude to get the unit vector:


 
v 2 1
u= = √ ,√ .
kvk 5 5
Step 3: Compute the Dot Product
Now, I use the formula Du f = ∇f · u. Substitute ∇f = h3, 3i and u = h √25 , √15 i:
 
2 1
Du f = h3, 3i · √ ,√ .
5 5
Compute the dot product:
2 1 6 3 9
Du f = 3 · √ + 3 · √ = √ + √ = √ .
5 5 5 5 5
To rationalize the denominator:
√ √
9 5 9 5
Du f = √ · √ = .
5 5 5

Question:5 Find Du f for f (x, y) = ex cos(y) in the direction 30◦ from the positive x-axis at the
point (1, π4 ).
Solution:

Step 1: Compute the Gradient ∇f


The given function is f (x, y) = ex cos(y). First, calculate the partial derivatives:

∂ x ∂ x
fx = (e cos(y)) = ex cos(y), fy = (e cos(y)) = −ex sin(y).
∂x ∂y
So, the gradient is:
∇f = hex cos(y), −ex sin(y)i.

6
At the point (1, π4 ), substitute x = 1 and y = π4 :
π π
∇f = he1 cos , −e1 sin i.
4 4
 √
Using the trigonometric values cos π4 = sin π4 = 22 :


√ √ √ √
2 2 e 2 e 2
∇f = he · , −e · i=h ,− i.
2 2 2 2
Step 2: Find the Unit Vector u
The direction is 30◦ from the positive x-axis. The unit vector u in this direction is:

u = hcos(30◦ ), sin(30◦ )i.



Using the trigonometric values cos(30◦ ) = 2
3
and sin(30◦ ) = 21 :

3 1
u=h , i.
2 2
Step 3: Compute the Dot Product
√ √ √
Now, use the formula Du f = ∇f · u. Substitute ∇f = h e 2 2 , − e 2 2 i and u = h 3 1
2 , 2 i:
* √ √ + *√ +
e 2 e 2 3 1
Du f = ,− · , .
2 2 2 2

Compute the dot product:


√ √ √ !
e 2 3 e 2 1
Du f = · + − · .
2 2 2 2
Simplify: √ √ √
e 2· 3 e 2·1
Du f = − .
4 4

e 2
Factor out 4 : √
e 2 √ 
Du f = 3−1 .
4
Question:6
The temperature of a thin plate in the x-y plane is T (x, y) = x2 + y 2 . How fast does the temperature
change at the point (1, 5) moving in a direction 30◦ from the positive x-axis?
Solution :

Step 1: Compute the gradient ∇T .


The temperature function is T (x, y) = x2 + y 2 . Now, I find the partial derivatives:

∂ 2 ∂ 2
Tx = (x + y 2 ) = 2x, Ty = (x + y 2 ) = 2y.
∂x ∂y
So, the gradient is:
∇T = h2x, 2yi.
At the point (1, 5), substituting x = 1 and y = 5:

∇T = h2(1), 2(5)i = h2, 10i.

Step 2: Find the unit vector u.


The direction is 30◦ from the positive x-axis. The unit vector in this direction is:

u = hcos(30◦ ), sin(30◦ )i.

7

Using the trigonometric values cos(30◦ ) = 2
3
and sin(30◦ ) = 12 :

3 1
u=h , i.
2 2
Step 3: Calculate the dot product.

3 1
Using the formula Du T = ∇T · u, substitute ∇T = h2, 10i and u = h 2 , 2 i:

3 1
Du T = h2, 10i · h , i.
2 2
Now, calculate the dot product: √
3 1
Du T = 2 · + 10 · .
2 2
Simplify each term: √
2 3 10
Du T = + .
2 2

Du T = 3 + 5.
Question:7
1
Suppose the density of a thin plate at (x, y) is given by ρ(x, y) = √ . Find the rate of change of
x2 +y 2 +1
π
the density at (2, 1) in a direction θ = 3 radians from the positive x-axis.
Solution :

Step 1: Compute the gradient ∇ρ.


The given function for density is ρ(x, y) = √ 2 1 2 . First, I compute the partial derivatives.
x +y +1
!
∂ 1 1 2x x
ρx = p =− · 2 2 + 1)3/2
=− 2 2 + 1)3/2
.
∂x 2
x +y +12 2 (x + y (x + y
!
∂ 1 1 2y y
ρy = p =− · 2 2 3/2
=− 2 .
∂y 2
x +y +12 2 (x + y + 1) (x + y + 1)3/2
2

So, the gradient is:  


x y
∇ρ = − ,− .
(x2 + y 2 + 1)3/2 (x2 + y 2 + 1)3/2
At the point (2, 1):  
2 1
∇ρ = − ,− .
(22 + 12 + 1)3/2 (22 + 12 + 1)3/2
Simplify 22 + 12 + 1 = 4 + 1 + 1 = 6:
 
2 1
∇ρ = − , − 3/2 .
63/2 6
Step 2: Compute the unit vector u.
The direction is given as θ = π3 radians from the positive x-axis. The unit vector is:
π π
u = hcos( ), sin( )i.
3 3

3
Using trigonometric values cos( π3 ) = 1
2 and sin( π3 ) = 2 :

1 3
u=h , i.
2 2
Step 3: Calculate the dot product.
Now, using the formula Du ρ = ∇ρ · u:
  √
2 1 1 3
Du ρ = − 3/2 , − 3/2 · h , i.
6 6 2 2

8
Calculating the dot product: √
2 1 1 3
Du ρ = − · + − 3/2 · .
63/2 2 6 2
Simplifying each term: √
1 3
Du ρ = − − .
63/2 2 · 63/2
Combining the terms: √
1+ 3
Du ρ = − .
2 · 63/2
p
Question:8 Suppose the electric potential at (x, y) is V (x, y) = ln x2 + y 2 . Find:
1. The rate of change of the potential at (3, 4) toward the origin.
2. The rate of change of the potential at (3, 4) in a direction at a right angle to the direction toward the
origin.
Solution:
Step 1: Compute the gradient ∇V .
p √
The given function is V (x, y) = ln x2 + y 2 . Using the logarithmic rule ln u = 12 ln u, rewrite the
function as:
1
V (x, y) = ln(x2 + y 2 ).
2
Now, I computing the partial derivatives:
 
∂ 1 1 1 x
Vx = ln(x2 + y 2 ) = · 2 2
· 2x = 2 .
∂x 2 2 x +y x + y2
 
∂ 1 1 1 y
Vy = ln(x2 + y 2 ) = · 2 · 2y = 2 .
∂y 2 2 x + y2 x + y2
So, the gradient is:  
x y
∇V = , .
x2 + y 2 x2 + y 2
At the point (3, 4), substitute x = 3 and y = 4:
 
3 4
∇V = , .
32 + 42 32 + 42

Simplify 32 + 42 = 9 + 16 = 25:  
3 4
∇V = , .
25 25
Step 2: Find the unit vector toward the origin.
The direction toward the origin is along the vector h−x, −yi at the point (3, 4):

v = h−3, −4i.

To find the unit vector u, divide v by its magnitude:


p √
|v| = (−3)2 + (−4)2 = 9 + 16 = 5.

So, the unit vector is:


3 4
u = h− , − i.
5 5
Step 3: Rate of change toward the origin.
Now, use the formula Du V = ∇V · u:
 
3 4 3 4
Du V = , · h− , − i.
25 25 5 5

Calculating the dot product:


3 3 4 4
Du V = ·− + ·− .
25 5 25 5

9
Simplifying each term:
9 16
Du V = − − .
125 125
Combining the terms:
25 1
Du V = − =− .
125 5
So, the rate of change of potential toward the origin is:
1
− .
5
Step 4: Rate of change in a direction at a right angle.
The direction at a right angle to the direction toward the origin is perpendicular to h−3, −4i. A perpen-
dicular vector can be h4, −3i.
To make it a unit vector: p √
|v| = 42 + (−3)2 = 16 + 9 = 5,
so the unit vector is:
4 3
u = h , − i.
5 5
Now, calculate Du V = ∇V · u:
 
3 4 4 3
Du V = , · h , − i.
25 25 5 5

Calculate the dot product:


3 4 4 3
Du V = · + ·− .
25 5 25 5
Simplify each term:
12 12
Du V = − .
125 125
Du V = 0.
So, the rate of change of potential in a direction at a right angle is:

0.

Question:9
A plane perpendicular to the x-y plane contains the point (2, 1, 8) on the paraboloid z = x2 + 4y 2 .
The cross-section of the paraboloid created by this plane has slope 0 at this point. Find an equation of
the plane.
Solution:
We are tasked with finding the equation of a plane that is perpendicular to the x-y plane and contains
the point (2, 1, 8) on the paraboloid z = x2 + 4y 2 . Also, we know that the slope of the cross-section of
the paraboloid created by this plane is zero at the given point.
Step 1: Equation of the Paraboloid
The given equation of the paraboloid is:
z = x2 + 4y 2 .
Substitute the point (x, y) = (2, 1) into the equation to verify that the point lies on the paraboloid:

z = 22 + 4(1)2 = 4 + 4 = 8.

Thus, the point (2, 1, 8) is indeed on the paraboloid.


Step 2: Understanding the Plane
Since the plane is perpendicular to the x-y plane, it must be vertical. The equation of a vertical plane
can be written in the form:
ax + by = d,
where a, b, and d are constants.
The plane intersects the paraboloid, creating a cross-section. For the slope of the cross-section to be
zero at (2, 1, 8), the cross-section must contain a tangent to the paraboloid at that point.

10
Step 3: Tangent Direction on the Paraboloid
The slope of the paraboloid is determined by its gradient:
 
∂z ∂z
∇z = , .
∂x ∂y

Given z = x2 + 4y 2 , the partial derivatives are:


∂z ∂z
= 2x, = 8y.
∂x ∂y
Substitute x = 2 and y = 1 into these derivatives:
∂z ∂z
= 2(2) = 4, = 8(1) = 8.
∂x ∂y

Thus, the gradient at (2, 1, 8) is:


∇z = h4, 8i.
This gradient gives the direction perpendicular to the level curve of the paraboloid at (2, 1). A vector
tangent to the level curve is perpendicular to the gradient. A possible tangent direction vector is:

v = h−8, 4i (or any scalar multiple).

Step 4: Equation of the Plane


We now need to find the equation of the plane that contains the tangent direction v = h−8, 4i and passes
through the point (2, 1, 8).
Since the plane is perpendicular to the x-y plane, its normal vector must have no z-component.
Therefore, the equation of the plane will depend only on x and y:

ax + by = d.

Substitute x = −8 and y = 4 into ax + by = d, and also substitute (x, y) = (2, 1) into the equation
to solve for d.
Let the equation of the plane be:
−8x + 4y = d.
Substitute (x, y) = (2, 1) into this equation:

−8(2) + 4(1) = d.

Simplifying, we get:
d = −16 + 4 = −12.
Thus, the equation of the plane is:
−8x + 4y = −12,
or equivalently:
2x − y = 3.
Question:10
Suppose the temperature at (x, y, z) is given by T = xy + sin(yz). In what direction should you go
from the point (1, 1, 1) to decrease the temperature as quickly as possible? What is the rate of change
of temperature in this direction?
Solution:
We are tasked with finding the direction of steepest descent and the rate of change of temperature
in that direction at the point (1, 1, 1) for the temperature function:

T (x, y, z) = xy + sin(yz).
Step 1: Compute the Gradient of T

The gradient of T , denoted ∇T , is given by the vector of partial derivatives:

11
 
∂T ∂T ∂T
∇T = , , .
∂x ∂y ∂z
We now compute the partial derivatives.
∂T ∂T ∂T
= y, = x + z cos(yz), = y cos(yz).
∂x ∂y ∂z
Thus, the gradient is:

∇T = hy, x + z cos(yz), y cos(yz)i.


Step 2: Evaluate the Gradient at (1, 1, 1)

Substitute x = 1, y = 1, and z = 1 into the gradient:


∂T ∂T ∂T
= 1, = 1 + cos(1), = cos(1).
∂x ∂y ∂z
Therefore, the gradient at (1, 1, 1) is:

∇T (1, 1, 1) = h1, 1 + cos(1), cos(1)i.


Step 3: Direction of Steepest Descent

The direction of steepest descent is the negative of the gradient. Thus, the direction of steepest
descent is:

Direction of steepest descent = h−1, −(1 + cos(1)), − cos(1)i.


Step 4: Rate of Change of Temperature in the Direction of Steepest Descent

The rate of change of temperature in the direction of steepest descent is given by the magnitude of
the gradient vector. The magnitude of ∇T is:
p
|∇T | = 12 + (1 + cos(1))2 + (cos(1))2 .
Simplifying this expression:
p
|∇T | = 1 + (1 + cos(1))2 + (cos(1))2 .
p
|∇T | = 1 + 1 + 2 cos(1) + cos2 (1) + cos2 (1).
p
|∇T | = 2 + 2 cos(1) + 2 cos2 (1).
Thus, the rate of change of temperature in the direction of steepest descent is:
p
|∇T | = 2 + 2 cos(1) + 2 cos2 (1).
Question:11
Find an equation for the plane tangent to x2 − 3y 2 + z 2 = 7 at (1, 1, 3).
Solution:
The given surface is f (x, y, z) = x2 − 3y 2 + z 2 − 7 = 0. The gradient of f (x, y, z), ∇f , is normal to
the tangent plane.

∇f (x, y, z) = h2x, −6y, 2zi.


At the point (1, 1, 3), we have:

∇f (1, 1, 3) = h2(1), −6(1), 2(3)i = h2, −6, 6i.

The equation of the tangent plane is given by:

2(x − 1) − 6(y − 1) + 6(z − 3) = 0.

12
Simplifying:
2x − 6y + 6z − 14 = 0.
Final Answer: The equation of the tangent plane is:

2x − 6y + 6z = 14.

Question:12
Find an equation for the plane tangent to xyz = 6 at (1, 2, 3).
Solution:
The given surface is f (x, y, z) = xyz − 6 = 0. The gradient of f (x, y, z), ∇f , is normal to the tangent
plane.

∇f (x, y, z) = hyz, xz, xyi.


At the point (1, 2, 3), we have:

∇f (1, 2, 3) = h2(3), 1(3), 1(2)i = h6, 3, 2i.

The equation of the tangent plane is given by:

6(x − 1) + 3(y − 2) + 2(z − 3) = 0.

Simplifying:
6x + 3y + 2z = 18.
Question:13 Find a vector function for the line normal to x2 + 2y 2 + 4z 2 = 26 at (2, −3, −1).
Solution:

The given surface is f (x, y, z) = x2 + 2y 2 + 4z 2 − 26 = 0. The gradient of f (x, y, z), ∇f , is normal


to the surface and gives the direction vector of the normal line.

∇f (x, y, z) = h2x, 4y, 8zi.


At the point (2, −3, −1), we have:

∇f (2, −3, −1) = h2(2), 4(−3), 8(−1)i = h4, −12, −8i.

The vector function for the normal line passing through (2, −3, −1) is:

r(t) = h2, −3, −1i + th4, −12, −8i.

Simplifying we get:
r(t) = h2 + 4t, −3 − 12t, −1 − 8ti.
Question: 14
The elevation on a portion of a hill is given by f (x, y) = 100 − 4x2 − 2y. From the location above (2, 1),
in which direction will water run?
Solution:

The elevation function is given as:

f (x, y) = 100 − 4x2 − 2y.

To determine the direction in which water will run, we calculate the gradient of f (x, y). The gradient
points in the direction of steepest ascent, and water will flow in the opposite direction since it flows
downhill.
Step 1: Compute the gradient of f (x, y).
The gradient of f (x, y) is:  
∂f ∂f
∇f (x, y) = , .
∂x ∂y

13
We compute the partial derivatives:
∂f ∂f
= −8x, = −2.
∂x ∂y
Thus:
∇f (x, y) = h−8x, −2i.
Step 2: Evaluate the gradient at (2, 1).
Substitute x = 2 and y = 1 into ∇f (x, y):

∇f (2, 1) = h−8(2), −2i = h−16, −2i.

Step 3: Direction of water flow.


Water flows in the opposite direction of the gradient. Therefore, the direction of water flow is:

−∇f (2, 1) = h16, 2i.

Step 4: Unit vector for the direction of water flow.


To express the direction as a unit vector, we calculate the magnitude of h16, 2i:
p √ √ √
kh16, 2ik = 162 + 22 = 256 + 4 = 260 = 2 65.

The unit vector is:


   
h16, 2i 16 2 8 1
u= = √ , √ = √ ,√ .
kh16, 2ik 2 65 2 65 65 65
Water will flow in the direction of the vector:
 
8 1
h16, 2i or as a unit vector: √ ,√ .
65 65

Maxima and Minima for Functions of Two and Three Variables


For functions of two or three variables, maxima and minima are points where the function reaches its
highest (maximum) or lowest (minimum) value, either locally or globally.

1. Function of Two Variables: f (x, y)


Maximum (Local or Global):
A function f (x, y) has a maximum at (x0 , y0 ) if:

f (x0 , y0 ) ≥ f (x, y), for all (x, y) near (x0 , y0 ) (local maximum),

or
f (x0 , y0 ) ≥ f (x, y), for all (x, y) in the domain of f (global maximum).
Minimum (Local or Global):
A function f (x, y) has a minimum at (x0 , y0 ) if:

f (x0 , y0 ) ≤ f (x, y), for all (x, y) near (x0 , y0 ) (local minimum),

or
f (x0 , y0 ) ≤ f (x, y), for all (x, y) in the domain of f (global minimum).

14
2. Function of Three Variables: f (x, y, z)
Maximum (Local or Global):
A function f (x, y, z) has a maximum at (x0 , y0 , z0 ) if:

f (x0 , y0 , z0 ) ≥ f (x, y, z), for all (x, y, z) near (x0 , y0 , z0 ) (local maximum),

or
f (x0 , y0 , z0 ) ≥ f (x, y, z), for all (x, y, z) in the domain of f (global maximum).
Minimum (Local or Global):
A function f (x, y, z) has a minimum at (x0 , y0 , z0 ) if:

f (x0 , y0 , z0 ) ≤ f (x, y, z), for all (x, y, z) near (x0 , y0 , z0 ) (local minimum),

or
f (x0 , y0 , z0 ) ≤ f (x, y, z), for all (x, y, z) in the domain of f (global minimum).
Critical Points for Two and Three Variable Functions
Critical points occur where the first-order partial derivatives are zero:
∂f ∂f ∂f
= 0, =0 (and = 0 for three variables).
∂x ∂y ∂z
Use the Hessian matrix to classify critical points:
For f (x, y), compute:  
f fxy
H = xx
fyx fyy
Then calculate the discriminant:
D = fxx fyy − (fxy )2
1. If D > 0 and fxx > 0, local minimum.
2. If D > 0 and fxx < 0, local maximum.
3. If D < 0, saddle point.
Theorem Suppose that the second partial derivatives of f (x, y) are continuous near (x0 , y0 ), and

fx (x0 , y0 ) = 0 and fy (x0 , y0 ) = 0.

let denotes the discriminant by D, then:


2
D(x0 , y0 ) = fxx (x0 , y0 )fyy (x0 , y0 ) − (fxy (x0 , y0 )) .

The classification of (x0 , y0 ) is as follows:


• If D > 0 and fxx (x0 , y0 ) < 0, there is a local maximum at (x0 , y0 ).
• If D > 0 and fxx (x0 , y0 ) > 0, there is a local minimum at (x0 , y0 ).
• If D < 0, there is neither a maximum nor a minimum (i.e., it is a saddle point) at (x0 , y0 ).
• If D = 0, the test fails, and no conclusion can be drawn.
Question: Verify that f (x, y) = x2 + y 2 has a minimum at (0, 0).
Solution:
Step 1: Compute the first and second-order partial derivatives
We first calculate all the required derivatives of f (x, y) = x2 + y 2 :
∂f ∂f
fx = = 2x, fy = = 2y
∂x ∂y
∂2f ∂2f ∂2f
fxx = = 2, fyy = = 2, fxy = =0
∂x2 ∂y 2 ∂x∂y
Step 2: Critical points To find the critical points, we set the first-order partial derivatives equal
to zero:
fx = 2x = 0 and fy = 2y = 0

15
This gives the critical point:
(0, 0)
Step 3: Apply the second derivative test
The second derivative test determines whether a critical point is a local minimum, maximum, or saddle
point. The determinant of the Hessian matrix is given by:

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

At (0, 0), substitute the second-order partial derivatives:

D(0, 0) = fxx (0, 0)fyy (0, 0) − (fxy (0, 0))2 = 2 · 2 − 02 = 4 > 0

Since D(0, 0) > 0 and fxx (0, 0) = 2 > 0, the critical point (0, 0) is a local minimum. There are no
other critical points, so (0, 0) is the only minimum.

Question: Find all local maxima and minima for f (x, y) = x3 + y 3 .


Solution:
Step 1: Compute the first and second-order partial derivatives
We first calculate the derivatives of f (x, y) = x3 + y 3 :
∂f ∂f
fx = = 3x2 , fy = = 3y 2
∂x ∂y

∂2f ∂2f ∂2f


fxx = = 6x, fyy = = 6y, fxy = =0
∂x2 ∂y 2 ∂x∂y
Step 2: Find critical points
To find the critical points, set the first-order partial derivatives equal to zero:

fx = 3x2 = 0 and fy = 3y 2 = 0

This gives the critical point:


(0, 0)
Step 3: Apply the second derivative test
The second derivative test uses the determinant of the Hessian matrix:

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

At (0, 0), substitute the second-order derivatives:

D(0, 0) = fxx (0, 0)fyy (0, 0) − (fxy (0, 0))2 = 0 · 0 − 02 = 0

Since D(0, 0) = 0, the second derivative test gives no information about whether (0, 0) is a local
maximum, minimum, or saddle point.
Step 4: Analyze the function behavior
To determine the nature of (0, 0), we analyze the function behavior near this point:
When x > 0 and y > 0, f (x, y) = x3 + y 3 > 0.
When x < 0 and y < 0, f (x, y) = x3 + y 3 < 0.
This shows that there are points arbitrarily close to (0, 0) where f (x, y) is both positive and negative.
Hence, (0, 0) is neither a local maximum nor a local minimum.
Alternatively, consider the cross-section when y = 0:

f (x, 0) = x3

The function f (x, 0) = x3 does not have a local maximum or minimum at x = 0, confirming the result.
Conclusion The function f (x, y) = x3 + y 3 has a critical point at (0, 0), but it is neither a local
maximum nor a local minimum.

16
Question: A box with no top is to hold a certain volume V . Find the dimensions of the box that
minimize the surface area.
Solution:

The surface area of the box is given by:

A = 2hw + 2hl + lw

where l is the length, w is the width, and h is the height of the box. The volume of the box is:

V = lwh

From this, we can express h as:


V
h=
lw
V
Substituting h = lw into the expression for A, we get:

2V 2V
A(l, w) = + + lw
l w
Compute the partial derivatives
To find the critical points, we calculate the first-order partial derivatives of A(l, w):

∂A 2V ∂A 2V
Al = = − 2 + w, Aw = =− 2 +l
∂l l ∂w w
Solve for the critical points
Setting Al = 0 and Aw = 0, we solve the system of equations:
2V 2V
− +w =0 and − +l =0
l2 w2
From the first equation:
2V
w=
l2
From the second equation:
2V
l=
w2
2V 2V
Substituting w = l2 into l = w2 :
2V
l= 2
2V
l2
Simplifying:
l = (2V )1/3 , w = (2V )1/3
The corresponding height h is:
V V V V
h= = = = (2V )−1/3 V =
lw (2V )1/3 (2V )1/3 (2V )2/3 (2V )2/3

Apply the second derivative test


The second-order partial derivatives are:

∂2A 4V ∂2A 4V
All = 2
= 3 , Aww = 2
= 3, Alw = 1
∂l l ∂w w
The discriminant D of the Hessian matrix is:

D = All Aww − (Alw )2

Substitute the values:


4V 4V
D= · − (1)2
l3 w 3

17
At the critical point l = w = (2V )1/3 , substitute l = w:
4V 4V
D= · −1=4−1=3>0
2V 2V
Since D > 0 and All > 0, there is a local minimum at the critical point.
Global minimum
Physically, it is clear that the surface area has a minimum for a fixed volume. Since there is only one
critical point, this local minimum is also the global minimum.
Conclusion The dimensions of the box that minimize the surface area are:
V
l = w = (2V )1/3 , h=
(2V )2/3

Theorem
If f (x, y) is continuous on a closed and bounded subset of R2 , then f (x, y) has both a maximum and
minimum value.

Question: The length of the diagonal of a box is to be 1 meter. Find the maximum possible volume
of the box.
Solution:

Step 1: Problem setup


If the box is placed with one corner at the origin and its sides along the axes, the length of the diagonal
is: p
x2 + y 2 + z 2 = 1
The volume of the box is:
V = xyz
p
Substituting z = 1− x2 − y2 (from the diagonal condition), we write the volume as a function of
x and y: p
V = xyz = xy 1 − x2 − y 2
Clearly, x2 + y 2 ≤ 1, so the domain is the quarter of the unit disk in the first quadrant (x ≥ 0, y ≥ 0).
Step 2: Compute partial derivatives
To find critical points, we compute the partial derivatives of V (x, y):
∂V p xy(2x) y(1 − 2x2 − y 2 )
Vx = = y 1 − x2 − y 2 − p = p
∂x 2 1 − x2 − y 2 1 − x2 − y 2

∂V p xy(2y) x(1 − 2y 2 − x2 )
Vy = = x 1 − x2 − y 2 − p = p
∂y 2 1 − x2 − y 2 1 − x2 − y 2
Step 3: Solve for critical points
Setting Vx = 0 and Vy = 0, we solve the system:

y(1 − 2x2 − y 2 ) x(1 − 2y 2 − x2 )


p =0 and p =0
1 − x2 − y 2 1 − x2 − y 2
From Vx = 0:
y=0 or 1 − 2x2 − y 2 = 0
From Vy = 0:
x=0 or 1 − 2y 2 − x2 = 0
Solving 1 − 2x2 − y 2 = 0 and 1 − 2y 2 − x2 = 0 simultaneously gives:
1
x=y= √
3
Thus, the only critical point in the interior of the domain is:
 
1 1 1
√ ,√ ,√
3 3 3

18
Step 4: Check the boundary
The boundary of the domain consists of three parts: 1. x = 0, where V = 0 because V = xyz. 2. y = 0,
where V = 0 because V = xyz. 3. x2 + y 2 = 1, where z = 0 results in V = 0.
In all boundary cases, the volume is 0. Therefore, the maximum volume must occur at the critical
point.
Step 5: Maximum volume
 
At √13 , √13 , √13 , the maximum volume is:

   r !
1 1 1 1
V = xyz = √ √ 1− −
3 3 3 3
r
1 1 1
V = · = √
3 3 3 3
Conclusion
The maximum possible volume of the box is:
1
V = √
3 3

Questions

1. Find all local maximum and minimum points of

f (x, y) = x2 + 4y 2 − 2x + 8y − 1.

2. Find all local maximum and minimum points of

f (x, y) = x2 − y 2 + 6x − 10y + 2.

3. Find all local maximum and minimum points of

f (x, y) = xy.

4. Find all local maximum and minimum points of

f (x, y) = 9 + 4x − y − 2x2 − 3y 2 .

Home work

Question Find the absolute maximum and minimum values of

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

over the region bounded by y = x, y = 0, and x = 2.


Solution

Step 1: Define the region


The given region is bounded by:
1. y = x (diagonal line),
2. y = 0 (x-axis),
3. x = 2 (vertical line).

19
This region forms a triangle with vertices at (0, 0), (2, 0), and (2, 2).
Step 2: Compute critical points
The function is
f (x, y) = x2 + 3y − 3xy.
The partial derivatives are:
fx = 2x − 3y, fy = 3 − 3x.
Setting fx = 0 and fy = 0:

2x
fx = 0 =⇒ 2x − 3y = 0 =⇒ y= ,
3
fy = 0 =⇒ 3 − 3x = 0 =⇒ x = 1.
2x
Substitute x = 1 into y = 3 :
2(1) 2
y= = .
3 3
Thus, the critical point is (1, 23 ).
Step 3: Evaluate f (x, y) on the boundaries
We now evaluate f (x, y) along the boundaries of the triangular region.
Boundary 1: y = 0, 0 ≤ x ≤ 2
Substituting y = 0 into f (x, y):
f (x, 0) = x2 .
At x = 0:
f (0, 0) = 0.
At x = 2:
f (2, 0) = 22 = 4.
Boundary 2: y = x, 0 ≤ x ≤ 2
Substituting y = x into f (x, y):

f (x, x) = x2 + 3x − 3x2 = −2x2 + 3x.

To find the critical points, take the derivative:


d
(−2x2 + 3x) = −4x + 3.
dx
Set −4x + 3 = 0:
3
x= .
4
Evaluate f (x, x) at x = 0, x = 2, and x = 34 :

f (0, 0) = 0, f (2, 2) = −2(2)2 + 3(2) = −8 + 6 = −2,


   2  
3 3 3 3 18 9 9
f , = −2 +3 =− + = .
4 4 4 4 16 4 8
Boundary 3: x = 2, 0 ≤ y ≤ 2
Substituting x = 2 into f (x, y):

f (2, y) = (2)2 + 3y − 3(2)y = 4 + 3y − 6y = 4 − 3y.

Evaluate f (2, y) at y = 0 and y = 2:

f (2, 0) = 4, f (2, 2) = 4 − 3(2) = −2.

Step 4: Compare all values

20
We now compare the values of f (x, y) at all critical points and boundary points:

f (0, 0) = 0,
f (2, 0) = 4,
f (2, 2) = −2,
 
3 3 9
f , = ≈ 1.125.
4 4 8

Conclusion
The absolute maximum value of f (x, y) is:

4 at (2, 0) .

The absolute minimum value of f (x, y) is:

−2 at (2, 2) .

Optimization Problems for Functions of Several Variables


Optimization problems involving several variables focus on finding the maximum or minimum value of
a multi-variable function f (x1 , x2 , . . . , xn ), subject to constraints on the variables.

Key Components
Objective Function: A function of several variables to be maximized or minimized. Example:

f (x, y) = x2 + y 2 .

Decision Variables: Variables that determine the function’s value. Example: x, y.

Constraints: Conditions that the solution must satisfy. Example:

g(x, y) ≤ 0, h(x, y) = 0.

Feasible Region: The set of points in the domain of f that satisfy all constraints.

Unconstrained Optimization of Several Variables


For functions without constraints, the process involves:

Finding Critical Points:


1. Compute the partial derivatives of f (x1 , x2 , . . . , xn ) with respect to each variable.

2. Set the derivatives equal to zero:


∂f ∂f ∂f
= 0, = 0, ..., = 0.
∂x1 ∂x2 ∂xn

Classifying Critical Points: Use the second derivative test to classify each critical point:

21
Problem Statement Minimize the cost of a rectangular box with a given volume V , where:
• The cost per unit area of the bottom is twice that of the sides and top.
Solution

Let:
• x: length of the bottom and top,
• y: width of the bottom and top,
• h: height of the box.
The volume constraint is:
x · y · h = V.
The cost per unit area is:
• Bottom: 2C,
• Sides and Top: C.
The total cost is:

Cost = 2C · (x · y) + C · (x · y) + C · (2 · x · h + 2 · y · h).

Simplify:
Cost = 3C · (x · y) + 2C · h · (x + y).
Substitute the Volume Constraint
From x · y · h = V , we have:
V
h= .
x·y
Substituting h into the cost function:
V
Cost = 3C · (x · y) + 2C · · (x + y).
x·y
Divide by C (since it is constant and does not affect optimization):
V
f (x, y) = 3(x · y) + 2 · · (x + y).
x·y
Take Partial Derivatives
To minimize f (x, y), compute the partial derivatives with respect to x and y.

Partial derivative with respect to x:


∂f 2V 2V
= 3y + 2 − .
∂x x x · y2
∂f
Set ∂x = 0:
2V 2V
3y + 2
− = 0. (1)
x x · y2

Partial derivative with respect to y:


∂f 2V 2V
= 3x + 2 − 2 .
∂y y x ·y
∂f
Set ∂y = 0:
2V 2V
3x + − 2 = 0. (2)
y2 x ·y
Solve the System of Equations
From equations (1) and (2), we simplify and solve:

22
Equation (1):
2V 2V
3y + = .
x2 x · y2
Multiply through by x2 · y 2 :
3x2 · y 3 + 2V y 2 = 2V x · y. (3)

Equation (2):
2V 2V
3x + = 2 .
y2 x ·y
Multiply through by x2 · y 2 :
3x3 · y 2 + 2V x2 = 2V y · x. (4)
Divide equation (4) by equation (3):
3x3 · y 2 + 2V x2
= 1.
3x2 · y 3 + 2V y 2
Simplify and solve:
x = y.
Solve for Dimensions
Substitute x = y into the volume constraint:
V
x2 · h = V =⇒ h= .
x2
The cost function is minimized when:
r r
3 2V 3 9V
x=y= , h= .
3 4

Problem Statement Given the three points (1, 4), (5, 2), and (3, −2), the quantity

(x − 1)2 + (y − 4)2 + (x − 5)2 + (y − 2)2 + (x − 3)2 + (y + 2)2


is the sum of the squares of the distances from the point (x, y) to the three points. Find x and y so that
this quantity is minimized.
Solution

Expanding each term:


(x − 1)2 = x2 − 2x + 1, (y − 4)2 = y 2 − 8y + 16,
(x − 5)2 = x2 − 10x + 25, (y − 2)2 = y 2 − 4y + 4,
(x − 3)2 = x2 − 6x + 9, (y + 2)2 = y 2 + 4y + 4.
Adding all terms together:
f (x, y) = x2 − 2x + 1 + y 2 − 8y + 16 + x2 − 10x + 25 + y 2 − 4y + 4 + x2 − 6x + 9 + y 2 + 4y + 4.
Combining like terms, we have:
f (x, y) = 3x2 + 3y 2 − 18x − 8y + 59.
Find Critical Points
To find the minimum, compute the partial derivatives of f (x, y) with respect to x and y, and set them
equal to zero.

Partial Derivative with Respect to x:


∂f
= 6x − 18.
∂x
∂f
Set ∂x = 0:
6x − 18 = 0 =⇒ x = 3.

23
Partial Derivative with Respect to y:
∂f
= 6y − 8.
∂y
∂f
Set ∂y = 0:
4
6y − 8 = 0 =⇒ y = .
3
Verify the Solution
The function f (x, y) = 3x2 + 3y 2 − 18x − 8y + 59 is a quadratic function with positive coefficients for x2
and y 2 . Therefore, it is convex, and the critical point (x, y) = (3, 43 ) corresponds to the global minimum.
The point (x, y) that minimizes the given quantity is:
 
4
3, .
3

Problem Suppose that f (x, y) = x2 + y 2 + kxy. Find and classify the critical points, and discuss
how they change when k takes on different values.
Solution
The given function is:
f (x, y) = x2 + y 2 + kxy.

Step 1: Find Partial Derivatives Compute the partial derivatives of f (x, y):

∂f ∂f
fx = = 2x + ky, fy = = 2y + kx.
∂x ∂y

Step 2: Find Critical Points Set fx = 0 and fy = 0:

2x + ky = 0, 2y + kx = 0.

Solving this system of equations:


k k
x = − y, y = − x.
2 2
Substitute x = − k2 y into y = − k2 x:

k2
 
k k
y=− − y =⇒ y = y.
2 2 4
k2
If y 6= 0, then 4 = 1, giving k = ±2. However, for k 6= ±2, y = 0. Thus, the only critical point is:

(x, y) = (0, 0).

Step 3: Classify Critical Point The Hessian matrix is:


   
f fxy 2 k
H = xx = .
fxy fyy k 2

The determinant of H is:


det(H) = 2 · 2 − k 2 = 4 − k 2 .

• If k 2 < 4, det(H) > 0 and fxx = 2 > 0, so (0, 0) is a local minimum.


• If k 2 > 4, det(H) < 0, so (0, 0) is a saddle point.
• If k 2 = 4, det(H) = 0, and the test is inconclusive.

24
Conclusion The behavior of the critical point (0, 0) changes based on k:
• For |k| < 2, (0, 0) is a local minimum.
• For |k| > 2, (0, 0) is a saddle point.
• For |k| = 2, the test is inconclusive.

Problem Find the shortest distance from (0, b) to the Parabola y = x2


Solution
The distance from (0, b) to a point (x, x2 ) on the parabola is:
p
d(x) = x2 + (x2 − b)2 .

Minimize d(x)2
Define:
f (x) = x2 + (x2 − b)2 .
Compute the Derivative

f 0 (x) = 2x + 2(x2 − b)(2x) = 2x[1 + 2(x2 − b)].


Set f 0 (x) = 0:
2x[1 + 2(x2 − b)] = 0 =⇒ x = 0 or 1 + 2(x2 − b) = 0.
Solve 1 + 2(x2 − b) = 0:
1
2x2 = 2b − 1 =⇒ x2 = b − .
2
Classify Critical Points
The critical points are: r
1 1
x = 0, x=± b− (if b ≥ ).
2 2
Evaluating f (x) at these points to find the minimum.
The shortest distance is obtained at:
r
1
x = ± b − , y = x2 .
2

Problem Find the shortest distance from point (0, 0, b) to the Paraboloid z = x2 + y 2 .
Solution
The distance from (0, 0, b) to a point (x, y, x2 + y 2 ) is:
p
d(x, y) = x2 + y 2 + (x2 + y 2 − b)2 .

Minimize d(x, y)2


Define:
f (x, y) = x2 + y 2 + (x2 + y 2 − b)2 .
Let r2 = x2 + y 2 . Then:
f (r) = r2 + (r2 − b)2 .
The derivative is:
f 0 (r) = 2r + 2(r2 − b)(2r) = 2r[1 + 2(r2 − b)].
Set f 0 (r) = 0:
2r[1 + 2(r2 − b)] = 0 =⇒ r = 0 or 1 + 2(r2 − b) = 0.
Solve 1 + 2(r2 − b) = 0:
1
2r2 = 2b − 1 =⇒ r2 = b − .
2
The shortest distance is obtained when:
r
1
r = b − , z = r2 .
2

25
Constrained Optimization of Several Variables
When constraints are present, the problem becomes more complex.

Equality Constraints: Lagrange Multipliers For constraints of the form g(x1 , x2 , . . . , xn ) = 0,


we use the method of Lagrange multipliers:

Define the Lagrangian:

L(x1 , x2 , . . . , xn , λ) = f (x1 , x2 , . . . , xn ) + λg(x1 , x2 , . . . , xn ),

where λ is the Lagrange multiplier.

Solve the System of Equations:


∇L = 0,
which implies:
∂L ∂L ∂L
= 0, = 0, ..., = 0.
∂x1 ∂x2 ∂λ

Question The plane x + y − z = 1 intersects the cylinder x2 + y 2 = 1 in an ellipse. Find the points
on this ellipse that are closest to and farthest from the origin.
Solution

Problem Setup
We want to optimize the distance from the origin, given by:
p
f = x2 + y 2 + z 2 .

To simplify the algebra, we optimize:


f = x2 + y 2 + z 2 ,
p
which has extrema at the same points as x2 + y 2 + z 2 .
Constraints:

g = x2 + y 2 − 1 = 0, h = x + y − z − 1 = 0.
Gradients
The gradients are:
∇f = h2x, 2y, 2zi, ∇g = h2x, 2y, 0i, ∇h = h1, 1, −1i.
Using the method of Lagrange multipliers, we solve:

∇f = λ∇g + µ∇h.

This gives the equations:


2x = λ2x + µ1,
2y = λ2y + µ1,
2z = µ(−1),
x2 + y 2 = 1,
x + y − z = 1.
Solve the Equations
From the first two equations:
2x − λ2x = µ, 2y − λ2y = µ.
Subtracting these:
2y − 2x = λ(2y − 2x).
If 2y − 2x 6= 0, then λ = 1. If 2y − 2x = 0, then x = y.

26
Case 1: λ = 1
If λ = 1, then µ = 0, and from the third equation:

2z = 0 =⇒ z = 0.

The constraints become:


x2 + y 2 = 1, x + y = 1.
Solve these:
y = 1 − x, x2 + (1 − x)2 = 1.
Simplify:
x2 + 1 − 2x + x2 = 1 =⇒ 2x2 − 2x = 0 =⇒ 2x(x − 1) = 0.
Thus, x = 0 or x = 1:

(x, y, z) = (1, 0, 0) and (x, y, z) = (0, 1, 0).

Both points are distance 1 from the origin.


Case 2: x = y
If x = y, substitute into x2 + y 2 = 1:
1
2x2 = 1 =⇒ x = ± √ .
2
From x + y − z = 1:
x + x − z = 1 =⇒ z = 2x − 1.
The points are:
√ √
   
1 1 1 1
√ , √ , −1 + 2 , − √ , − √ , −1 − 2 .
2 2 2 2
Distances
Compute the distance for each point:

• (1, 0, 0) and (0, 1, 0): 12 + 02 + 02 = 1.
 √ 
• √12 , √12 , −1 + 2 :
s 2  2
1 1 √
d= √ + √ + (−1 + 2)2 .
2 2

Simplify:
√ √
r q
1 1
d= + + (1 − 2 2 + 2) = 4 − 2 2 ≈ 1.08.
2 2
 √ 
• − √12 , − √12 , −1 − 2 :
s 2 2


1 1
d= −√ + −√ + (−1 − 2)2 .
2 2

Simplify:
√ √
r q
1 1
d= + + (1 + 2 2 + 2) = 4 + 2 2 ≈ 2.6.
2 2
Final Answer
The points
 closest to the origin are (1, 0, 0) and (0, 1, 0), with distance 1. The point farthest from the
1 1
√ 
origin is − 2 , − 2 , −1 − 2 , with distance approximately 2.6.
√ √

1
Problem: A six-sided rectangular box is to hold 2 cubic meter. What shape should the box be to
minimize surface area?

27
Solution: Let the dimensions of the box be x, y, and z. The volume constraint is:
1
xyz = .
2
The surface area to minimize is:
A = 2(xy + yz + xz).
Using the method of Lagrange multipliers, define:
1
f (x, y, z) = 2(xy + yz + xz), g(x, y, z) = xyz − .
2
The gradients are:

∇f = h2y + 2z, 2x + 2z, 2x + 2yi, ∇g = hyz, xz, xyi.

Set ∇f = λ∇g, giving the equations:

2y + 2z = λyz, 2x + 2z = λxz, 2x + 2y = λxy.

From the volume constraint:


1
xyz = .
2
Dividing the first two equations by z and y respectively, we find:
2 2
+ 2 = λy, + 2 = λz.
z y
Equating λy and λz, we find:
2 2
+ 2 = + 2 =⇒ y = z.
z y
Similarly, using the second and third equations:
2
+ 2 = λz =⇒ x = y.
x
Thus, x = y = z. Substituting into the volume constraint:
r
3 1 3 1
x = =⇒ x = .
2 2
Hence, the dimensions of the box are:
r
3 1
x=y=z= ,
2
and the box is a cube.

Problem: The post office will accept packages whose combined length and girth are at most 130 inches.
What is the largest volume that can be sent in a rectangular box?

Solution: Let the dimensions of the box be l, w, and h, where l is the length. The girth is 2(w + h),
so the constraint is:
l + 2(w + h) ≤ 130.
The volume to maximize is:
V = lwh.
From the constraint, express l:
l = 130 − 2(w + h).
Substitute into V :
V = (130 − 2(w + h))wh.

28
Expanding:
V = 130wh − 2w2 h − 2wh2 .
Take partial derivatives:
∂V ∂V
= 130h − 4wh − 2h2 , = 130w − 4wh − 2w2 .
∂w ∂h
∂V ∂V
Set ∂w = 0 and ∂h = 0:

130h − 4wh − 2h2 = 0, 130w − 4wh − 2w2 = 0.

Divide through by h and w, respectively:

130 − 4w − 2h = 0, 130 − 4h − 2w = 0.

Solve these equations simultaneously:


130 130
w=h= , l= .
6 3
Thus, the largest volume is:
2
1303
 
130 130
V = = .
3 6 108

Problem Statement Find the shortest distance from the point (x0 , y0 , z0 ) to the plane ax+by+cz =
d using the method of Lagrange multipliers.
Solution:
The objective function is the square of the distance between the point (x0 , y0 , z0 ) and an arbitrary
point (x, y, z):
f (x, y, z) = (x − x0 )2 + (y − y0 )2 + (z − z0 )2 .
The constraint is the equation of the plane:

g(x, y, z) = ax + by + cz − d = 0.

The Lagrange function is defined as:

L(x, y, z, λ) = f (x, y, z) + λg(x, y, z),

where λ is the Lagrange multiplier.


Substituting f (x, y, z) and g(x, y, z):

L(x, y, z, λ) = (x − x0 )2 + (y − y0 )2 + (z − z0 )2 + λ(ax + by + cz − d).

We compute the partial derivatives of L(x, y, z, λ) with respect to x, y, z, and λ, and set them to
zero:
∂L
= 2(x − x0 ) + λa = 0, (1)
∂x
∂L
= 2(y − y0 ) + λb = 0, (2)
∂y
∂L
= 2(z − z0 ) + λc = 0, (3)
∂z
∂L
= ax + by + cz − d = 0. (4)
∂λ
From equations (1), (2), and (3), we get:
λa λb λc
x − x0 = − , y − y0 = − , z − z0 = − .
2 2 2
Rewriting:
λa λb λc
x = x0 − , y = y0 − , z = z0 − . (5)
2 2 2

29
Substitute these expressions into the constraint equation (4):
     
λa λb λc
a x0 − + b y0 − + c z0 − = d.
2 2 2
Expanding:
λa2 λb2 λc2
ax0 − + by0 − + cz0 − = d.
2 2 2
Simplifying:
λ 2
ax0 + by0 + cz0 − (a + b2 + c2 ) = d.
2
Solving for λ:
2(ax0 + by0 + cz0 − d)
λ= . (6)
a2 + b2 + c2
Substituting λ from (6) into (5), we get:
For x:
a 2(ax0 + by0 + cz0 − d)
x = x0 − · ,
2 a2 + b2 + c2
a(ax0 + by0 + cz0 − d)
x = x0 − .
a2 + b2 + c2
For y:
b 2(ax0 + by0 + cz0 − d)
y = y0 − · ,
2 a2 + b2 + c2
b(ax0 + by0 + cz0 − d)
y = y0 − .
a2 + b2 + c2
For z:
c 2(ax0 + by0 + cz0 − d)
z = z0 − · ,
2 a2 + b2 + c2
c(ax0 + by0 + cz0 − d)
z = z0 − .
a2 + b2 + c2
The shortest distance from the point (x0 , y0 , z0 ) to the plane is obtained by using the formula:
|ax0 + by0 + cz0 − d|
Distance = √ .
a2 + b2 + c2

Problem Statement Find all points on the surface xy − z 2 + 1 = 0 that are closest to the origin.
Solution

We aim to minimize the square of the distance from the origin to the point (x, y, z) on the surface:

f (x, y, z) = x2 + y 2 + z 2 .

The constraint is the equation of the surface:

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

The Lagrange function is:

L(x, y, z, λ) = f (x, y, z) + λg(x, y, z),

where λ is the Lagrange multiplier. Substituting f (x, y, z) and g(x, y, z):

L(x, y, z, λ) = x2 + y 2 + z 2 + λ(xy − z 2 + 1).

We compute the partial derivatives of L(x, y, z, λ) with respect to x, y, z, and λ, and set them to
zero:
1. Partial derivative with respect to x:
∂L
= 2x + λy = 0. (1)
∂x

30
2. Partial derivative with respect to y:
∂L
= 2y + λx = 0. (2)
∂y
3. Partial derivative with respect to z:
∂L
= 2z − 2λz = 0. (3)
∂z
4. Partial derivative with respect to λ:
∂L
= xy − z 2 + 1 = 0. (4)
∂λ
From equation (3), we have:

2z − 2λz = 0 =⇒ z(1 − λ) = 0.

This gives two cases:


Case 1: z = 0, Case 2: λ = 1.
Case 1: z = 0 Substituting z = 0 into equation (4):

xy − 02 + 1 = 0 =⇒ xy = −1. (5)

This gives the constraint xy = −1.


Case 2: λ = 1 Substitute λ = 1 into equations (1) and (2):

2x + y = 0 =⇒ y = −2x, (6)

2y + x = 0 =⇒ x = −2y. (7)
Substituting y = −2x into equation (7):

x = −2(−2x) =⇒ x = 4x =⇒ x = 0.

Thus, x = 0 and from equation (6), y = 0.


Substitute x = 0 and y = 0 into equation (4):

0 · 0 − z 2 + 1 = 0 =⇒ −z 2 + 1 = 0 =⇒ z 2 = 1 =⇒ z = ±1. (8)

Thus, the points are (0, 0, 1) and (0, 0, −1).


Check z = 0 Case
For z = 0, equation (5) gives xy = −1. We aim to minimize f (x, y, z) = x2 + y 2 + 02 = x2 + y 2 subject
to xy = −1.
To minimize x2 + y 2 , we note that:
p
x2 + y 2 ≥ 2 x2 y 2 = 2|xy| = 2.

Equality holds when x = y, but for xy = −1, x and y cannot be equal. Therefore, no additional points
minimize the distance.
The points on the surface xy − z 2 + 1 = 0 closest to the origin are:

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

The minimum distance is: p


02 + 02 + 12 = 1.

31
Problem Find three positive numbers whose sum is 48 and whose product is as large as possible.
Solution
We need to maximize the product P = xyz of three positive numbers x, y, and z subject to the constraint:

x + y + z = 48.

The Lagrange function is:

L(x, y, z, λ) = xyz + λ(x + y + z − 48).

We compute the partial derivatives of L:


∂L
= yz + λ = 0, (1)
∂x
∂L
= xz + λ = 0, (2)
∂y
∂L
= xy + λ = 0, (3)
∂z
∂L
= x + y + z − 48 = 0. (4)
∂λ
From equations (1), (2), and (3), we have:

yz = xz = xy = −λ.

This implies:
yz = xz =⇒ y = x,
yz = xy =⇒ z = x.
Thus, x = y = z.
Using x = y = z in the constraint x + y + z = 48:

x + x + x = 48 =⇒ 3x = 48 =⇒ x = 16.

Thus, x = y = z = 16.
The product is:
P = x · y · z = 16 · 16 · 16 = 163 = 4096.
The three positive numbers are:
x = y = z = 16,
and the maximum product is:
P = 4096.

Problem Find all points on the plane x + y + z = 5 in the first octant at which f (x, y, z) = xy 2 z 2
has a maximum value.
Solution

The Lagrange function is:

L(x, y, z, λ) = xy 2 z 2 + λ(x + y + z − 5).

We compute the partial derivatives of L:


∂L
= y 2 z 2 + λ = 0, (1)
∂x
∂L
= 2xyz 2 + λ = 0, (2)
∂y
∂L
= 2xy 2 z + λ = 0, (3)
∂z

32
∂L
= x + y + z − 5 = 0. (4)
∂λ
From equations (1), (2), and (3), we observe the relationships:

y 2 z 2 = 2xyz 2 =⇒ y = 2x,

y 2 z 2 = 2xy 2 z =⇒ z = 2y.
Substitute y = 2x and z = 2y = 4x into the constraint equation (4):
5
x + y + z = 5 =⇒ x + 2x + 4x = 5 =⇒ 7x = 5 =⇒ x = .
7
5
Now substitute x = 7 into y = 2x and z = 4x:

5 10 5 20
y =2· = , z =4· = .
7 7 7 7
The point is:  
5 10 20
, , .
7 7 7
This point satisfies the constraint x + y + z = 5 and is in the first octant.
The point on the plane x + y + z = 5 in the first octant that maximizes f (x, y, z) = xy 2 z 2 is:
 
5 10 20
, , .
7 7 7

Assignment
' $
1. Find the maximum and minimum values of f (x, y, z) = 6x+3y+2z subject to the constraint
g(x, y, z) = 4x2 + 2y 2 + z 2 − 70 = 0.

2. Find the maximum and minimum values of f (x, y) = exy subject to the constraint g(x, y) =
x3 + y 3 − 16 = 0.
p
3. Find the maximum and minimum values of f (x, y) = xy + 9 − x2 − y 2 when x2 + y 2 ≤ 9.

4. Find three real numbers whose sum is 9 and the sum of whose squares is as small as
possible.
& %

33

You might also like