We want to maximize $(x-1)^2 + (y-1)^2$ restricted to $x + y \le 2$ and $x, y \ge 0$.
I tried the following combinations:
$x \gt 0, y \gt 0$ This led me to no critical point.
$x \gt 0, y = 0$ This led me to these two critical points: $P_1(1, 0), \lambda = 0$ and $P_2(2, 0), \lambda = -2$.
$x = 0, y \gt 0$ This led me to these two critical points: $P_1(0, 1), \lambda = 0$ and $P_2(0, 2), \lambda = -2$.
$x = 0, y = 0$ This led me to these two critical points: $P_1(0, 0), \lambda = 0$ and $P_2(0, 0), \lambda \lt 2$.
My handbook says the global optima are: $x = 2, y = 0, \lambda = -2$ and $x = 0, y = 0, \lambda = 0$.
So here I have several questions:
1) How do I distinguish between global and local optima in these cases? The hessian matrix does not seem to be useful in this case. For example, how can I know that $x = 2, y = 0, \lambda = -2$ is a global optima, but $x = 1, y = 0, \lambda = 0$ is not? Intuition can help, but I want the method.
2) Why would $x = 2, y = 0, \lambda = -2$ be a global optima, and $x = 0, y = 2, \lambda = -2$ would not?
3) Why would $x = 0, y= 0, \lambda = 0$ be a global maxima? It is a bit counterintuitive.
4) Would it be impossible to determine the value of $\lambda$ in $P_2$ of $x = 0, y = 0$ combination? (This is the case in which we assume $\lambda \lt 0$, while in $P_1$ we assumed $\lambda = 0$).
5) Feel free to add any information needed to understand why the answer of my handbook is the correct one (which are the global maxima) and not all of above critical points, in case this is not clear with the answers to questions 1, 2, 3 and 4.
Thank you very much for your time.
Graphically, refer to the graph:
$\hspace{0.5cm}$
The green area is the feasible region.
The red circle center $C$ and passing through the points $A$, $B$ and $O$ is the largest contour curve. Hence, the global maxima is at $A(0,2)$, $B(2,0)$ and $O(0,0)$.
The red point $C$ is the smallest contour curve. Hence, the global minima is at $C(1,1)$.