Find extrema (max,min) of a 3 variable function on a given domain $f(x,y,z) = (x^2+y^2)e^z$
with domain = $D=\{x^2+y^2=4 , (x-2)^2+y^2 +z^2<= 4\}$
I found that a possible min/max could be the point $(0,0)$ (grad(f)=0..)


*

*I can see that the boundary of $D$ is $z^2-4x+4=0$ which is the intersection between the cylinder $x^2+y^2=4$ and the sphere $(x-2)^2+y^2 +z^2<= 4$

*So I need to find the min/max on $D$ and on its boundary separately

*I checked the min/max using $Lagrange multiplier $ on the cylinder $x^2+y^2=4$, but here is the problem : The LaGrange system has 3 equation with 4 variables:


$f_x+\gamma g_x=0$ 
$f_y+\gamma g_y=0$
$x^2+y^2=4$
I dont know how to behave without a z in my constrain ->$x^2+y^2=4$


*

*I have the same problem with $z^2-4x+4=0$ if I do lagrange I dont know the $y$


Can you help me figure out the system clearly and find min/max constrained and not. Thx.
EDIT : I managed to find the max/min on the constrain -> I did the LaGrange system of 5 equations , so I used two constrains inside the system (not just one at a time). and I found $(2,0,+-2)$ which is correct. But I still can't figure out how to calculate max/min inside the domain $D$
 A: In general, the method of Lagrange multipliers only applies to problems with equality constraints. Since this problem has inequality constraints, you would need to use the generalization of Lagrange multipliers, which are called the Karush-Kuhn-Tucker Conditions.
However, here's an alternative ad hoc way to solve this problem. Notice that the term $x^2+y^2$ appears in the objective function, but we have the constraint that $x^2+y^2=4$. Hence, we can reduce our problem to
$$
\begin{array}{rl}
\text{optimize}\ & 4e^z \\
\text{s.t.}\ &(x-2)^2+y^2+z^2\leqslant 4
\end{array}
$$
However, we can expand $(x-2)^2=x^2-4x+4$ and use the fact that $x^2+y^2=4$ to obtain
$$
\begin{array}{rl}
\text{optimize}\ & 4e^z \\
\text{s.t.}\ &z^2\leqslant 4(x-1) \\
& -2\leqslant x\leqslant 2
\end{array}
$$
(the bounds on $x$ are required to satisfy the constraint $x^2+y^2=4$).
In this form, it's pretty easy to see what the minimum and maximum are in terms of $(x,z)$. For example, to maximize the function, we need $z$ to be as large as possible. Hence, we want $4(x-1)$ to be as large as possible, which happens when $x=2$. For this value of $x$, the largest possible value of $z$ is $2$. Hence the maximum occurs at $(x,y,z)=(2,0,2)$ (you can then solve for $y$ using the relation $x^2+y^2=4$).
