Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Okay, so I've started Algebra I this year, and i've always had a love for math. And at one point in the course we were presented with an equation similar to this one:

$5x + 3 = 8x + 3$

And so I solved it like such: $5x + 3 = 8x + 3$

$5x + 3 - 3 = 8x + 3 -3$

$5x = 8x$

$5x - 5x = 8x - 5x$

$0 = 3x$

$0/3 = 3x/3$

$0 = x$

However, I also noticed that it seems perfectly valid to divide both sides by x instead of subtracting 5x, which results in 5 = 8, and therefore no solution. I'm a little confused about that. Can someone clarify what exactly is happening here?

share|improve this question
If $x = 0$, then division by $x$ doesn't make any sense. –  T. Bongers Jan 10 at 0:30
Precisely because you don't know that $x\neq0$ is that you can't divide by $x$, because it could be that $x=0$. –  becko Jan 10 at 0:32
Expanding on @Dargatz comment, you could do it by reductio ad absurdum. You suppose that $x\neq0$ and see if that assumption leads to a contradiction. In this case, it happens that $x\neq0$ implies that $5=8$. This is a contradiction. Therefore our assumption that $x\neq0$ must be false. Therefore $x=0$ –  becko Jan 10 at 0:35
@user1825860 No, but you have to consider the case where it'd be invalid separately. You can divide by $x$, but that means you assume $x\neq 0$. You then have to consider the case $x=0$ separately, and of course you cannot handle that case by dividind by $x$ –  fgp Jan 10 at 3:27
The reductio ad absurdum and the binary tree comments are bad logic. An equation and also a set of equations in general does not need to have a solution at all, and is also depending on the search space e.g. integers, rational numbers and complex numbers. So if you find out that x≠0 leads to a contradiction, then you only know that the equation system either has the solution x=0 or has no solution. This is the correct negation. –  Adder Jan 10 at 14:01

7 Answers 7

up vote 24 down vote accepted

The answer is already in the comments, but I'll try explain it a bit more verbosely. If you solve an equation, what you're actually doing is writing a proof that the equation is logically equivalent to some statement $x = ...$, where the dots stand for some number. You do that by writing down a series of equivalent statements, one below the other. In your case, you start out with $$ 5x + 3 = 8x + 3 $$ Then you subtract $3$ from both sides. You may do that, because two numbers are equal exactly if those numbers minus 3 are equal. So the statement $$ 5x = 8x $$ is logically equivalent to the equation you started with. Now you divide by $x$. Are you allowed to do that? Is it true that two numbers are equal exactly if they're equal if divided by the same divisor? Turns out they are, except if the divisor is zero. In that case, the division isn't allowed, and so the statement you get - even if it formally looks valid - has no more logical connection to the original equation. In particular, the original equation may have a solution, but the statement you get after the division may be simply untrue. So, by dividing by $x$, you implicitly assume that $x\neq 0$! Everything that follows will be depend on that assumption. In your case, you do the division and end up with $$ 5 = 8 \text{,} $$ an obvious contradiction. But that statement is only equivalent to the original equation if $x \neq 0$ - after all, we had to assume that to get this far. So we now know that, indeed, $x$ has to be zero for the equation to hold, since assuming that it isn't zero got us into trouble. We don't yet know if it actually will hold for $x=0$, thought, so the last step is to set $x=0$ in the original equation, and verify that it checks out.

share|improve this answer
Minor nitpick: I don't see how "we now know that, indeed, x has to be zero for the equation to hold, since assuming that it isn't zero got us into trouble" follows immediately. In general, just because $\not\exists x\neq 0 : x\ \text{is a solution}$ doesn't necessarily imply that $x=0\ \text{is a solution}$. –  WChargin Jan 10 at 4:14
@WChargin I knew someone would complain about this ;-) Read my sentence again - I never actually claim that this proves that $x=0$ is a solution, only that $x=0$ is the only possible solution. Or at least that is how I read "for the equation to hold, $x$ has to be zero". Having said that, I'll now go and fix my answer to explain that point instead of relying on linguistic trickery ;-) –  fgp Jan 10 at 4:24
Ah, I see: $(x = 0) \implies (\text{equation holds})$ but not the other way. My mistake. –  WChargin Jan 10 at 4:35

$x$ is equal to zero. It's true that, at the outset, you don't happen to know that $x$ is equal to zero, but what you know isn't relevant. What's relevant is what $x$ actually is. Because $x$ is zero, you can't divide by it.

It's a good policy not to divide by things that might be zero, because then you might be doing something invalid, and that will lead to wrong conclusions. Sometimes those conclusions will be obviously wrong, like $5=8$. Other times, they'll be non-obviously wrong, which is even worse, because you'll fool yourself into believing false things.

share|improve this answer
+1 especially for the "good policy..." part. I have to tell people that so much when I tutor... –  anorton Jan 10 at 3:27

Any time you have an equation where both sides have a common factor, like this:

$$ab = ac$$

there will be two possible ways in which the equation could be satisfied: either

  • $a = 0$, in which case the values of $b$ and $c$ don't matter, or
  • $b = c$, in which case the value of $a$ doesn't matter.

(Of course, it's also perfectly possible that both of those could be true at the same time.)

Note that $a$, $b$ and $c$ here could be any expressions; in your case, $a = x$, $b = 5$ and $c = 8$, but you could just as well have, say, $a = (x + 1)$, $b = \sqrt{2}$ and $c = (3x^2 - 2x + 7)$.

Another, more general way of looking at such equations is to rewrite them equivalently as:

$$ab - ac = 0$$

where all the non-zero terms are on the same side of the equals sign, and then factoring it into a product:

$$a(b - c) = 0$$

Now, remember that the product of two (or more) numbers is zero if and only if at least one of the numbers is zero. So in this case, the only way $a(b-c)$ can equal $0$ is if either $a=0$ or $(b-c)=0$, which in turn is true if and only if $b=c$.

share|improve this answer

Contrary to popular belief, it is actually possible to "divide" by something that could be $0$ and get meaningful answers, but doing so requires that you be very, very careful. So careful, in fact, that it isn't worth it and you should just analyze what happens in the cases when $x=0$ and when $x\neq0$ (Incidentally, if you can avoid dividing by something that you don't know is not $0$, it's worth making sure there isn't something else you could do to figure out $x$).

Nevertheless, if you want to feel badass and divide by things that could be $0$, what you need to do is understand well how fractions work. What is a fraction? A fraction is an expression of the form $\dfrac ba$ where $b$ and $a$ are numbers. We say that a fraction $\dfrac ba$ stands for a number if when you multiply that number by $a$, you get $b$. There are three types of fractions:

  1. $\dfrac00$ which can stand for any number $a$ since $0a=0$ for all numbers $a$. We say that $\dfrac00$ is an "indeterminate" expression.
  2. $\dfrac b0$ where $b\neq0$, which cannot stand for any number since $0x=0\neq b$ for all numbers $a$. We might say that $\frac b0$ is an "undefined" expression.
  3. $\dfrac ba$ where $a\neq0$, which stands for exactly one number since if $ax=b$ and $ay=b$, then subtracting one equation from the other gives $a(y-x)=0$, and since $a\neq0$ we must have $y-x=0$, so $y=x$.

(the reason why "division by $0$" is usually disallowed outright is that the fractions with zeroes in the denominator are all of cases 1. and 2., neither of which stand for exactly one number, whereas the fractions with non-zero denominator are case 3.: each such fraction stands for exactly one number).

Now, when you did your division algebra and divided by $5x=8x$ by $x$ (which is only "allowed" if $x$ is non-zero), it seemed like you got a contradiction that $5=8$. However, if you pay attention, you will notice that the contradiction comes not from assuming that $x\neq0$ so that division would be allowed, but from assuming that the resulting fractions $\dfrac{5x}x=\dfrac{8x}x$ are of type 3., and so assuming that each should stand for a unique number.

If we don't assume that the resulting fractions are of type 3. (why should we assume such a thing? we don't want to assume anything about $x$, we want to find it!), then there is nothing contradictory about the fact that you get $5=\dfrac{5x}x=\dfrac{8x}x=8$. There is nothing contradictory because all that says is that each of the two fractions stands for two different numbers, and this can only happen if both fractions are of type 1. Hence, both fractions are really just the indeterminate fraction $\dfrac00$, which means that both fractions are really just the indeterminate fraction $\dfrac00$, so we get $x=0$ and $5x=0=8x$.

Again, doing this kind of argument right requires that you are very careful, and for schoolwork you should just check separately what happens in the case when what you are dividing by is $0$ and the case when it is not.

share|improve this answer
This is kind of neat, but I think you're cheating a bit there. What you're doing is not actually dividing by zero, but constructing the fraction $\frac{a}{0}$. That's not the same thing - a division would supposedly return an element of $\mathbb{R}$, not an element of $\mathbb{R}^2$. –  fgp Jan 10 at 4:01
Who says division should return an element of $\mathbb R$ and not a fraction? Even though we say that one can't divide by zero, what we really mean is that they shouldn't (they wouldn't if they couldn't). Plus, we divide natural numbers by each other all the time and get not natural numbers but fractions, most of which actually end up representing rational numbers. Anyway, the neatness extends surprisingly enough to calculus: if you compute a limit of an expression to be $\frac a0$ for $a\neq0$, then you are immediately justified in concluding that the limit does not exist... –  Vladimir Sotirov Jan 10 at 4:45

You're trying to solve an equation: this means finding one or more x's that make the left-hand side equal to the right-hand side.

Think of x as some (real) number: x is either zero or non-zero. If you want to divide out x, you'll need to promise that x is not zero. OK, do it:

$5 = 8$

Now ask, "for what values of x (chosen from those x's that are nonzero) is this true?" There aren't any!

Now we don't make this promise:

$5x = 8x.$

Ask: "for what values of x (chosen from those x's that are equal to zero) is this true?" Answer: x = 0 (since $5 \times 0 = 8 \times 0$).

Put the two cases together, and you've found a single x that solves the equation: x = 0.

share|improve this answer

I believe the algebraic transform you are looking for is:

$$a = b \Rightarrow \left(\frac ax = \frac bx \right) \lor (x = 0)$$

share|improve this answer
Bad logic: e.g.: -1 = 1 => -1/x = 1/x or x=0 –  Adder Jan 10 at 14:24
No, this is actually vacuously true. False implies anything. As well this is a transform used to find alternative solutions to differential equations. –  DanielV Jan 10 at 14:32
There was a pilot flying a small single engine plane. He was in thick fog when his instruments went out. He saw a building with one guy working alone. The pilot shouted to the guy "Hey, where am I? To this, the solitary office worker replied "You're in a plane." The pilot then turned the plane and landed on the runway of the airport 5 miles away. He was asked how he did it. "Simple" replied the pilot, "I asked a simple question. The answer he gave me was 100 percent correct - but absolutely useless. Therefore I knew that must be the university's math faculty south of the airport." –  Adder Jan 10 at 15:12
It isn't the paintbrush that is useless, it is the painter. –  DanielV Jan 10 at 15:23
If you give the painter the right brush, he will do fine. –  Adder Jan 10 at 15:26

First, a small point of terminology: deducing $5=8$ from $5x=8x$ is better described as cancelling rather than dividing by $x$, as this makes sense in domains such as the integers, where division is not always defined.

My advice to students (specifically aimed at first-year undergraduates struggling with things they should have learned at school):

"You surely know that you must never divide by zero. But even more than this, don't ever divide by anything, or cancel anything, that could possibly be zero."

Basically I agree with WillO, though I think students having trouble with this issue need a firmer discouragement than "not a good policy".

For the context of the above quotation see http://www.maths.unsw.edu.au/currentstudents/revision-worksheets/basic-algebra.pdf.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.