Find the maximum and minimum values of $f(x,y,z)=x+y+z$ subject to the constraints $x^2-y^2=z$ and $x^2+z^2=4$

3.3k Views Asked by At

Q: Find the maximum and minimum values of $f(x,y,z)=x+y+z$ subject to the constraints $x^2-y^2=z$ and $x^2+z^2=4$
My approach: The objective function is $f(x,y,z)=x+y+z$ and the constraint functions are $g(x,y,z)=x^2-y^2-z$ and $h(x,y,z)=x^2+z^2-4$.
then calculate the gradients of $f,g,\text{ and }h$:

\begin{align*} \vec{\nabla}f(x,y,z)&=<1,1,1> \\ \vec{\nabla}g(x,y,z)&=<2x,-2y,-1>\\ \vec{\nabla}h(x,y,z)&=<2x,0,2z> \end{align*} Using $\vec{\nabla}f(x,y,z)=\lambda\vec{\nabla}g(x,y,z)+\mu\vec{\nabla}h(x,y,z)$ and the constraint functions we get:
\begin{align*} 1=\lambda(2x)+\mu(2x)\\ 1=\lambda(-2y)\\ 1=\lambda(-1)+\mu(2z)\\ x^2-y^2=z\\ x^2+z^2=4 \end{align*} Now it seem difficult to solve this system of equation as it contain both linear and quadratic equations.

Is there an unofficial general crude checklist I should follow to reduce massive steps to solve this system? Or is this one of those cases where practice makes perfect?


Thanks for your time.
Thanks in advance .

2

There are 2 best solutions below

3
On

With $$z=x^2-y^2$$ we get $$F(x,y,x^2-y^2)=x+y+x^2-y^2$$ and $$y^2_{1,2}=x^2\pm\sqrt{4-x^2}$$ so we get $$f(x,\pm\sqrt{x^2\pm\sqrt{4-x^2}}x^2-x^2\pm\sqrt{4-x^2})=x\pm\sqrt{x^2\pm\sqrt{4-x^2}}+x^2-x^2\pm\sqrt{4-x^2}$$

2
On

enter image description here

The geometrical arrangement for this extremization problem is shown in the graphs above (the second being a view from "below" the $ \ xy-$ plane. The parabolic hyperboloid $ \ z = x^2 - y^2 \ $ and the circular cylinder $ \ x^2 + z^2 = 4 \ $ intersect in a space curve (marked in pale yellow) which is symmetrical about the $ \ yz-$ plane only. This symmetry is of no help in solving for any extrema, however, since we will be dealing with planes $ \ x + y + z = c \ , $ which cut obliquely through this curve.

Your system of Lagrange equations,

$$ 1 \ = \ \lambda·(2x) \ + \ \mu·(2x) \ \ , \ \ 1 \ = \ \lambda·(-2y) \ \ , \ \ 1 \ = \ \lambda·(-1) \ + \ \mu · (2z) \ \ . $$

is correct. However, while the solution of a system of linear equations is a rather well-understood process, solving systems of non-linear equations often calls for a fair amount of opportunism. (I tried four or five ways of arranging these equations before finding something that made the algebra the least opaque. When I broke down after the second attempt and had WolframAlpha run the extremization, I knew the calculation would be unpleasant -- and it didn't "care" to show me how it had done it.)

What seemed to work best is to start with the second equation and substitute for $ \ \mathbf{1} \ $ in the other two. This leads us to

$$ -2 · \lambda·y \ = \ -\lambda \ + \ \mu · 2z \ \ \Rightarrow \ \ (1 - 2y) · \lambda \ = \ \mu·2z \ \ , $$

$$ -2 · \lambda·y \ = \ \lambda·2x \ + \ \mu·2x \ \ \Rightarrow \ \ -(2x + 2y)·\lambda \ = \ \mu·2x \ \ . $$

Multiplying the first of these equations by $ \ x \ $ and the second by $ \ z \ $ permits us to write

$$ x · (1 - 2y) · \lambda \ = \ -z · (2x + 2y) · \lambda \ \ \Rightarrow \ \ [ \ 2z(x+y) \ - \ x(2y-1) \ ] · \lambda \ = \ 0 \ \ . $$

Since $ \lambda \ = -\frac{1}{2y} \ , $ we must have $ \ \lambda \neq 0 \ , $ so we obtain

$$ 2z(x+y) \ = \ x(2y-1) \ \ \Rightarrow \ \ z \ = \ \frac{x·(2y-1)}{2·(x+y)} \ \ . $$

Beyond this point, one will much prefer to use a computer-algebra system since the expression for $ \ y \ $ in terms of $ \ x \ $ upon inserting this result into the constraint equations is horrific. I had WolframAlpha solve the system " $ \ z = x^2 - y^2 \ , \ x^2 + z^2 = 4 \ , \ z \ = \ \frac{x·(2y-1)}{2·(x+y)} \ $ " , for which it found the four solutions (given approximately here)

$$ (-1.6529 \ , \ -1.9642 \ , \ -1.1261) \ \ , \ \ (-0.9925 \ , \ 1.6497 \ , \ -1.7364) \ \ , $$ $$ (-1.5028 \ , \ 0.9689 \ , \ 1.3197) \ \ , \ \ (1.8952 \ , \ 1.7184 \ , \ 0.6390) \ \ . $$

I verified by graphing that each of the four implied planes $ \ x + y + z = c \ $ did indeed meet the space curve at just one point. The two graphs below show the plane $ \ x + y + z \ \approx \ 4.2525 \ , $ representing the maximum value for $ \ f(x,y,z) \ $ and the corresponding point in the first octant, and the plane $ \ x + y + z \ \approx \ -4.7431 \ $ and the point solution in the diagonally-opposite octant for the minimum function value. (The points lie at the ends of pale-yellow arrows.)

enter image description here