# How does squaring both sides of an equation lead to extraneous solutions? [duplicate]

Let’s say I have $x = x + 1$, which is a false statment for real $x$; why can I solve for real $x$ when I square both sides of the equation, giving $x^2=(x+1)^2$?

• It is not clear what you mean. What do you mean you get an answer when you square both sides of the equation? Squaring loses some information, so while the equation $1 = -1$ is false, the equation $1=1$ is true. – copper.hat Jun 16 '18 at 16:10
• When you square both sides of equation you lose the information about the sign so it's either $x = x+1$ or $x = -(x+1)$ the second one has a solution and corresponds to the solution of $x^2 =(x+1)^2$ – kingW3 Jun 16 '18 at 16:11
• x^2 = (x + 1) ^2 -> x^2 = x^2 + 2x + 1 -> x = - 1/2 – Yan R. Jun 16 '18 at 16:11
• @ToddSewell Your edit no longer reflects the general question the OP had in mind. – gen-z ready to perish Jun 16 '18 at 18:23
• @ChaseRyanTaylor The title of the question should match the body, and in the latter he only asks about squaring. – Todd Sewell Jun 16 '18 at 18:37

If $f$ is any function, then $a=b$ implies $f(a)=f(b)$, but not vice versa.

• The condition $a+1=b+1$ does imply $a=b$. – John Bentin Jun 17 '18 at 6:30
• perhaps the wording should be not necessarily... – gyre Jun 17 '18 at 12:11

I've seen this before in the following example

we prove that $$4=6$$

substract $$5$$ from both equations we have

$$-1=1$$ now square both sides we have

$$1=1$$

which is true.

The problem with the reasoning is that we get $$4=6$$ IMPLIES that $$1=1$$. But this process is not invertible, we therefore can't conclude that $$1=1$$ implies $$4=6$$. Hence we can't deduce that $$4=6$$.

The reason the process is not invertible is that there is no inverse function to the square function $$(x\mapsto x^2)$$. In other words, there is no function taking $$x$$ to a unique $$y$$ such that $$y^2=x$$, because for every such $$x$$ there exists two different $$y$$'s ($$-y$$ is the other solution) satisfying that $$y^2=x$$.

The reason extra solutions have been introduced is that $$(-k)^2\equiv k^2 \space\forall k$$

Thus: $$x^2=(x+1)^2\not\to x=x+1$$ Instead: $$x^2=(x+1)^2\to|x|=|x+1|$$ which can be solved by $x=-\frac12$

The equation $x=x+1$ is indeed not true for any $x \in \mathbb R$ since $1 \neq 0$. When you square both sides, though, information about the sign of each side is lost, thus leading to the expression :

$$x = x+1 \Rightarrow x^2 = (x+1)^2 \Rightarrow \begin{cases} x = x + 1 \\ x = -(x+1) \end{cases}$$

Take close note at my usage of $\Rightarrow$ sign and not $\Leftrightarrow$. This is not an expression statement that you can follow backwards, as it yields two possible outcomes. In the event of the first case, thus as started, the statement is false. In the event of the second case, you have a solution.

• The standard interpretation of $$A \Rightarrow \begin{cases} B \\ C \end{cases}$$ is $A \Rightarrow B \land C$, while you want to express $A \Rightarrow B \lor C$. You should use $\lor$, or at least state explicitly that you mean the disjunction and not the conjunction there. – Daniel Fischer Jun 17 '18 at 9:14

Applying a function to both sides only works when a function is invertible.
In your case f(x) = x2.
However f-1f(x) = f-1(x2) is not only equal to x and has extra result -x.

The extra solutions are for the extra result in inverse functions.

Suppose you have an equation like $$A(x)=B(x).$$ If you take the square you'll wnd up with $$A^2(x)=B^2(x)$$ that is equivalent to $$A^2(x)-B^2(x)=0$$ or $$\Big(A(x)-B(x)\Big)\Big(A(x)+B(x)\Big)=0.$$ So squaring you have solution of your original equation $A(x)=B(x)$ but also solution to the equation $A(x)=-B(x)$ and not always those solutions coincide.

$$a=b\implies a^2=b^2,$$ whereas $$a^2=b^2\implies a=\pm b.$$

If you prefer thinking of it graphically, consider the negative $x$-axis as the mirror image of the positive axis.

Solutions that hold for only one value of $x$ but not its mirrored version are distinct when you look at $x$ itself.

Squaring $x$ and then taking the square root is in some sense equivalent to folding the graph so that the negative axis overlays the positive axis and the corresponding solutions are also transferred over.

This leads you to "picking up" the extra solutions from the negative side as if they had come from the positive side, because when you fold them together, that's what it looks like.

Consider the graph of $y = x^2$:

I sometimes think of a graph (or function in general) as: "you give me $x$, I give you $y$" -- Give me 3, I give you 9. Give me -5 I give you 25, and so on.

Solving $x^2 = 4$ tries to reverse this -- I give you $y$, and you have to come up with the $x$ that would have produced this.

Graphically, the first process ($x \rightarrow y$) is taking vertical lines and finding the height of the graph where they intersect the red curve. The second process ($y \rightarrow x$) is the reverse -- taking horizontal lines and finding the $x$ value (displacement from the vertical line at $x = 0$) where they intersect the red curve.

For the function $x^2$, we can see that most horizontal lines will intersect the curve twice -- this leads to ambiguity about which $x$ you should "give" me to answer my question. To put this another way, the process of squaring a number means that our tit-for-tat exchange (you give me $x$, I give you $y$; I give you $y$, you give me $x$) can be broken.

Turning to the specific relationship you mentioned, $x = x+1$ vs. $x^2 = (x+1)^2$, think of what the latter means in terms of the graph.

To solve this we would find an $x$ so that if we move the right by one, the height of intersection is the same at both places. We can see how this might happen due to the "refraction" of the curve at the origin:

The equation "gains" a solution (when going from $x = x+1$ to $x^2 = (x+1)^2$ because of what happens when we pass the origin and the curve bends back upward (technical term: non-monotonicity).

The plot shows what happens to the $y$ value as we jump to the right by one starting from -2.6 (landing at -1.6, -.6, .4, 1.4, 2.4, ...).

Hopefully you can see that if we had chosen a different value (e.g. -2.3, -2.011, -2.78), the exact $y$ values would be different but the pattern would be the same.

The last thing to convince yourself is that there's a "sweet spot" of where we could start jumping (between -3 and -2) so that the $y$ values before and after crossing $x = 0$ are exactly the same, instead of just ~kind of close~. (A bonus is to convince yourself that there's only one such sweet spot)

Here's the R code I used to generate these plots:

Plot 1:

curve(x^2, -3, 3, asp = 1, lwd = 3L, las = 1L,
ylab = expression(x^2), col = 'red',
main = 'Non-invertibility of Squaring')
abline(v = 0, h = 0)
abline(h = 4, col = 'blue', lty = 2L)
axis(side = 1L, at = c(-2, 2))
segments(c(-2, 2), c(0, 0), c(-2, 2), c(4, 4),
col = 'darkgreen', lty = 2L)


Plot 2:

curve(x^2, -2, 2, asp = 1, lwd = 3L,
ylab = expression(x^2), col = 'red',
main = 'Inchworming the Graph',
xaxt = 'n', yaxt = 'n')
abline(v = 0, h = 0)
x = c(-2.6, -1.6, -.6, .4, 1.4, 2.4)
y = x^2
n = length(x)
arrows(x[-n], y[-n], x[-1], y[-1])
axis(side = 1, at = x)
axis(side = 2, at = y, las = 1L)
segments(x, rep(0, n), x, y,
col = 'darkgreen', lty = 2L)
abline(h = y, col = 'blue', lty = 2L)


An equality $e_1=e_2$, where $e_1$ and $e_2$ are expressions whose value is a number, means that the two expressions denote the same number.

You would of course expect that you if you apply the same function to two different representations of the same underlying number that you would therefore get the same result in both cases. This is a consequence of the usual notion of extensionality in mathematics. See e.g. https://en.m.wikipedia.org/wiki/Extensionality for more.

Note that $a^2=b^2$ is equivalent to $|a|=|b|$ not $a=b$

• Is it also equivalent to $a = \pm b$? – Dean P May 26 at 16:47
• Yes. The word is equivalent to $a=\pm b$. More precisely$$|a|=|b|\implies a=b \text{ or }a=-b \text{ or both which leads to }a=b=0$$ – Mostafa Ayaz yesterday