# Why do we sometimes lose solutions when solving equations?

$$\forall f:x=y \implies f(x)=f(y)$$ which means that any operation can be done on both sides of an equation.

When we solve equations we do one operation after the other: $$x=y \implies f_1(x)=f_1(y) \implies f_2(f_1(x))=f_2(f_1(y)) \implies \dots \\ \implies f_n\circ f_{n-1}\circ\dots \circ f_1(x) = f_n\circ f_{n-1}\circ\dots \circ f_1(y)$$

The solutions for the new equation (after the operations) are the solutions for $$x=y$$ and extraneous solutions (some operations don't produce extraneous solutions).

If that is the case why do we sometimes lose solutions when solving equations?

Edit: Note that $$x$$ is the left side of the equation and $$y$$ is the right side of the equation. $$x$$ and $$y$$ are expressions.

• Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on Mathematics Meta, or in Mathematics Chat. Comments continuing discussion may be removed. Commented Dec 5, 2023 at 23:32

If that is the case why do we sometimes lose solutions when solving equations?

We don't. If we take an equation and perform valid operations on it, we will never lose any solutions. If we look back and find that we lost a solution, the only possible explanation is that we mistakenly performed an invalid operation somewhere.

It's very easy to make mistakes. One easy mistake to make is to see that $$E^2 = F^2$$ and conclude that $$E = F$$. That may look reasonable at first glance, but it's actually an invalid operation; the correct conclusion is that $$E = F$$ or $$E = - F$$. Another easy mistake is to see that $$E G = F G$$ and conclude that $$E = F$$; the correct conclusion is that $$E = F$$ or $$G = 0$$.

• While this is a good answer to the question title, from the question body it seems like OP is interested in seeing the mechanism of how errors in the reasoning are introduced, using the functional view of expression transformation (the x=y => f(x) = f(y) mentioned early in the question). Commented Dec 11, 2023 at 11:32

One frequent cause of losing solutions is dividing by something that could be $$0$$. For example, you get an equation of the form

$$a b = b c$$

and you jump to the conclusion $$a = c$$ without taking into account the case $$b=0$$.

• I'd guess this is the most common case. And it's worth mentioning that this can be prevented by going to $b(a-c)=0$, instead of dividing by $b$. Yes, it makes things messier, but you don't lose solutions. (What I do is my initial manipulation uses "divide by", so I can see where things are going, but my write up uses factoring.) Commented Dec 4, 2023 at 16:29
• Are there any other reasons? is division the only cause for the loss of solutions? Commented Dec 4, 2023 at 19:31
• @mawaior - No. Division is not the only source of loss of solutions. In fact, it is not truly division that causes the loss. The problem is rather the complicit assumption that $b \ne 0$. If we don't pay attention to this assumption, we lose the solution because of our carelessness. If we do pay attention to that assumption, the solution is not lost, because we also examine that case and find that it works. You lose solutions when you do an operation that has conditions on when it can be performed, and do not examine those conditions. Another common source is taking square roots. Commented Dec 5, 2023 at 2:30
• @mawaior there are other reasons for loss of solutions. In $x^2=4$ you can apply the positive square root function to both sides but this only leaves you with the solution $x=2$ and not $x=-2$. Commented Dec 5, 2023 at 17:03
• @PineappleFish, No, It does not, When you aply positive square root function to both sides, The equation comes out to be $|x|=2$, Which includes both solutions Commented Dec 5, 2023 at 17:06

We lose solutions for the same reason that we lose keys, or lose our glasses: it is because we are not careful. If we are careful when solving equations, we will not lose solutions.

• While certainly true, I feel like this is not very helpful. Commented Dec 5, 2023 at 12:34
• @Adayah, It certainly is helpful, Because , The OP specifically thinks that there must be some mechanism through which we loose solution, Like when applying functions, But The claim by OP that $x=y$ implies $f(x)=f(y)$ has nothing to do with loosing solutions, only thing, That causes to loose solutions is being not rigorous enough, Or not thinking about every tranformation of system from one to other Commented Dec 5, 2023 at 12:50

## TL;DR (short response)

$$\text{operation"} \neq \text{function"}.$$

But if we remove references to functions from the question, the question is a good one.

## Discussion

The problem with the question as posed is that it does not give clear and consistent definitions of the types of objects that are named $$f$$, $$x$$, and $$y$$ in the initial statement.

Suppose we just want to solve equations that deal only with real numbers, so no complex numbers or other mathematical values. Then if $$x$$ and $$y$$ are numbers (no matter how they are written in the equation) and $$f$$ is restricted to functions with domain and codomain $$\mathbb R$$, $$\forall f : x = y \implies f(x) = f(y)$$ is true. It's also irrelevant to many of the techniques for solving equations.

As an example, let's solve $$t^2 - 3t + 2 = 0. \tag A$$ A possible first step is to factorize the left-hand side. We get $$(t - 2)(t - 1) = 0. \tag B$$ Where is the function that we performed on both sides? It doesn't exist; there is no function $$f: \mathbb R \to \mathbb R$$ that tells us how to factorize a quadratic polynomial.

So if that's how we interpret $$f$$, $$x$$, and $$y$$, the question is not about how to solve equations in general, but only about a very limited methodology that involves simple operations such as adding $$3$$ to both sides or dividing both sides by $$2$$. Anything that requires you to actually look at what's inside an expression to decide what to do with it is off the table.

But let's suppose that $$x$$ doesn't just represent the value of the left-hand side of the original equation; let's suppose $$x$$ actually represents the contents of the expression. We might express $$x$$ as a syntax tree of some sort. To distinguish the value on the left-hand side of Equation (A) from the particular way the left-hand side is written syntactically, I'll write $$\langle\!\langle t^2 - 3t + 2\rangle\!\rangle$$ when I mean the expression itself as a syntactical object and $$t^2 - 3t + 2$$ when I mean the value of the expression.

If $$x$$ and $$y$$ are syntactical objects and $$f$$ performs transformations of syntactical objects, then a method of factorizing simple quadratics might be an example of $$f$$. But now the statement $$\forall f : x = y \implies f(x) = f(y)$$ is irrelevant to all but a very uninteresting set of problems, because $$\langle\!\langle t^2 - 3t + 2\rangle\!\rangle \neq \langle\!\langle 0\rangle\!\rangle$$. (Just look at the two expressions: they don't even have the same number of terms.)

In short, I just don't see any obvious way to correctly interpret the notation in the question so that it applies generally to the things people actually do when solving equations.

But it might make sense to say -- without attempting to use anything that looked like functional notation -- that when we apply a technique in one step of solving an equation, starting with an equation written one way and ending with an equation written another way, we have an expectation that if the technique has any validity, all solutions of the first equation ought to be solutions of the second equation.

I think the answer to the question phrased this way is that people lose solutions because they use techniques that are only "almost" valid, that is, they do something that largely resembles a valid technique but they omit some detail that was needed in order to make the technique valid in all cases.

Overlooking a possible division by zero is one of these mistakes. Another mistake is assuming $$g(f(x)) = x$$ when $$g$$ is the so-called "inverse function" of $$f$$ but is not a true inverse of $$f$$ (for example, if $$g$$ is the square root or the arc sine).

## Original long response

Not everything we do while solving an equation is a function. Many of the operations we might perform on the two sides of an equation are not functions at all.

For example, suppose we have the following equation at some point in a derivation, where the value of $$n$$ is unknown (but it is known that $$n\neq 0$$): $$n^2 - n = n \sin(\theta). \tag1$$

And suppose the next step is, "divide by $$n$$." (Or, "cancel a factor of $$n$$ on both sides.") Then the next equation we write is $$n - 1 = \sin(\theta). \tag2$$

Just to be crystal clear, we have just performed an operation that is expressed by the following implication: $$n^2 - n = n \sin(\theta) \implies n - 1 = \sin(\theta). \tag3$$

This is a perfectly legitimate operation and people do operations like this all the time while solving equations.

You claim that every operation performed in the solution of an equation can be described in the following form, where $$f$$ is a function: $$x=y \implies f(x)=f(y). \tag4$$

If this claim were true, there would be a function $$f$$ for which you could plug $$x = n^2 - n$$ and $$y = n \sin(\theta)$$ into formula $$(4)$$ and the result would be formula $$(3)$$, that is, $$f(x) = n - 1$$ and $$f(y) = \sin(\theta)$$.

Remember, formula $$(4)$$ is your framework. If you claim it applies to all operations people perform while solving equations, it is your responsibility to show exactly how you can use a function $$f$$ to derive Equation $$(2)$$ from Equation $$(1)$$ in a logically valid manner when $$n \neq 0$$. You have to start with the expression $$n^2 - n$$ on the left hand side of one equation, and then somehow by applying your function $$f$$ to $$n^2 - n$$ you have to arrive at the value $$n - 1$$ which you write on the left hand side of the next equation.

So right away, if you can't define a function $$f$$ such that $$f(n^2 - n) = n - 1$$, you have failed to model formula $$(3)$$ using formula $$(4)$$, and your claim about how we solve equations is immediately proved false.

Now, if all you know about $$n$$ is that $$n \neq 0$$, what do you mean when you say $$f(n^2 - n) = n - 1$$?

If you don't mean that $$f(n^2 - n) = n - 1$$ for all $$n \neq 0$$, what do you mean? Whatever it is, it's not what people usually mean when they say they can derive Equation $$(2)$$ from Equation $$(1)$$ when $$n \neq 0$$.

So $$f(n^2 - n) = n - 1$$ must be true for $$n = -1$$ and also true for $$n = 2$$.

Case $$n = -1$$: then $$x = n^2 - n = (-1)^2 - (-1) = 2$$ and $$f(2) = f(x) = n - 1 = (-1) - 1 = -2.$$

Case $$n = 2$$: then $$x = n^2 - n = 2^2 - 2 = 2$$ and $$f(x) = n - 1 = 2 - 1 = 1.$$

Summary: From the first case, we conclude that $$f(2) = -2$$. From the second case, we conclude that $$f(2) = 1$$.

But you can't have $$f(2) = -2$$ and also $$f(2) = 1$$ for any function $$f$$.

The problem here is that the result of performing an operation on both sides of the equation does not always depend only on the value of the entire expression on each side of the equation, as you implicitly assume when you write $$x = y \implies f(x) = f(y)$$. The result of the operation can also depend on elements inside the expression on each side of the equation, which you cannot express in a function $$x \mapsto f(x)$$.

That's what I meant when I said that many operations are not functions. Many of the operations that you can apply on both sides of an equation (such as add $$3$$ or divide by $$2$$) really are functions. But in the solutions of equations, people often perform operations (I would rather say manipulations) that are not functions. These manipulations use details buried inside the expressions on each side, not just the value of the expression on each side, to decide what to write in the next equation.

But I don't have any examples in mind where any operation loses a solution, other than cases of division by zero. (Some divisions by zero are well-concealed, but nevertheless they are division by zero.)

• Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on Mathematics Meta, or in Mathematics Chat. Comments continuing discussion may be removed. Commented Dec 5, 2023 at 23:31
• To improve this answer, perhaps we can recognize that perhaps an operation equals to a multi-variable functions, which includes the x? So the function in your example should be f(n^2-n, n) = n-1 instead of f(n^2-n) = n. This eliminates the multivalued mapping contradiction you pointed out, while still keeping it a function. I think this is mentioned by someone else comment as well, that the domain of the function can't just be the real numbers. Commented Dec 9, 2023 at 7:31
• @justhalf I did actually consider that notation for the "original long answer". It's not so clear to me how to apply it to the "discussion" section. Maybe the way to improve the answer is just to delete the "original long answer". Commented Dec 9, 2023 at 15:09
• Cool, thanks. And thank you for bringing the formality of this into light. I didn't realize how hard it is to point out the inaccuracy (in terms of mathematical formalism) in representing operations as functions, until you pointed this out with your answer. There are also other answers misunderstanding OP's point. So I kinda sympathize with OP as well. This is a easy intuitively but hard formally alternative explanation of expression simplification. Commented Dec 9, 2023 at 16:11
• looking at this answer again, after a month, It seems very clear that the premise that any operation can be defined as function is inherently incorrect, Thanks for the great explanation Commented Jan 21 at 18:51

You are actually more wrong than other answers suggest. Notwithstanding the fact that, as already commented, operations are not functions and your notation is problematic, if you proceed like so:

$$x=y \implies f(x)=f(y)$$

You are in fact guaranteed to find all solutions and, on top of them, 0 or more other false "solutions". E.g. the following is valid (multiplied both sides by 0) but results in finding that every $$x$$ is a "solution":

$$2*x = 5 \implies 0 = 0$$ (holds for any $$x$$)

If OTOH you proceed like so:

$$x=y \iff f(x)=f(y)$$

... you are guaranteed to find all solutions and no other.

• Why is the problematic? What operations which are applied on equations are not functions? Commented Dec 7, 2023 at 10:35
• read up on Logic, especially what $\implies$ means and how it is different from $\iff$ Commented Dec 8, 2023 at 13:16
• I know what $\implies$ and $\iff$ mean. I asked why my "functions and notations" are problematic. Commented Dec 9, 2023 at 13:15
• @mawaior I could be wrong in that regard; everything can be defined as a function if one also has latitude to define what the domain and codomain are but I am not sure the definition would be useful. I haven't yet thought of common algebraic operations in the course of solving an equation as "functions" and I am not sure it's an intuitive or useful way to think when "doing Algebra" Commented Dec 12, 2023 at 11:20

As already noted by many others here, we "lose" solutions only if some step in our work is illegitimate.

Here are three common ways a student might "lose" solutions:

Q1. Solve $$2x=(x+1)x$$.

"A1". Divide by $$x$$ to get $$2=x+1$$ or $$x=1$$. (The student "loses" the solution $$x=0$$.)

Q2. Solve $$x^2=4$$.

"A2". Take square roots to get $$\sqrt{x^2}=\sqrt{4}$$ or $$x=2$$. (The student "loses" the solution $$x=-2$$.)

Q3. Solve $$x\mathrm{e}^{x}=\frac{\mathrm{e}^{x}}{x}$$.

"A3". Take $$\ln$$ to get $$\ln x + x = x - \ln x$$ or $$2\ln x=0$$ or $$x=1$$. (The student "loses" the solution $$x=-1$$.)

The above answers are wrong. Correct answers (where we don't "lose" any solutions):

A1. Case 1. Consider $$x=0$$. This is a solution.

Case 2. Suppose $$x\neq0$$. Then we can legitimately divide by $$x\neq 0$$ to get $$2=x+1$$. So, $$x=1$$.

Altogether, $$x=0,1$$.

(When we divide by $$x$$, we neglect the possibility that $$x=0$$ is a solution. So one method is to deal with $$x=0$$ as a separate case as done above.)

A2. Take square roots to get $$\sqrt{x^2}=\sqrt{4}$$. So, $$|x|=2$$. Hence, $$x=2,-2$$.

(In general, $$\sqrt{x^2}=|x|$$, not $$\sqrt{x^2}=x$$.)

A3. Here the easiest answer is to just cancel $$\mathrm{e}^x$$ (which we can do because $$\mathrm{e}^x\neq 0$$), rearrange to get $$x^2=1$$ and conclude $$x=1,-1$$.

The issue with the above wrong answer is that the domain of $$\ln$$ is $$\mathbb R^+$$. So when we take $$\ln$$, we "lose" any non-positive solutions. So, if we insist on using $$\ln$$, one possible approach is to look at three possible cases:

Case 1. Suppose $$x>0$$. Then both sides of the given equation are positive and so we can apply $$\ln$$ to get $$\ln x + x = x - \ln x$$ or $$2\ln x=0$$ or $$x=1$$.

Case 2. Suppose $$x=0$$. Then RHS is undefined so this cannot be a solution.

Case 3. Suppose $$x<0$$. Rewrite the given equation as $$-x\mathrm{e}^{x}=-\frac{\mathrm{e}^{x}}{x}$$. Now both sides are positive and so we can apply $$\ln$$ to get $$\ln(-x)+x=x-\ln(-x)$$ or $$2\ln(-x)=0$$ or $$-x=1$$ or $$x=-1$$.

Altogether, $$x=1,-1$$.

Given $$x=y$$ and we apply some function $$f$$ to get $$f(x)=f(y)$$, we may "lose" solutions because $$x$$ and $$y$$ are not in the domain of $$f$$. This is illustrated by Q3.

I'd argue most of the reason we lose solutions is because some functions carry the additional structure that $$f(a) = b$$ means there are multiple $$g_1, g_2, ...$$ such that $$a = g_1(b) \ \text{or}\ a = g_2(b)\ \text{or} \ ...$$ and the reason we lose solutions is we naively just select one of those $$g$$ and forget all the others. This is very closely related to the invertibility of functions. $$f$$ might have more than one inverse $$g$$ such that $$g(f)$$ is the identity over some suitable set.

Enough abstract talk lets see some exampleS:

We can consider the infamous

$$x^2 = 1$$

The operation of "taking" a square root here results in

$$x = 1$$

but as we all know

$$x = -1$$

Is also a valid solution. So what happened here. We wanted to get an $$x$$ on the LHS. There are two $$g_i$$'s that can do that $$\sqrt{x}$$ and $$-\sqrt{x}$$. The have different "domains" they work over i.e. $$\sqrt{x^2}=x$$ if $$x \ge 0$$. On the other hand $$-\sqrt{x^2} = x$$ if $$x \le 0$$.

So when $$x^2 = a$$ then either

$$x = \sqrt{a} \ \text{or} \ x= -\sqrt{a}$$

To forget this "or" and multiple options is where you run into trouble.

This doesn't just happen at the level of algebra. Even in basic calculus one can see the following:

$$f' = 1 \rightarrow f = x$$

While that certainly is true we also have $$f = x+1$$ and $$f= x+2$$ etc... Essentially the issue here is the "inverse" of the derivative is not a singular concept. The solution is $$f = x \ \text{or} \ f = x+a_1 \ \text{or} f = x+a_2 \ \text{or} \ ...$$ where those $$a_1, a_2, a_3$$ needs to be an UNCOUNTABLE LIST of all real numbers at the least.

Each of those corresponds to a different fixed "operator" but thanks to our ability to pattern match we just say $$f = x+C$$ where $$C$$ is an arbitrary concept and move on.

So we might ask "why are functions not always invertible". Well that's because sometimes functions aren't one-to-one. They map multiple elements to the same thing. For example $$(-1)^2 = (1)^2=1$$ in our first example and $$(x)' = (x+2)' = 1$$ in our second example. Whenever you have an equation and you are attempting to remove a function $$f$$ that is not one-to-one and FAIL to keep track of all the possible ways to remove it (via the OR statements above) you will notice you are losing solutions.