Example (problem using complementary slackness)
$$ \begin{align*} \text{Minimise } & x_1 - 3x_2 \\ \text{suject to } & x_1^2 + x_2^2 \leq 4, \\ & x_1 + x_2 \leq 2. \end{align*} $$
Let the Lagrangian $$ \begin{align*} L(\v x, \v s, \v \lambda) &=x_1 - 3x_2 - \lambda_1(x_1^2 + x_2^2 + s_1 - 4) - \lambda_2(x_1 + x_2 + s_2 - 2) \\ &= \left[(1-\lambda_2)x_1 -\lambda_1 x_1^2\right] + \left[(-3 - \lambda_2)x_2 - \lambda_1 x_2^2\right] - \lambda_1 s_1 - \lambda_2 s_2 + 4\lambda_1 + 2\lambda_2. \end{align*} $$ Since $\lambda_1,\lambda_2\leq 0$, setting the derivatives of the quadratic terms to zero minimises them: $$ \begin{align*} 1 - \lambda_2 - 2\lambda_1 x_1 &= 0, \tag{1} \\ -3 - \lambda_2 - 2\lambda_1 x_2 &= 0. \tag{2} \end{align*} $$
Now we make use of complementary slackness. (1) and (2) are inconsistent if $\lambda_1 = 0$, so we must have $\lambda_1 < 0, s_1 = 0$ and so $$x_1^2 + x_2^2 = 4. \tag{3}$$
We know have two cases for $\lambda_2 s_2 = 0$:
-
If $\lambda_2 < 0$, then $s_2 = 0$. So we also have $$ \begin{align*} x_1 + x_2 = 2. \tag{4} \end{align*} $$ (3) and (4) give $(x_1,x_2) = (0,2)$ or $(2,0)$, and using (1) and (2) we get $(\lambda_1, \lambda_2) = (-1, 1)$ or $(1, -3)$ respectively, both of which are inconsistent with $\lambda_1\leq 0$ and $\lambda_2\leq 0$.
-
If $\lambda_2 = 0$, then (1) gives $x_1 = 1/2\lambda_1$ and (2) gives $x_2 = -3/2\lambda_1$. Substituting into (3), we have $\lambda_1^2 = 5/8$. Since $\lambda_1\leq 0$, we get $\lambda_1 = -\sqrt{5/8}$. Substituting gives the optimal solution $$ \begin{align*} (x_1, x_2) = \left(-\sqrt{\frac{2}{5}}, 3\sqrt{\frac{2}{5}}\right). \end{align*} $$