Problem: Maximize $|x|$ under conditions $$-x+y\leq 1\\ x+y\leq2\\y\geq0$$
My solution: So we can write $x$ as $x=x_1-x_2$ and $|x| = x_1+x_2$, where $x_1 = x$ whenever $x\geq0$ and $x_1=0$ whenever $x<0$, and $x_2=-x$ whenever $x<0$ and $x_2=0$ whenever $x\geq 0$.
Hence we get this inequalities after introducing slack variables: $$-x_1+x_2+y+x_3=1\\x_1-x_2+y+x_4=2\\y,x_1,x_2 \geq 0\\z-x_1-x_2=0$$ Hence we create a tableu \begin{array}{|c|c|c|c|} \hline x_1& x_2 & x_3 & x_4& y & z& b \\ \hline -1&1 &1 &0&1&0&1\\ \hline 1&-1&0&1&1&0&2\\ \hline -1& -1&0 &0&0&1&0 \end{array}
Hence we look on the last row and we see that smalles negative value is $-1$. Hence it does not matter if we take $x_1$ or $x_2$(Am i right?). So lets say choose $x_1$, then we look on indicators and see that smalles non negative indicator will be $2$, hence the second row. So the pivot variable will be equal to $1$. However now i have no idea what to do since it is already $1$, because i do not need to make row operations to turn it into 1.
My question: Did i had a mistake till now? If not, could anyone just give a hint about how to proceed next?
I don't see how do you ensure that $x_1=x$ whenever $x \ge 0$ and $x_1=0$ otherwise.
Usually the trick works for minimizing the absolute value, not maximizing it. In fact, the problem is not convex.
From $x+y \le 2$ and $y \ge 0$, we have $x \le 2$.
Also, from $y \le 1+x$ and $y \ge 0$, we have $x \ge -1$.
Also $(2,0)$ satisfies the constraints, hence the optimal value is $2$.