<s>[INST] Find the absolute maximum and minimum value of $f$ I have to find the absolute maximum and minimum value of $$f(x, y)=\sin x+\cos y$$ on the rectangle $[0, 2\pi] \times [0, 2\pi]$. 
I have done the following: 
$$\nabla f=(\cos x, -\sin y)$$ 
$$\nabla f=0 \Rightarrow \cos x=0 \text{ and } -\sin y=0 \Rightarrow x=\frac{\pi}{2}, \frac{3 \pi}{2} \text{ and } y=0, \pi, 2\pi$$ 
The critical points are $$\left (\frac{\pi}{2}, 0\right ), \left (\frac{\pi}{2}, \pi\right ), \left (\frac{\pi}{2}, 2 \pi\right ), \left (\frac{3\pi}{2}, 0\right ), \left (\frac{3\pi}{2}, \pi\right ), \left (\frac{3\pi}{2}, 2\pi\right )$$  
The second derivatives are: 
$$\frac{\partial^2{f}}{\partial{x^2}}=-\sin x \ \ ,\ \  \frac{\partial^2{f}}{\partial{y^2}}=-\cos y \ \ ,\ \  \frac{\partial^2{f}}{\partial{x}\partial{y}}=0$$ 


*

*$$\left (\frac{\pi}{2}, 0\right ): \ \  \frac{\partial^2{f}}{\partial{x^2}}\left (\frac{\pi}{2}, 0\right )=-1<0$$ 

*$$\left (\frac{\pi}{2}, \pi\right ): \ \  \frac{\partial^2{f}}{\partial{x^2}}\left (\frac{\pi}{2}, \pi\right )=-1<0$$ 

*$$\left (\frac{\pi}{2}, 2 \pi\right ): \ \ \frac{\partial^2{f}}{\partial{x^2}}\left (\frac{\pi}{2}, 2 \pi\right )=-1<0$$ 

*$$\left (\frac{3\pi}{2}, 0\right ): \ \ \frac{\partial^2{f}}{\partial{x^2}}=1>0 \\ D=(\frac{\partial^2{f}}{\partial{x^2}})(\frac{\partial^2{f}}{\partial{y^2}})-(\frac{\partial^2{f}}{\partial{x}\partial{y}})^2=-1<0$$ 

*$$\left (\frac{3\pi}{2}, \pi\right ): \ \ \frac{\partial^2{f}}{\partial{x^2}}\left (\frac{3\pi}{2}, \pi\right )=1>0 \\ D=(\frac{\partial^2{f}}{\partial{x^2}})(\frac{\partial^2{f}}{\partial{y^2}})-(\frac{\partial^2{f}}{\partial{x}\partial{y}})^2=1>0 \Rightarrow \left (\frac{3\pi}{2}, \pi\right ) \text{ is a local minima } $$ 

*$$\left (\frac{3\pi}{2}, 2\pi\right ): \ \ \frac{\partial^2{f}}{\partial{x^2}}\left (\frac{3\pi}{2}, 2\pi\right )=1>0 \\ D=(\frac{\partial^2{f}}{\partial{x^2}})(\frac{\partial^2{f}}{\partial{y^2}})-(\frac{\partial^2{f}}{\partial{x}\partial{y}})^2=1>0 \Rightarrow \left (\frac{3\pi}{2}, 0\right ) \text{ is a local minima }$$ 


That means that the minimum value of $f$ is $$f\left (\frac{3\pi}{2}, 0\right )=f\left (\frac{3\pi}{2}, 2\pi\right )=0$$ 
Is this correct?? 
$$$$  
EDIT1: 
We have to do the following steps: 


*

*Find all the critical points of $f$ in $U$. 

*Find the critical points of $f$, when we look at it as a function that is defined only at $\partial U$. 

*Calculate the value of $f$ at all the critical points. 

*Compare all these values and pick the greatest one and the smallest one. 


$U$ is the open rectangle. How can we do the second step? 
$$$$ 
EDIT2: 
First step: 
$$\nabla f=(\cos x, -\sin y)$$ 
$U=(0, 2 \pi ) \times(0, 2\pi)$ 
$$\nabla f=0 \Rightarrow \cos x=0 \text{ and } -\sin y=0 \Rightarrow x=\frac{\pi}{2}, \frac{3 \pi}{2} \text{ and } y= \pi$$ 
The critical points in $U$ are $$\left (\frac{\pi}{2}, \pi\right ), \left (\frac{3\pi}{2}, \pi\right )$$ 
Second step: 
Do we suppose that $x$ and $y$ can take only the values $0$ and $2 \pi$??  

I have to find the absolute maximum and minimum value of $$f(x, y)=xy$$ on the rectangle $[-1, 1] \times [-1, 1]$. 
I have done the following: 
We have to do the following steps: 


*

*Find all the critical points of $f$ in $U=(-1, 1) \times (-1, 1)$. 

*Find the critical points of $f$, when we look at it as a function that is defined only at $\partial U$. 

*Calculate the value of $f$ at all the critical points. 

*Compare all these values and pick the greatest one and the smallest one. 


First step: 
$$\nabla f=(y, x)$$ 
$$\nabla f=0 \Rightarrow y=0 \text{ and } x=0$$ 
The only critical point in $U$ is $$(0, 0)$$ 
Second step: 
$\partial U=A\cup B\cup C\cup D$ with
\begin{eqnarray*}
A &=&\left\{ (x,-1):-1\leq x\leq 1 \right\}  \\
B &=&\left\{ (1 ,y):-1\leq y\leq 1 \right\}  \\
C &=&\left\{ (x,1 ):-1\leq x\leq 1 \right\}  \\
D &=&\left\{ (-1,y):-1\leq y\leq 1 \right\} .
\end{eqnarray*} 
$$A: f(x, -1)=-x=g(x) \\ g'(x)=0 \Rightarrow -1=0$$ 
$$B: f(1, y)=y=g(y) \\ g'(y)=0 \Rightarrow 1=0$$ 
$$C: f(x, 1)=x=g(x) \\ g'(x)=0 \Rightarrow 1=0$$ 
$$D: f(-1, y)=-y=g(y) \\ g'(y)=0 \Rightarrow -1=0$$ 
That means that there are no critical points on the boundary $\partial{U}$. 
Third step: 
The value of $f$ at the critical point $(0, 0)$ is $f(0, 0)=0$. 
Is it correct so far?? 
Forth step: 
How can $f$ have an absolute maximum and minimum value if there is only one critical point?? Or have I done something wrong?? 
 [/INST] Answer to question 2. (only)
$f(x,y)=\sin x+\cos y.$ One has $\partial U=A\cup B\cup C\cup D$ with
\begin{eqnarray*}
A &=&\left\{ (x,0):0\leq x\leq 2\pi \right\}  \\
B &=&\left\{ (2\pi ,y):0\leq y\leq 2\pi \right\}  \\
C &=&\left\{ (x,2\pi ):0\leq x\leq 2\pi \right\}  \\
D &=&\left\{ (0,y):0\leq y\leq 2\pi \right\} .
\end{eqnarray*}
We study the restriction of $f$ to each set $A,\ B,$ $C,$ and $D.$
\begin{eqnarray*}
f_{\mid A}(x,y) &=&f(x,0)=\sin x+\cos 0=\sin x+1,\ \ \ with\ \ \ 0\leq x\leq
2\pi . \\
\max_{A}f(x,y) &=&\max_{0\leq x\leq 2\pi }\sin x+1=1+1=2.
\end{eqnarray*}
\begin{eqnarray*}
f_{\mid B}(x,y) &=&f(2\pi ,y)=\sin 2\pi +\cos y=\cos y,\ \ \ with\ \ \ 0\leq
y\leq 2\pi . \\
\max_{B}f(x,y) &=&\max_{0\leq y\leq 2\pi }\cos y=1.
\end{eqnarray*}
\begin{eqnarray*}
f_{\mid C}(x,y) &=&f(x,2\pi )=\sin x+\cos 2\pi =\sin x+1,\ \ \ with\ \ \
0\leq x\leq 2\pi . \\
\max_{C}f(x,y) &=&\max_{0\leq x\leq 2\pi }\sin x+1=1+1=2.
\end{eqnarray*}
\begin{eqnarray*}
f_{\mid D}(x,y) &=&f(0,y)=\sin 0+\cos y=\cos y,\ \ \ with\ \ \ 0\leq y\leq
2\pi . \\
\max_{D}f(x,y) &=&\max_{0\leq y\leq 2\pi }\cos y=1.
\end{eqnarray*}
Now we have
\begin{eqnarray*}
\max_{\partial U}f(x,y) &=&\max \{\max_{A}f(x,y),\ \max_{B}f(x,y),\
\max_{C}f(x,y),\ \max_{D}f(x,y)\} \\
&=&\max \{2,\ 1,\ 2,\ 1\} \\
&=&2.
\end{eqnarray*}
</s>