Directional Derivative-2
Directional Derivative-2
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
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
Geometric Interpretation
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
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.
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.
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:
• 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
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.
x2 + 2y 2 + 3z 2 = 1
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:
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:
∂ 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:
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:
∂ 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:
∂ 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:
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 :
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.
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
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.
10
Step 3: Tangent Direction on the Paraboloid
The slope of the paraboloid is determined by its gradient:
∂z ∂z
∇z = , .
∂x ∂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
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:
The direction of steepest descent is the negative of the gradient. Thus, the direction of steepest
descent is:
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.
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.
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 vector function for the normal line passing through (2, −3, −1) is:
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:
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 (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
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:
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.
fx = 3x2 = 0 and fy = 3y 2 = 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:
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
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
∂2A 4V ∂2A 4V
All = 2
= 3 , Aww = 2
= 3, Alw = 1
∂l l ∂w w
The discriminant D of the Hessian matrix is:
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:
∂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:
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
f (x, y) = x2 + 4y 2 − 2x + 8y − 1.
f (x, y) = x2 − y 2 + 6x − 10y + 2.
f (x, y) = xy.
f (x, y) = 9 + 4x − y − 2x2 − 3y 2 .
Home work
f (x, y) = x2 + 3y − 3xy
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):
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) .
−2 at (2, 2) .
Key Components
Objective Function: A function of several variables to be maximized or minimized. Example:
f (x, y) = x2 + y 2 .
g(x, y) ≤ 0, h(x, y) = 0.
Feasible Region: The set of points in the domain of f that satisfy all constraints.
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.
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
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
2x + ky = 0, 2y + kx = 0.
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:
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.
Minimize d(x)2
Define:
f (x) = x2 + (x2 − b)2 .
Compute the Derivative
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 .
25
Constrained Optimization of Several Variables
When constraints are present, the problem becomes more complex.
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 .
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.
26
Case 1: λ = 1
If λ = 1, then µ = 0, and from the third equation:
2z = 0 =⇒ z = 0.
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:
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:
130 − 4w − 2h = 0, 130 − 4h − 2w = 0.
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.
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 .
g(x, y, z) = xy − z 2 + 1 = 0.
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.
xy − 02 + 1 = 0 =⇒ xy = −1. (5)
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.
0 · 0 − z 2 + 1 = 0 =⇒ −z 2 + 1 = 0 =⇒ z 2 = 1 =⇒ z = ±1. (8)
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:
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.
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
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