<s>[INST] Quadratic equation with absolute values Solve $|x^{2}+x-2|+|x^{2}-x-2|=2$ 
My attempt: 
$|x^{2}+x-2|=
x^{2}+x-2, x\in (-\infty,-2]\cup[1,\infty)$
$|x^2+x-2|=-x^{2}-x+2, x\in(-2,1)\\$ 
$|x^{2}-x-2|=x^{2}-x-2, x\in (-\infty,-1]\cup[2,\infty)$
$|x^{2}-x-2|=-x^{2}+x+2, x\in (-1,2)\\$
$1)$ $x\in(-\infty,-2]\cup[1,\infty)$ and $x\in(-\infty,-1]\cup[2,\infty)$
$x^{2}+x-2+x^{2}-x-2=2$
$\Rightarrow 2x^{2}-6=0$
$\Rightarrow x^{2}=3$ 
$\Rightarrow x_1=\sqrt{3}, x_2=-\sqrt{3}$
$2)$ $x\in(-\infty,-2]\cup[1,\infty)$ and $x\in(-1,2) \Rightarrow x\in[1,2)$
$x^{2}+x-2-x^{2}+x+2=2$  
$\Rightarrow 2x=2$ 
$\Rightarrow x=1$ 
$3)$ $x\in(-2,1)$ and $x\in(-\infty,-1]\cup[2,\infty)$ $\Rightarrow x\in(-2,-1]$ 
$-x^{2}-x+2+x^{2}-x-2=2$ 
$\Rightarrow x=-1$ 
$4)$ $x\in(-2,1)$ and $x\in(-1,2)$ $\Rightarrow x\in(-1,1)$
$-x^{2}-x+2-x^{2}+x+2=2$ 
$\Rightarrow -2x^{2}+2=0$
$\Rightarrow -2x^{2}=-2$ 
$\Rightarrow x^{2}=1$ 
$\Rightarrow x=\pm{1}$ but that's not in the interval $(-1,1)$ so I can throw away that solution.  
My question is how do I find the intersection in $1)$ $x\in(-\infty,-2]\cup[1,\infty)$ and $x\in(-\infty,-1]\cup[2,\infty)$ since $-\sqrt{3}$ and $\sqrt{3}$ should not be the solutions. 
 [/INST] The derivative of the function is
$$(2x+1)\text{sign}|x^2+x-2|+(2x-1)\text{sign}|x^2-x-2|.$$
Depending on the signs, this reduces to $\pm4x$ or $\pm2$ so that the only possible root occurs at $x=0$. The changes of sign can occur at $-2,-1,1,2$ so that the function is certainly monotonous in the intervals
$$]-\infty,-2,-1,0,1,2,\infty[.$$
The endpoints correspond to the function values
$$\infty,4,\color{green}2,4,\color{green}2,4,\infty$$ and you clearly see the two solutions.
</s>