I want to solve \begin{align} \max |x| \text{ s.t } x^2 -4x + 4 = 0 \end{align}
Exercise 1 is to reformulate the problem without the norm. This yields \begin{align*} \max t \\ \text{s.t. } t-x &\geq 0\\ t+x &\geq 0 \\ x^2 -4x + 4 &= 0 \end{align*}
Exercise 2 is to use KKT-conditions to solve the problem. In my script those are only given for a minimization problem, hence I reformulate the problem to \begin{align*} \min -t \\ \text{s.t. } t-x &\geq 0\\ t+x &\geq 0 \\ x^2 -4x + 4 &= 0 \end{align*}
Then the Lagrangian is given by $L(t,x,\lambda) = -t -\lambda_1 (t-x) -\lambda_2 (t+x) -\lambda_3 (x^2 -2x + 4)$. But the derivative with respecto to $t$ leads $-1-\lambda_1 -\lambda_2 = 0$. Since $\lambda_1, \lambda_2 \geq 0$ this can never be satisfied. However the problem clearly has a solution namely $x = 2$. How can this be?
EDIT: As it was pointed out in the comments, the reformulation was wrong. Indeed, the variable $t$ is not bounded. I now tried to reformulate it as \begin{align*} \min t\\ \text{ s.t. } t-x &\geq 0 \\ t+x & \geq 0 \\ x^2 -4x + 4 &= 0 \end{align*}
Would this be correct? Would this generalize?