For instance:
$x|x| -6x+7=0$
yields two equations:
$x^2-6x+7$ and $x^2+6x-7$
with roots $x_{1,2}=3\pm\sqrt2$ and $x_3=-7, x_4=1$ respectively.
However, upon verification $x_4$ proves to not be the root of the original equation. I know that this is linked to the fact that $x|x|\neq x^2$, but should I always check roots of such equations? Is there a way or a general rule of thumb that tells one whether to check the roots or not?
p.s.
This seems to remind me of the previous issue that I had, when I casually divided both sides of an equation by $x$, without checking whether $x=0$. Upon doing this check, the problem goes away. Is there a similar method that can be applied to this issue?
Note that the equation $x|x|-6x+7=0$ is only equivalent to $x^2-6x+7=0$ if $x\geq 0$. So if in solving the latter equation you find roots which are negative, you can ignore them without bothering to actually plug them into the original equation. Similarly, $x|x|-6x+7=0$ is only equivalent to $x^2+6x-7=0$ if $x\leq 0$, so if you find positive roots to the latter equation, you can ignore them.
The more general rule is that you shouldn't just blindly form new equations from your original equation: you should think about the conditions under which your new equations are equivalent to the original equation. When you deal with the new equation, what you are doing is really solving the original equation under the assumption that these conditions hold. So while $x=1$ is a solution to $x^2+6x-7=0$, it is not a solution to "$x^2+6x-7=0$ and $x\leq 0$", which is what you really mean to be solving. Similarly, if you divide by $x$ in some step, you are really solving the original problem under the assumption that $x\neq 0$.