Multivaraible calculus,Global minima maxima How do I compute the global minimum or maximum of the function
$f(x,y)=-\sin x\cos y$.
Given it is on a square $(0\leq x\leq 2\pi)$ and $(0\leq y\leq2\pi)$
 A: The "black box" approach, which will work for all similar problems:
First, compute the local minima of the function on the interior of the square. Do this by taking the gradient and setting it equal to zero to find the critical points, and then evaluating the function at the critical points.
Then, compute the minimum of the function on the boundary of the square, i.e. on each of the square's four sides. Luckily, the square has been set up to make this easy on you.
The global minimum is then the least interior local minimum, or the minimum on the boundary, whichever is smallest.

The "clever" approach:
Since $-1 \leq \sin x, \cos x \leq 1$, your $f(x,y)$ can never be any smaller than $-1$. Can you find a point on the square where it is exactly $-1$?
A: The inequality chain already mentioned by user7530 establishes the range of the function rather quickly:
$$ -1 \ \le \ \sin \ x \ \le \ +1 \ \ \Rightarrow \ \ -1 \ \le \  -\sin \ x \ \le \ +1 $$
$$ \Rightarrow \ \ -1 \ \le \ -\cos \ y \ \le \  -\sin \ x \ \cos \ y \ \le \ \cos \ y \ \le \ +1  \ \ . $$
It's a little more work to locate the points where the global extrema occur, at least by some methods, because of a small complicating factor.  For the region $ \ (x, \ y) \ \in \ [0 \ , \ 2 \pi] \times [0 \ , \ 2 \pi] \ $ , we can work with the sinusoidal functions involved in various ways.
$ \  $ 
1. Since $ \ \sin \ x \ > \ 0 \ \ $ on $ \ \ (0 \ , \ \pi) \ \ , \ \ \sin \ x \ < \ 0 \ \ $ on $ \ \ (\pi \ , \ 2 \pi) \ \ , \ \ \cos \ x \ > \ 0 \ \ $ on $ \ \ (0 \ ,  \frac{\pi}{2}) \ \ , $ $ (\frac{3 \pi}{2} \ , \ 2 \pi) \ \ $ , and $ \ \ \cos \ x \ < \ 0 \ \ $ on $ \ \ (\frac{\pi}{2} \ , \ \frac{3 \pi}{2}) \ $  , our square is divided up into six sections, shown in the graph below, with the regions marked in green being those where $ \ f(x, y) \ = \ -\sin x \ \cos y \ > \ 0 \ $ and those where $ \ f(x, y) \ < \ 0 \ $ (the lines separating the regions indicate where $ \ f(x, y) \ = \ 0 \ $ ) .  
We know from the symmetry of the sinusoidal functions that their extrema occur midway between their zeroes.  Consequently, the global extrema occur at the centers of the squares of what would be the "infinite checkerboard" covering the plane, the maxima being marked by the green stars, the minima, by red stars.

$ \ $
2. We can apply a "product-to-sum formula" for the sinusoidal functions to write
$$ -\sin \ x \ \cos \ y \ = \ -\frac{1}{2} \ [ \ \sin(x + y) \ + \ \sin(x - y) \ ] \ \ . $$
We can see that this function will attain its global extrema among the points where $ \ \sin(x + y) \ = \ \pm 1 \ \ $ and $  \ \ \sin(x - y) \ = \ \pm 1 \ $ .  This gives us the "candidate" results
$$ x \ + \ y \ = \ \frac{\pi}{2} \ (2m \ + \ 1) \ \ , \ \ x \ - \ y \ = \ \frac{\pi}{2} \ (2n \ + \ 1) \ \ , \quad \mathbf{[ 1 ]} $$
that is, the sum and difference of $ \ x \ $ and $ \ y \ $ must be odd integer  multiples of $ \ \frac{\pi}{2} \ $ .  The graph below shows the lines described by these equations as they pass through our square region.

The complication in this approach is that we want both sine-function terms in the sum for our function to have the same sign ; where they do not, the sum of terms is zero.  Of the twelve candidates implied by the intersections of these lines, six of them are points where the terms have opposite signs [marked by " 0 "] ; eliminating these leaves the six points where the extrema are found [marked by asterisks].
(A somewhat more analytical approach would be to solve the pair of equations  [ 1 ]  above for $ \ x \ $ and $ \ y \ $ , giving us
$$ x \ = \ (m \ + \ n \ + 1 ) \ \cdot \ \frac{\pi}{2} \ \ , \ \ y \ = \ (m \ - \ n  ) \ \cdot \ \frac{\pi}{2} \ \ . $$
For $ \ m \ $ and $ \ n \ $ both odd or both even, $ \ x \ $ is then an odd multiple of $ \ \frac{\pi}{2} \ $ and $ \ y \ $ , an even multiple of $ \ \frac{\pi}{2} \ $ , or equivalently, any integer multiple of $ \ \pi \ $ ; these are the locations of the global extrema.  For one of $ \ m \ $ or $ \ n \ $ being odd and the other even, $ \ x \ $ is the integer multiple of $ \ \pi \ $ and $ \ y \ $ , the odd multiple of $ \ \frac{\pi}{2} \ $ ; these are where the zeroes of $ \ f(x, y) \ $ lie.)
$ \ $
3.  We could, of course, use calculus on this problem.  The first partial derivatives of our function are
$$ f_x \ = \ - \cos \ x \ \cos \ y \quad , \quad  f_y \ = \ \sin \ x \ \sin \ y \  .  $$
Setting these derivatives equal to zero and solving for $ \ x \ $ and $ \ y \ $ leads to essentially the same situation as in the previous approach: twelve candidate points. (This is unavoidable since the function and its derivatives have factors which become zero at the same variable values.)  We can construct the "discriminator"
$$ D \ = \ f_{xx} \ f_{yy} \ - \ (f_{xy})^2 \ $$
$$ = \ (\sin \ x \ \cos \ y) \ (\sin \ x \ \cos \ y) \ - \ (\cos \ x \ \sin \ y)^2  $$
$$ = \ \sin^2  x \ \cos^2  y \ - \ \cos^2  x \ \sin^2  y \ = \ \sin^2  x \ - \ \sin^2  y \ \ . $$
For those points where $ \ x \ $ is an integer multiple of $ \ \pi \ $ and $ \ y \ $  an odd multiple of $ \ \frac{\pi}{2} \ $ , we have $ \ D \ = \ 0^2 \ - \ 1^2 \ = \ -1 \ $ , which means that the zeroes of $ \ f(x,y) \ $ are saddle points.  In the contrasting case, $ \ D \ = \ 1^2 \ - \ 0^2 \ = \ +1 \ $ , indicating that these points are relative (local) extrema.  Specifically, we find
$$ \text{for} \ \ \left( \frac{\pi}{2}, \ 0 \ \right) \ , \ \left( \frac{\pi}{2}, \ 2 \pi \ \right) , \ \left( \frac{3 \pi}{2}, \ \pi \ \right) \ \ , \ \ f_{xx} \ = \ +1 \quad \text{[minima]} \ \ ; $$
$$ \text{for} \ \ \left( \frac{\pi}{2}, \ \pi \ \right) \ , \ \left( \frac{3 \pi}{2}, \ 0 \ \right) , \ \left( \frac{3 \pi}{2}, \ 2 \pi \ \right) \ \ , \ \ f_{xx} \ = \ -1 \quad \text{[maxima]} \ \ . $$
As has already been indicated by the bounded range of this function, the relative extrema listed here are also global extrema.
