# finding maximum and minimum of a multivariable function in restricted domains

Find the maximum and minimum values of $$f(x,y)=xy-2x$$ on the rectangle $$-1\leq x \leq1$$ and $$0\leq y \leq 1$$.

I don't understand the approach. The solution manual suggests that the critical point is not inside my domain so maximum and minimum values of $$f$$ must be on one of the four boundary points. I don't understand how we get to this conclusion.

• write $f(x,y)=x(y-2)$ and note $y-2<0$. So, intuitively, $f(-1,0)=2$ (max) and $f(1,0)=-2$ (min). May 2, 2019 at 12:24

If you take the gradient of $f$ you have $$\nabla f = ( y - 2, x)' = (0,0)',$$ i.e., the critical point is $(0,2)$ which lies outside of your domain. As such, you'll get the global maximum and minimum in $D$ on $\partial D$. Namely, check for $-1 \le x \le 1$ and $y=0$, and you'll get $$g(x)= -2x,$$ that is monotone decreasing function, i.e., $(-1, 0)$ is a candidate point. For $y=1$ you have $$g(x) = x - 2x,$$ hence $(-1, 1)$ is a candidate point. Then, check $x=1$ and $0 \le y \le 1$, thus $$g(y)= y - 2,$$ i.e., $(1,1)$i is another candidate. For $x=-1$ you'll get $$g(y)=-y+2,$$
so $(-1,0)$ is another point. Finally, check the connection points of the $4$ parts of $\partial D$, i.e., $(-1, 0)$, $(-1,1)$, $(1, 0)$ and $(1,1)$ that are mostly the same candidates as in the aforementioned analysis. Finally, just compare $f$ in all of these points.