I'm learning how to solve optimization problems with constraints, but im confused about applying the KKT conditions for the following problem
$$\begin{array}{ll} \text{minimize} & f(x_1, x_2)\\ \text{subject to} & \max \left( |x_1|,|x_2| \right) = 3\end{array}$$
I guess the Lagrangian will be
$$L = f(x_1,x_2) - \lambda (\max(|x_1|,|x_2|)-3)$$
I am not sure how to continue with taking the derivative w.r.t x1, x2, and $\lambda$.
I know that $\max(|x_1|,|x_2|)=3$ is a square with $ -3 \leq x_1 \leq 3$ and $ -3 \leq x_2 \leq 3$.
Solve it in four parts (the $\pm$ gives two choices for both ways of $\{j, k\} = \{1,2\}$):
$$\begin{array}{ll} \text{minimize} & f(x_1, x_2)\\ \text{subject to} & x_j = \pm 3 \\ & x_k \leq 3 \\ & -x_k \leq 3 \end{array}$$
In another words you consider each side of the square separately.
Actually, since you have the condition, for example in the first case, that $x_1=3$ and $-3 \leq x_2 \leq 3$, you might just want to plug $x_1=3$ into $f$ and get a single variable function to minimize on $[-3, 3]$.
Then pick the minimum of these four solutions.