Finding maximum and minimum values of 3 dimensional function

  • #1

Homework Statement


Find the maximum and minimum values of f(x,y,z) = x^2 - 2x + y^2 - 4y + z^2 - 4z in the region x^2 + y^2 + z^2 <= 36.

Homework Equations


Lagrange multipliers
The gradient of f = lambda * gradient of g
<Fx, Fy, Fz> = lambda<Gx, Gy, Gz>

Test for local extrema
If Determinant D(x,y) < 0 it is a saddle point
If D(x,y) > 0:
If Fxx > 0, then it is a local minimum
If Fxx < 0, then it's a local maximum


The Attempt at a Solution


Tried to solve for system of equations that result in 4 equations[/B]
2x-2 = lambda * 2x
2y-4 = lambda * 2y
2z-4 = lambda * 2z
X^2 + y^2 + z^2 = 36

I solved for lambda = 1/2 or 3/2 by solving for x y and z and substituting into the 4th equation.
I got (2,4,4) =0 and (-2,-4,-4) =72. BUT the minimum was actually (1,2,2) = -9 because I was supposed to "check the interior of the sphere". Am I just supposed to account for the possibility that lambda = 0?
 

Answers and Replies

  • #2
35,499
11,946
For the minimum you don't need Lagrange multipliers. Setting them to zero seems to work as well.
 
  • #3
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,722

Homework Statement


Find the maximum and minimum values of f(x,y,z) = x^2 - 2x + y^2 - 4y + z^2 - 4z in the region x^2 + y^2 + z^2 <= 36.

Homework Equations


Lagrange multipliers
The gradient of f = lambda * gradient of g
<Fx, Fy, Fz> = lambda<Gx, Gy, Gz>

Test for local extrema
If Determinant D(x,y) < 0 it is a saddle point
If D(x,y) > 0:
If Fxx > 0, then it is a local minimum
If Fxx < 0, then it's a local maximum


The Attempt at a Solution


Tried to solve for system of equations that result in 4 equations[/B]
2x-2 = lambda * 2x
2y-4 = lambda * 2y
2z-4 = lambda * 2z
X^2 + y^2 + z^2 = 36

I solved for lambda = 1/2 or 3/2 by solving for x y and z and substituting into the 4th equation.
I got (2,4,4) =0 and (-2,-4,-4) =72. BUT the minimum was actually (1,2,2) = -9 because I was supposed to "check the interior of the sphere". Am I just supposed to account for the possibility that lambda = 0?

For either the max or the min, the solution will either be in the interior or on the boundary. The interior stationary point is a global min in ##\mathbb{R}^3## and obeys the constraint, so is the global min of the constrained problem. (The second-order test implies that the unconstrained stationary point is a min, but you do not need such a fancy test: just use the fact that f = sum of squares + linear to give the result automatically.)

For the way you wrote the Lagrangian equations, a positive lagrange multiplier is a necessary condition for a MAXIMUM, so both of your candidate boundary points satisfy the first-order necessary conditions for a constrained maximum. The second-order *sufficient* conditions for a max are much trickier than you may think, because you have a point on a boundary of an inequality constraint. Basically, you need to project the Hessian of the *Lagrangian* (not the function f!) down to the tangent space of the constraint, and determine if it is negative definite in that subspace.

However, in this case you can by-pass all that because you have both possible points, so can just take the one with the larger f-value.
 
Last edited:
  • #4
HallsofIvy
Science Advisor
Homework Helper
41,847
964
In the interior of the sphere, [itex]\nabla f= (2x- 2)\vec{i}+ (2y- 4)\vec{j}+ (2z- 4)\vec{k}[/itex]. Set that equal to 0 and solve for x, y, and z to find any critical points in the interior of the sphere. Your Lagrange multiplier method will solve for max or min among points that satisfy the equation x^2+ y^2+ z^2= 36, on the surface of the sphere. Another way to do that is to use parametric equations for the sphere: [itex]x= 6cos(\theta)sin(\phi)[/itex], [itex]y= 6 sin(\theta)sin(\phi)[/itex], [itex]z= 6 cos(\phi)[/itex]. Putting those into the function, [itex]f(\theta, \phi)= 36- 12cos(\theta)sin(\phi)- 24sin(\theta)si(\phi)- 24 cos(\phi)[/itex]. Set the gradient of that two variable function to 0 to find any critical points on the surface of the sphere. Find the value of the function at each critical point to determine the absolute max and min.
 
  • #5
Sorry for the late reply. How does using the fact that the sum of the squares + linear establish that (1,2,2) is the global min? We were told to use geometry to show what the min and max are because we do not use advanced calculus to prove these mins and maxes? How can we use geometry/equations to prove these are the min and max values?
 
  • #6
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,722
Sorry for the late reply. How does using the fact that the sum of the squares + linear establish that (1,2,2) is the global min? We were told to use geometry to show what the min and max are because we do not use advanced calculus to prove these mins and maxes? How can we use geometry/equations to prove these are the min and max values?

The surface ##w = x^2 - 2x + y^2 - 4y + z^2 - 4z## is a bit hard to visualize, because it is a 3-dimensional object lying in 4 dimensions.

To gain insight, drop ##z## and look at the 2-dimensional surface ##w = x^2 - 2x + y^2 - 4y## in 3-dimensional ##(x,y,w)##-space. This surface is cup-shaped, opening up as we go farther and farther out in the ##(x,y)## plane; you could fashion it out of sheet metal and it would very nicely hold rainwater. Its bottom is where all derivatives = 0, and there is only one such point. Now just imagine doing the same in a higher dimension.

Alternatively, you can re-write ##f(x,y,z)## by "completing the squares"; that will show the geometry very plainly.

BTW: I did not assume you would follow my remarks about Hessians projected down into tangent subspaces and the like; I just wanted to de-rail any thoughts you might have had about looking at the second derivatives in the way you did. In this case that works for the minimum (because the minimum is the same in the unconstrained problem and the constrained problem---that is, the constraint does not affect the minimum in this case), but those simple tests would lead you very far astray in the maximization case! They would also lead you astray in other cases of minimization where the constraint is active at the solution.
 
Last edited:

Related Threads on Finding maximum and minimum values of 3 dimensional function

  • Last Post
Replies
7
Views
1K
Replies
9
Views
12K
Replies
5
Views
12K
Replies
7
Views
2K
  • Last Post
Replies
2
Views
1K
Replies
1
Views
1K
  • Last Post
Replies
11
Views
3K
  • Last Post
Replies
8
Views
2K
  • Last Post
Replies
1
Views
1K
Top