Let lagrange function F(x, y, z, λ, μ)=x2+y2+z2+λ(x2+y2? z)+μ(x+y+z? 4).
First solve its stagnation point.
Order? f′x = 2x+2λx+μ= 0F′y = 2y+2λy+μ= 0F′z = 2z? λ+μ= 0F’λ= x2+y2? z = 0F′μ= x+y+z? 4=0,
By solving the equations, (x 1, y 1, z 1) = (1, 1, 2), (x2, y2, z2)=(2,? 2,8).
Because u (x 1, y 1, z 1) = 6, u(x2, y2, z2)=72,
Therefore, the maximum value is 72 and the minimum value is 6.
Method 2: Pay attention to the constraint condition x+y+z=4, that is, z=4? (x+y), so the original problem can be transformed into:
Find the maximum value of the function u = x2+y2+x4+2xy2+y4 under the constraint condition x+y+x2+y2=4.
Let f (x, y, λ) = x2+y2+x4+2xy2+y4+λ (x+y+x2+y2? 4),
Order? f′x = 4x 3+4x y2+2x+λ( 1+2x)= 0F′y = 4y 3+4x2y+2y+λ( 1+2y)= 0F′z = x+y+x2+y2? 4=0,
Solution, (x 1, y 1) = (1, 1), (x2, y2)= (? 2,? 2),
Substitute z=x2+y2 to get z 1, =2, and z2=8.
Because u (x 1, y 1, z 1) = 6, u(x2, y2, z2)=72,
Therefore, the maximum value is 72 and the minimum value is 6.