I'm trying to understand better optimisation problems and in particular the KKT conditions. To this end, consider the minimisation problem $\min(x^2+y^2)$ subject to $x\ge1$ and $y\ge -2$.
It's clear that the solution is $x=1, y=0$. However, how do I get this by applying the KKT conditions? And is this a kind of problem where they are necessary and sufficient?
I managed to solve this in the process of writing up the question, so I figured I'd post it for future reference and in case it might help someone else.
Define the Lagrangian $$L(x,y,\lambda,\mu) = x^2+y^2-\lambda(x-1)-\mu (y+2).$$ Imposing $\nabla L=0$ you get the conditions $2x=\lambda$ and $2y=\mu$. From this we can see that
For completeness, we can also verify what the dual problem looks like. We have $$g(\lambda,\mu) \equiv \inf_{x,y} L(x,y,\lambda,\mu) = \inf_{x,y}[x(x-\lambda) + y(y-\mu) + \lambda-2\mu] \\ = -\frac14\lambda(\lambda-4) - \frac14\mu(\mu+8).$$ Maximising this in the dual feasible set, $\lambda,\mu\ge0$, we easily get the solution $\sup_{\lambda,\mu\ge0} g(\lambda,\mu) = g(2,0) = 1$, which matches the primal solution, hence confirming strong duality.
Finally, it's worth noting that the Slater conditions are not satisfied in the case, as one of the inequalities is active on the solution. However, I think the LICQ constraint is satisfied, being the gradients of the constraints linearly independent, which is consistent with KKT correctly producing the solution.