

For now, ignore any critical points that occur on the boundary of
.
Case 1: If
, then either
or
, so we have two critical points (0, 0) and (4, 0), both on the boundary.
Case 2: Suppose

. Then ...
Case 2a: ... if
, then
- critical point at (0, 4) on the boundary.
Case 2b: ... if
, then
- critical point at (2, 0) on the boundary.
Case 2c: ... if
, then

- critical point at (1, 2) not on the boundary.
We compute the Hessian matrix of
:


which means (1, 2) is a local maximum, where we get
.
Now we consider the boundary in three parts:
(1) Fix
. Then
. It's possible that 0 is the smallest value of
whereever you go.
(2) Fix
. Then
, and we get the same result as in the previous case.
(3) Fix
. Then
. Denote this function by
. We compute the first derivative and find the critical points:

then compute the second derivative and determine its sign at these points:

which indicates that a maximum occurs as
and a minimum at
. Respectively, we have
and
, and
and
.
So the absolute maximum of
over
is 4 at (1, 2), and the absolute minimum is -64 at (2, 4).