The following is an absolute value quadratic equation that I want to solve: $$x^2 − 6 |x − 2| − 28 = 0$$ Here is what I did :
$x^2 − 6 |x − 2| − 28 = 0$
$x^2 − 6 |x − 2| − 28 = 0$
$-6|x-2|=28-x^2$
$6|x-2|=x^2-28$
$6x-12=x^2-28$ or $28-x^2$ (Is this step correct ?)
Solving this two quadratic equations I get the answers $x=-2,8,-10,4$
But when I actually substitute these in the original equation I see that only $x=8,-10 $ satisfy and other two solutions are invalid . Why so?


HINT:
First of all, let $x=a+ib$ where $a,b$ are real
So, we have $$(a+ib)^2-28=6|a+ib-2|\implies a^2-b^2-28+2ab i=6\sqrt{(a-2)^2+b^2}$$
Equating the imaginary parts, we have $ab=0$
If $a=0,-(b^2+28)=6\sqrt{4+b^2}>0$ which is impossible
So, $b$ must be $0\implies x$ must be real
We know for real $m,$ $$|m|=\begin{cases} +m &\mbox{if } m\ge0 \\ -m & \mbox{if } m<0 \end{cases} $$
$$\text{So, }|x-2|=x-2\text{ if } x-2\ge0 \iff x\ge2$$
In that case, we have $$x^2-6(x-2)-28=0\implies x^2-6x-16=0\implies x=8\text{ or } -2$$
But we have $x\ge2,$ so we need to discard the solution $x=-2$
Similarly for $|x-2|=-(x-2)$ if $x-2<0\iff x<2$