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?? 
 A: i am going to offer a more intuitive approach to this problem.
let f(x)=sin(x) on closed interval [0,2pi], then max f(x) = 1 at x = pi/2
similarly, let f(x)=cos(x) on closed interval [0,2pi], then max f(x) = 1 at x = 0 and 2pi
now consider f(x,y)=sin(x)+cos(y).  now is not apparent that max f(x,y) must equal 2 at (pi/2, 0), (pi/2, 2pi).
so there are two local maxima on closed interval [0,2pi], all of which give f(x,y)=2
similarly, sin(x) = -1 on closed interval [0,2pi] for x = 3/2pi.
cos(x) = -1 on [0,2pi] for x = pi
thus, there is one local minima on [0,2pi] at (3/2pi, pi), which cause f(x,y)=-2
A: To do the second step you calculate the partial derivatives with respect to whatever variable is free on the boundary.  For example, if $x$ is oriented horizontally and $y$ is vertically, then to determine the critical points on the top of the square, calculate the partial wrt to $x$ evaluated at $y=0$.  Likewise for the botton, the partial wrt $x$ evaluated at $y=2\pi$.
A: 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*}
A: For the local minimas obtained, chack the one that has the lowest value.
A: Answer to question 2. And some warnings.
$f(x,y)=xy.$ One has $\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*}
We study the restriction of $f$ to each set $A,\ B,$ $C,$ and $D.$
\begin{equation*}
f_{\mid A}(x,y)=f(x,-)=-x=g(x),\ \ \ with\ \ \ -1\leq x\leq 1.
\end{equation*}
The\ function$\ g\ $is\ clearly$\ $decreasing then $\max_{A}f(x,y)=\max%
\limits_{y\in \left[ -1,1\right] }g(x)=g(-1)=-(-1)=1.$
\begin{equation*}
f_{\mid B}(x,y)=f(1,y)=y=h(y),\ \ \ with\ \ \ -1\leq y\leq 1.
\end{equation*}%
The\ function$\ h\ $is\ clearly\ increasing then $\max\limits_{B}f(x,y)=\max%
\limits_{y\in \left[ -1,1\right] }h(y)=h(1)=1.$%
\begin{equation*}
f_{\mid C}(x,y)=f(x,1)=x\cdot 1=x=h(x),\ \ \ with\ \ \ -1\leq x\leq 1.
\end{equation*}
The\ function$\ h\ $(the same as for the side $B$) is\ increasing then $%
\max\limits_{C}f(x,y)=\max\limits_{x\in \left[ -1,1\right] }h(x)=h(1)=1.$%
\begin{equation*}
f_{\mid D}(x,y)=f(-1,y)=-y=g(y),\ \ \ with\ \ \ -1\leq y\leq 1.
\end{equation*}
The\ function$\ g\ $(the same as for the side $A$)$\ is$ decreasing then $%
\max_{D}f(x,y)=\max\limits_{y\in \left[ -1,1\right] }g(x)=g(-1)=-(-1)=1.$
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 \{1,\ 1,\ 1,\ 1\} \\
&=&1.
\end{eqnarray*}
WARNING: If seems to me that you think that a differentiable function say $%
g(t)$ defined for $t\in \left[ a,b\right] $ admits an extremum at $t_{0}$ if
and only if $g^{\prime }(t_{0})=0.$ THIS\ IS\ FALSE!
WHAT\ IS\ INSTEAD\ TRUE IS the following assertions: 


*

*If $g$ admits an extremum at $t_{0}\in (a,b)$ then $g^{\prime }(t_{0})=0.$

*The converse of 1. above is false: That is to say, if $t_{0}\in (a,b)$ is
such that $g^{\prime }(t_{0})=0$ then you can not say that $g$ admits an
extremum at $t_{0}.$ Consider for instance $g(x)=x^{3}$ and $\left[ a,b%
\right] =[-1,1].$ One has $g^{\prime }(0)=2\cdot 0^{2}=0,$ but the function $%
g$ is increasing on $[a,b]$ and admits no extremum at $t_{0}=0.$

*If $g$ admits an extremum at $t_{0}\in [a,b]$ (be careful, this
set $[a,b]$ is closed on both sides) then either $t_{0}=a$ or $t_{0}=b$ or $%
t_{0}\in (a,b)$ and in this last case one should have $g^{\prime }(t_{0})=0.$
So if $g^{\prime }(t)\neq 0$ for all $t\in (a,b)$ then it does not mean that
there is no extremum of $g$, because this one can be $at$ $a$ or at $b.$ It
is the case of our function above $g(x)=-x$ on $[-1,1].$ One has $g^{\prime
}(x)=-1\neq 0$ for all $x\in \left[ -1,1\right] $ but $g$ admits a maximum
at $x=-1$ and a minimum at $x=+1.$
A: The second step is:
'2. Find the critical points of f, when we look at it as a function that is
defined only at $U$. 
I agree with you that the question asks to find the critical points on the
boundary of $U$ only! However, why do we do this step? Why do we look for those
critical points? Answer, because we are going to check our maximum (and min)
among them in a further step. I did a shortcut. So, now i will answer the exact questions (with no shortcuts). I
will re-write my answer as follows.
$\bf{STEP 2.}$ $f(x,y)=xy.$ One has $\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*}
We study the restriction of $f$ to each set $A,\ B,$ $C,$ and $D.$
\begin{equation*}
f_{\mid A}(x,y)=f(x,-1)=-x=g(x),\ \ \ with\ \ \ -1\leq x\leq 1.
\end{equation*}
The function $g$ is clearly decreasing ($g^{\prime }(x)=-1<0$ for all 
$x,\ -1\leq x\leq 1.$ Then, critical points of $f$ on the side $A$ would be
the two extremities $(-1,-1)$ and $(1,-1).$ [This means that if $f$ admits a
maximum or a minimum as a function defined on the segment $A$ (only) it would
be necessary at these two points.]
Now, let's go to the side $B.$ One has
\begin{equation*}
f_{\mid B}(x,y)=f(1,y)=y=h(y),\ \ \ with\ \ \ -1\leq y\leq 1.
\end{equation*}
The function $ h$ is clearly increasing ($h^{\prime }(y)=1$ for all $y$
such that $-1\leq y\leq 1.$ Then, critical points of $f$ on the side $B$
would be the two extremities of the side $B,$ $(1,-1)$ and $(1,1).$ [This
means that if $f$ admits a maximum or a minimum as a function defined on the
segment $B$ (only) it would be necessary at these two points.]
Now, let's go to the side $C.$ One has
\begin{equation*}
f_{\mid C}(x,y)=f(x,1)=x\cdot 1=x=h(x),\ \ \ with\ \ \ -1\leq x\leq 1.
\end{equation*}
The function $h$ is clearly increasing ($h^{\prime }(x)=1$ for all $x$
such that $-1\leq x\leq 1.$ Then, critical points of $f$ on the side $C$
would be the two extremities of the side $C,$ $(-1,1)$ and $(1,1).$ [This
means that if $f$ admits a maximum or a minimum as a function defined on the
segment $C$ (only) it would be necessary at these two points.]
At last, let's go to the side $D.$ One has
\begin{equation*}
f_{\mid D}(x,y)=f(-1,y)=-y=g(y),\ \ \ with\ \ \ -1\leq y\leq 1.
\end{equation*}
The function $g$ is clearly decreasing ($g^{\prime }(y)=-1<0$ for all $y
$ such that $-1\leq y\leq 1.$ Then, critical points of $f$ on the side $D$
would be the two extremities of the side $D,$ $(-1,-1)$ and $(-1,1).$ [This
means that if $f$ admits a maximum or a minimum as a function defined on the
segment $D$ (only) it would be necessary at these two points.] END OF
STEP 2.
$\bf{STEP 3.}$ Now we have to find max and min of $f$ on the whole set $U$
including its boundary $\partial U.$ The list of critical points on this
whole set is
\begin{eqnarray*}
intU &\rightarrow &(0,0),\ and\ f(0,0)=0. \\
A &\rightarrow &(-1,-1)\ and\ (1,-1):f(-1,-1)=1\ and\ f(1,-1)=-1.\  \\
B &\rightarrow &(1,-1)\ and\ (1,1):f(1,-1)=-1\ and\ f(1,1)=1. \\
C &\rightarrow &(-1,1)\ and\ (1,1):f(-1,1)=-1\ and\ f(1,1)=1. \\
D &\rightarrow &(-1,-1)\ and\ (-1,1):f(-1,-1)=1\ and\ f(-1,1)=-1.
\end{eqnarray*}
It follows that the values of $f$ on these critical points are
\begin{equation*}
-1=f(1,-1)=f(-1,1),\ 0=f(0,0),\ and\text{ }1=f(-1,-1)=f(1,1).
\end{equation*}
$\bf{STEP 4.}$ Now to find the maximum of $f$ on the closed square $intU\cup
\partial U=\left[ -1,1\right] \times \left[ -1,1\right] ,$ it suffices to
pick up the point where $f$ takes its maximum value among the above list of
critical points.
\begin{eqnarray*}
\max_{\left[ -1,1\right] \times \left[ -1,1\right] }f(x,y) &=&\max
\{f(0,0),\ f(-1,-1),\ f(1,-1),\ f(1,1),\ f(-1,1)\} \\
&=&\max \{0,\ 1,\ -1,\ 1,\ -1\} \\
&=&1.
\end{eqnarray*}
The maximum value is obtained at two points $1=f(-1,-1)=f(1,1).$
Now to find the minimum of $f$ on the closed square $intU\cup \partial U=%
\left[ -1,1\right] \times \left[ -1,1\right] ,$ it suffices to pick up the
point(s) where $f$ takes its minimum value among the above list of critical
points.
\begin{eqnarray*}
\min_{\left[ -1,1\right] \times \left[ -1,1\right] }f(x,y) &=&\min
\{f(0,0),\ f(-1,-1),\ f(1,-1),\ f(1,1),\ f(-1,1)\} \\
&=&\min \{0,\ 1,\ -1,\ 1,\ -1\} \\
&=&-1.
\end{eqnarray*}
The minimum value is obtained at two points $-1=f(1,-1)=f(-1,1).$
A: Since $f$ is $2\pi$-periodic in both variables the values taken by $f$ on the given square are the same as the values taken by $f$ on all of ${\mathbb R}^2$. As any point $(x,y)\in{\mathbb R}^2$ îs an interior point extremal values are taken at the zeros of $\nabla f$, of which there are four  per fundamental square (you have determined them). Comparing the values assumed by $f$ in these points one finds that $$\max_{(x,y)\in[0,2\pi]^2} f(x,y)=\max_{(x,y)\in{\mathbb R}^2} f(x,y)=f\left({\pi\over2},0\right)=2\ ,$$
and similarly
$$\min_{(x,y)\in[0,2\pi]^2} f(x,y)=\min_{(x,y)\in{\mathbb R}^2} f(x,y)=-2\ ,$$
as could have been found out by inspection of  the definition of $f$ right from the start.
