I have the following optimization problem:
$\max_{x,y} xy $ subject to $ x, y \geq 0$ and $y + x^2 \leq 6$.
I know how to solve this problem. By looking at the objective function it is clear that the maximum must lie on $y + x^2 = 6$ and then it can be found as
$\max_x x(6-x^2)$ for $x \in [0, \sqrt{6}]$.
I would like to practice Lagrange multipliers by doing it that way. So I set up the Lagrangian
$L(x,y, \lambda, \mu, \nu) = xy - \lambda (y + x^2 - 6) + \mu x + \nu y$
and look at the KKT conditions:
$ \frac{\partial L}{\partial x} = y - 2\lambda x + \mu = 0$
$ \frac{\partial L}{\partial y} = x - \lambda + \nu = 0$
$x,y,\lambda, \mu, \nu \geq 0 $
$y + x^2 \leq 6$
$\mu x = \nu y = \lambda (y + x^2 -6) = 0$
I'm able to solve for $x$ and $y$ in terms of the Lagrange multipliers:
$x = \lambda - \nu$ and $y = 2 \lambda^2 - 2 \lambda \nu - \mu$
But after that I'm stuck. I'm not sure how to proceed, and the apparent simplicity of the objective function seems to have vanished.
Should I consider the 8 possible cases from complementary slackness one by one?
(Context: this is an example of the Nash bargaining problem)
You can obtain the solutions by reasoning.
Suppose $\lambda=0$, then $y=-\mu$ and $x=-\nu$. Then $y=\mu=0$ and $x=\nu=0$ due to nonnegativity. Thus we obtain one point that satisfies the KKT conditions.
Now suppose $\lambda>0$, then $y+x^2=6$. Suppose $x=0$, then $y=6$, $\nu=0$, $\lambda=0$, contradiction. So, $x>0$. Suppose $y=0$, then $x=\sqrt{6}$, $\mu=0$, $\lambda=0$, contradiction. So, $y>0$. So, $\mu=\nu=0$. So, $x=\lambda$ and $y=2\lambda x = 2 x^2$. So, $3x^2 = 6$, $x=\sqrt{2}$, $y=4$.
The reason we obtain multiple KKT points is that the problem is not a convex optimization problem. The KKT conditions are therefore necessary but not sufficient. Comparing the objective value for both solutions, the second solution is optimal. If you perform a logarithmic transformation on the objective, the problem becomes convex and the KKT conditions are also sufficient.