We apply the method of Lagrange multipliers,

where
and the constraint is
. This gives

The first equation produces the system

and isolating
we find that

Substituting
into the equation of the constraint
we obtain

Finally, comparing the values of
at these points, we see that

and

from which we conclude that the maximum occurs when
and
, while the minimum occurs when
and
. In summary,
