Find all solutions to $|x^2-2|x||=1$ Firstly, we have that $$\left\{
  \begin{array}{rcr}
    |x| & = & x, \ \text{if} \ x\geq 0 \\
    |x| & = & -x, \ \text{if} \ x<0 \\
  \end{array}
\right.$$
So, this means that 
$$\left\{
\begin{array}{rcr}
    |x^2-2x| & = & 1, \ \text{if} \ x\geq 0 \\
    |x^2+2x| & = & 1, \ \text{if} \ x<0 \\
  \end{array}
\right.$$
For the first equation, we have
$$|x^2-2x|\Rightarrow\left\{\begin{array}{rcr}
    x^2-2x & = & 1, \ \text{if} \ x^2\geq 2x \\
    x^2-2x & = & -1, \ \text{if} \ x^2<2x \\
  \end{array}
\right.$$
and for the second equation, we have
$$|x^2+2x|\Rightarrow\left\{\begin{array}{rcr}
    x^2+2x & = & 1, \ \text{if} \ x^2+2x\geq 0 \\
    x^2+2x & = & -1, \ \text{if} \ x^2+2x<0 \\
  \end{array}
\right.$$
Solving for all of these equations, we get
$$\left\{\begin{array}{rcr}
    x^2-2x & = 1  \Rightarrow& x_1=1+\sqrt{2} \ \ \text{and} \ \ x_2=1-\sqrt{2}\\
    x^2-2x & =-1  \Rightarrow& x_3=1 \ \ \text{and} \ \ x_4=1\\
    x^2+2x & = 1  \Rightarrow& x_5=-1-\sqrt{2} \ \ \text{and} \ \ x_6=-1+\sqrt{2}\\
    x^2+2x & =-1 \Rightarrow& x_7=-1 \ \ \text{and} \ \ x_8=-1 
  \end{array}
\right.$$
So we have the roots $$\begin{array}{lcl}
x_1 = & 1+\sqrt{2} \\
x_2 = & 1-\sqrt{2} \\
x_3 = & -1+\sqrt{2} \\
x_4 = & -1-\sqrt{2} \\
x_5 = & 1 \\
x_6 = & -1
\end{array}$$
But according to the book, the answer is
\begin{array}{lcl}
x_1 & = & 1+\sqrt{2} \\
x_4 & = & -1-\sqrt{2} \\
x_5 & = & 1 \\
x_6 & = & -1
\end{array}
What happened to $x_2$ and $x_3$? Any other way to solve this equation quicker?

The most general way is to grow a tree and then for each leaf of the tree a table. If more than a couple of layers of $|.|$ you will probably be starting to confuse yourself if you don't stick to a systematic approach.
Each branch in the tree reduce the set the variable is valid for. We need to store a pair $(expression,set)$ at each node and at the leafs of the tree, we will have an expression with no $|.|$ left, just a polynomial and a set. That is when we can make a table splitting the real number line.


*

*First tree branch is due to $|x|$: $x\in[0,\infty]$ left $x\in[-\infty,0]$ right.

*left does $|x|\to x$, right does $|x|\to -x$

*Now store pairs sets and expressions $|x^2-2x|$ left , $|x^2+2x|$ right

*In our new nodes we need to factor polynomials to find how to split the tree up in subsets > and <0. But hopefully the systemacy of the approach is clear enough by now.

