# Squaring is not an injective operation so why is it allowed? [closed]

I do have a problem with squaring, lots of students do it escpecially when they have to solve things like $$\sqrt x$$ but i do not why. This maybe a dumb example but lets assume $$-2=2$$ if I $$(..)^2$$ i would have $$4=4$$ which would be no contradiction

## closed as unclear what you're asking by Lord Shark the Unknown, A. Pongrácz, Don Thousand, Namaste, John BentinDec 18 '18 at 20:57

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• But $2\neq -2$. – hamam_Abdallah Dec 18 '18 at 18:50
• @hamam_Abdallah please read my question again. i wrote lets assume – user627643 Dec 18 '18 at 18:51
• Not following. Lots of non-injective functions exist, they are very useful. You are correct of course that if one is applied then you run the risk of picking up "false" solutions to the original problem. Is that what you are asking? – lulu Dec 18 '18 at 18:54
• @MahtsGuy As soon as you assume $2=-2$ you have your contradiction! – Lord Shark the Unknown Dec 18 '18 at 18:54
• Your examples are not clear. $\sqrt 2$ is not transcendental, for instance. – lulu Dec 18 '18 at 19:00

The fact that an operation isn't injective is good reason to be careful when using it, but there's no need to avoid it altogether.

As a simple example, let's solve $$\sqrt x = x-1$$

Squaring (non-injective) we see that any solution would satisfy $$x=x^2-2x+1\quad \implies\quad x^2-3x+1=0$$

Thus our solution(s) must be among $$\frac {3\pm \sqrt 5}2$$

Checking those shows that $$x=\frac {3+ \sqrt 5}2$$ solves the problem we were interested in while $$\frac {3- \sqrt 5}2$$ does not. That value is a solution to the similar equation $$-\sqrt x=x-1$$ Of course, squaring removed the difference between these two equations.

Thus, squaring the original equation quickly led to a solution, but we had to take care to remove an extraneous "solution" generated in the process.

• ah ok brilliant answer, thank you very much. So squaring is allowed in general but i have to be carefull with the solutions and check wheather they re in my domain. is squaring also allowed when check limits of sequences such as $\frac {\sqrt(n+1)}\sqrt(n)$ – user627643 Dec 18 '18 at 19:18
• It's allowed, but I don't see how it helps. We know $\lim_{n\to \infty}\frac {n+1}n=1$ and $x\mapsto \sqrt x$ is continuous for positive $x$ so your limit is $1$. – lulu Dec 18 '18 at 19:20
• you are right but in Germany you have first sequnces then continous functions thus at that point we cannot use that sqrt is continous. by the way do i have to take the sqrt of the limit ? – user627643 Dec 18 '18 at 19:23
• Ok. Well, then if $a_n=\sqrt {\frac {n+1}n}$ then we easily see that $a_n^2\to 1$ but as it is clear that $a_n>0$ for all $n$ we can be sure that $a_n\to 1$ as well. – lulu Dec 18 '18 at 19:28
• assume An^2 had limit 4 does An have the limit 2 when An is greater 0 ? – user627643 Dec 18 '18 at 19:30

Your example is not as dumb as you suggest; it is a nice example of the principle of explosion, which states that from a contradiction you can derive whatever you like (hence its Latin name, ex falso sequitur quodlibet).

Put more formally, if $$p$$ and $$q$$ are propositions and $$p$$ is false, then the implication $$p \Rightarrow q$$ is true regardless of whether $$q$$ is true or false.

This means that if you make a false assumption $$p$$, such as the assumption that $$-2=2$$, then you can derive both true consequences (such as $$4=4$$, obtained by squaring both sides) and false consequences (such as $$0=4$$, obtained by adding $$2$$ to both sides).

This is also a nice illustration that you cannot prove that a proposition $$p$$ is true by assuming that it is true and deriving something else that is true—this is a common error amongst beginners at mathematical proof.

This arises a lot in solving equations, since you assume the equation holds and derive its solutions—this says that if such-and-such equation has a solution $$x$$, then $$x =$$ this, that or the other. But this does not prove that if $$x=$$ this, that or the other, then $$x$$ is a solution to the equation. Plugging the $$x$$es back in and verifying the equation holds (or doesn't) is what gives you the converse implication. This is illustrated in lulu's answer.

• truely fell in love with community, thank you a lot. very helpful answer – user627643 Dec 18 '18 at 19:21
• Mr Newstead. So when using proof by Contradicton i assume that my negation of my premise is true an by logicial steps i show that it does not work. But why is then my premise true if i assume my premise is wrong and lead to a wrong conclusion? – user627643 Dec 18 '18 at 19:33
• @MahtsGuy: There are two ways you can use proof by contradiction. If you assume that $p$ is true, and derive something known to be false, and then you can conclude that $p$ is false. If you assume that $p$ is false and derive a contradiction, then you've proved that the assumption that $p$ is false, is false... so then $p$ is true. – Clive Newstead Dec 18 '18 at 19:38
• But why does it work do you have a short explanation for that? and i wrote you an email 2 days ago would appreciate if you would answer :) – user627643 Dec 18 '18 at 19:41
• @MahtsGuy: It works because of the law of double-negation elimination, which says that if $p$ is not false, then $p$ is true. Stating that $p$ is false is the same as stating that its negation, $\neg p$, is true. Regarding your email, my contributions to this site are voluntary and done for fun, but I don't offer on-demand services that are requested through my work or personal email address (from anyone, not just you), so I'd suggest that you post your question here or on another SE website. Thanks. – Clive Newstead Dec 18 '18 at 19:52

Note that in generally accepted notation we have that: $$\sqrt {m^2}=|m|$$

I'll take lulu's answer as an example to demonstrate this. First we have:

$$\sqrt x=x-1$$ We square to get: $$x=(x-1)^2$$ But if we now square root again, we have: $$\sqrt x =|x-1|$$

Note that $$|x-1| = \begin{cases} x-1, & x\ge1 \\ 1-x, & x<1 \end{cases}$$ and we note that any solutions to $$x=(x-1)^2$$ with $$x<1$$ do not count to our equation.

The solution lulu excluded was $$\frac{3-\sqrt5}{2}\approx 0.38$$ and so we see why it doesn't fit.

So while squaring brings in fake solutions, they are easy to spot and remove.

$$\require{cancel}$$Strictly speaking, you are correct that the lack of infectivity of the $$(\cdot)^2 : \mathbb{R} \to \mathbb{R}$$ function means that it can't be used for the style of proof commonly found in problem sets where you write a sequence of equalities until you get a trivial one. Functions like $$(\cdot)^2$$ are potentially usable if you have other knowledge about their arguments. For instance, if the argument is non-positive or non-negative, $$(\cdot)^2$$ is injective.

If you have an equation involving an unknown, then applying an injective function to both sides will not introduce any spurious solutions.

$$x + 7 = -2 \tag{1}$$

applying $$- 7$$ to both sides gives us:

$$x = -5 \tag{2}$$

Equivalently, if we start out with an $$\ne$$ inequality, an injective function $$(+5)$$ will preserve the truth of that statement.

$$2 \ne 4 \tag{3}$$ $$7 \ne 9 \tag{4}$$

However, if we apply a non-injective function such as $$f(z)=z^2$$, inequalities are not necessarily preserved.

$$-2 \ne 2 \tag{5}$$ $$\xcancel{4 \ne 4} \tag{6}$$

This is perhaps easiest to see if we apply the constantly zero function $$0$$ to both sides.

$$7 \ne 302 \tag{7}$$ $$\xcancel{0 \ne 0} \tag{8}$$