Why squaring two absolute value functions never gets answers that don’t satisfy the domain

absolute valuefunctions

$|x-1| = |3x-1|+1$

Where $f(x)=|x−1|$ then $f(x)=x−1$ in a certain domain, $x≥1$.
And $f(x)=−(x−1)$ in a certain domain, $x≤1$.

And $g(x)=|3x-1|+1$ then $g(x)=3x-1+1$ in a certain domain, $x≥1/3$ and $g(x)= -(3x-1)+1$ in a certain domain, $x≤1/3$.

I know this can be solved by squaring both sides and I'll get no solutions. And drawing them on a graph paper supports that.

$(x-1)^2 = (|3x-1|+1)^2$$8x^2-4x+2|3x-1|+1=0$ , $8x^2-4x+1$ can never be negative and so is $2|3x-1|$. So, there's no solution.

enter image description here
But doesn't we mean by squaring both sides that $x-1$ can be either negative or positive.

So it's like we are saying:

$-(x-1)$ can be equal to $-(3x-1)+1$, which has an answer $x = 0.5$.

However, this answer doesn't satisfy the domain of $g(x)$ when its equal to $-(3x-1)+1$, $x≤1/3$ so it's not correct.

Or

$-(x-1)$ can be equal to $3x-1+1$, which also has an answer $x=0.25$.

However this answer doesn't satisfy the domain of $g(x)$ when its equal to $(3x-1)+1$, $x≥1/3$ so isn't correct.

Etc.

But these answers since they are out of the domains of both functions aren't right but how can squaring guess that, why are the answers we get out of squaring always in the domain (if both functions are absolute value, I'm not talking about a case like this when only one function has an absolute value sign: $|x-1|=3x-1+1$) how can squaring know where the domain ends and starts, it seems like magic which surely can't be the case.

I tried to ask my teacher but he couldn't get my point, I hope someone will.

Best Answer

The answer is that squaring does not "know" when $x$ is in the correct domain or not. The method you have used is not a generally correct method; you just got lucky in this case.

Let's try just changing a couple of the numbers to make a problem that looks similar:

$$ |x−1|= \left|x − \frac13\right| + 1. $$

If you draw graphs of $y = |x−1|$ and $y = \left|x − \frac13\right| + 1$ you'll see that the graphs never intersect, so there is no solution.

But if you just square the absolute values on both sides, you get

$$ (x−1)^2 = \left(x − \frac13\right)^2 + 1, $$

which expands to

$$ x^2 - 2x + 1 = x^2 - \frac23 x + \frac19 + 1, $$

which simplifies to

$$ \frac43 x + \frac19 = 0, $$

which has the solution $x = -\frac{1}{12}.$

Here is another example:

$$ |x−1|= \left|\frac43 x − \frac13\right| + 1. $$

This also clearly has no solution (graph it), but if you take $$ (x−1)^2 = \left(\frac43 x − \frac13\right)^2 + 1, $$

you get a quadratic equation that has two solutions.

What went wrong here is that you did not actually square both sides of the equation. You squared the left side, and you squared at least one part of the right side, but you did not square the entire right side as one thing to be squared.

If you actually square both sides of your original equation, you get

$$ (|x−1|)^2 = (|3x−1|+1)^2, $$

which simplifies to

$$ 8 x^2 - 4 x + 2 \lvert 3 x - 1\rvert + 1 = 0. $$

It happens that $8 x^2 - 4 x + 1$ by itself is always positive, so when you add the non-negative number $2 \lvert 3 x - 1\rvert$ you always get another positive number, never zero.

But the squaring function doesn't "know" when the thing it squared was originally the "positive" version of some other function or the "negative" version. The reason it tells you the correct answer in this case is that it is showing you that there is no solution.

If taking the square of both sides of an equation leads to no solutions, then you have ruled out all solutions in all four of the following cases: where the left side is positive and the right is negative, where the left is negative and the right is positive, where both sides are positive, and where both sides are negative. It may actually be that one of those cases is impossible for some other reason; no matter. The cases that actually are possible still have no solution.

In the case where the squared equation has solutions, you have to be more careful. It is possible that the solutions came from cases that actually cannot occur for some other reason. It is possible that one of the solutions is good and the other is impossible. But you get no solutions at all from the squared equation in the problem you are looking at, so these warnings don't apply.