<s>[INST] Global extremas of $f(x,y)=2x^2+2y^2+2xy+4x-y$ on the region $x\leq 0, y\geq 0, y\leq x+3$ I have the following two variable function $f(x,y)=2x^2+2y^2+2xy+4x-y$ and I need to find its global extremas on the region $x\leq 0, y\geq 0, y\leq x+3$.
 As in the other questions I asked in the last days, I have no solution to this old exam question so I would like your feedback on wether my results are correct or not.
In the inside of our domain, we have :
$$f_x=4x+2y+4=0$$
$$f_y=4y+2x-1=0$$
So $y=1$ and $x=\frac{-3}{2}$ . This point lies in our domain so it is a candidate.
On the border, we have $$f(x, 0)=2x^2+4x, f'=4x+4 = 0 $$ so $x=-1$
We also have $$f(0,y)=2y^2-y, f'=4y-1=0$$ so $y=\frac{1}{4}$

And $$f(x, x+3)=2x^2+2(x+3)^2+2x(x+3)+4x-(x+3), f'=3(4x+7)=0$$ (WolframAlpha gets the same derivative for this $f(x,x+3)$). So we get $x=-\frac{7}{4}, y=x+3=\frac{5}{4}$
Now, we also have our endpoints $(-3,0), (0,3), (0,0)$
Now we plug each of our candidate into our function and look for the greatest/ smallest value which will be our global maximum/ minimum.
$(-\frac{3}{2},1) : -\frac{7}{2}$ 
$(-1,0):-2$ 
$(0,\frac{1}{4}) : - \frac{1}{8}$ 
$(- \frac{7}{4}, \frac{5}{4}) : - \frac{27}{8}$ 
$(-3,0) : 6$ 
$(0,0) : 0$ 
$(0,3) : 15$
So there seems to be a global maximum of $15$ at $(0,3)$ and a global minimum of $- \frac{7}{2}$ at $(- \frac{3}{2},1)$.

Are my results correct or did I miss/ forgot something ?
Also, this problem took me quite some time. Not enormously, but still. Is there a shortcut or a better way to proceed to see that the function actually reaches its global maximum at one of the endpoints and its minimum at $(- \frac{3}{2}, 1)$ ?
Thanks for your feedback !
 [/INST] A solution without calculus.
Adopt new variables $x = u - v$, $y = u + v$. The objective function:
\begin{align*}
2x^2 + 2y^2 + 2xy + 4x - y &= 2(u^2 - 2uv + v^2) + 2(u^2 + 2uv + v^2) + 2(u^2 - v^2) + 4(u-v) - (u+v) \\
&= 6u^2 + 2v^2 + 3u - 5v \\
&= 6 \left( u + \frac{1}{4} \right)^2 + 2 \left(v - \frac{5}{4}\right)^2 - \frac{7}{2}.
\end{align*}
The constraints:
\begin{align*}
x \leq 0 &\Longrightarrow u \leq v \\
y \geq 0 &\Longrightarrow u \geq -v \\
y \leq x + 3 &\Longrightarrow v \leq \frac{3}{2}.
\end{align*}
We may combine the constraints as an easier-to-visualize $|u| \leq v \leq \frac{3}{2}$.
The objective function clearly has a global minimum over all of $\mathbb{R}^2$ at $(u, v) = (-\frac{1}{4}, \frac{5}{4})$, i.e. $(x, y) = (-\frac{3}{2}, 1)$, which is within the constraints. Furthermore, as the objective function is convex, its maximum on a convex polygon must be at a vertex, and it is easy to check all three possible vertices. The maximum is $(u, v) = (\frac{3}{2}, \frac{3}{2})$ or $(x, y) = (0, 3)$.
</s>