# Solve with KKT min $x_1-4x_2+x_3$

Given min $$x_1-4x_2+x_3$$
s.t $$x_1+2x_2+2x_3=-2$$
$$||x||^2\leq1$$

(i)Given a KKT point of the problem above,must it be an optimal solution?
(ii) Find the optimal solution of the problem using KKT conditions.

for (i) taking the point $$(0,-0.89,-0.11)$$ we satisfy slater's condition and the objective function is convex and the first contrains is affine and second is convex with inequality. therefore a KKT point is optimal point. for (ii) I know I just need to find 1 KKT point
$$L(x,\lambda,\eta)=x_1-4x_2+x_3+\lambda(x_1+2x_2+2x_3+2)+\eta(x_1^2+x_2^2+x_3^2-1)$$
(1) $$\frac{\partial L}{\partial x_1}=1+\lambda+2\eta x_1 = 0$$
(2) $$\frac{\partial L}{\partial x_2}=-4+2\lambda+2\eta x_2 = 0$$
(3) $$\frac{\partial L}{\partial x_3}=1+2\lambda+2\eta x_3 = 0$$
(4) $$\lambda(x_1+2x_2+2x_3+2)=0$$
(5) $$\eta(x_1^2+x_2^2+x_3^2-1)=0$$
(6) $$(x_1+2x_2+2x_3+2)=0$$
(7) $$x_1^2+x_2^2+x_3^2-1\leq0$$
if $$\lambda=\eta=0$$ we get from (1) that $$1=0$$ therefore not feasible
if $$\lambda\neq0,\eta=0$$ from (1) we get that $$\lambda=-1$$ and from (2) we get that $$\lambda=2$$ not feasible again.
if $$\eta\neq0,\lambda=0$$ we get from (1) and (3) that $$x_1=x_3=\frac{-1}{2\eta}$$ and $$x_2=\frac{2}{\eta}$$ plugging into (6) we get that $$\eta=\frac{-5}{4}<0$$ not possible because $$\eta\geq0$$ therefore not feasible again.
if $$\lambda,\eta\neq0$$ from (2)-(3) we get $$\frac{-5}{2\eta}+x_2=x_3$$ and (2)-2*(1) we get that $$\frac{-6}{4\eta}+\frac{1}{2}x_2=x_1$$ plugging into (6) we get that $$\frac{1}{\eta}=\frac{9}{13}x_2+\frac{4}{13}$$ plugging all that we got into (5) we know that $$x_1^2+x_2^2+x_3^2=1$$ because $$\eta\neq0$$ and I get that $$x_2=0.0503$$ or $$x_2=-0.764$$ the second options is not feasible because $$\eta\geq0$$ and from the first one I don't get the right answer(checked in matlab)
I wonder what am I doing wrong here, any help please?

Opt vector is $$(-0.5194,0.1074,-0.8478)$$ opt val $$-1.7969$$

plugging all that we got into (5) (..) I get that $$x_2=0.0503$$ or $$x_2=-0.764$$
Something went wrong in this step. I put (5) into Wolfram Alpha and got $$x_2 \approx 0.1074$$ as one of the solutions.