Can you cancel out a term if equal to zero?

quick question here:

In my proofs class we had a problem that after a little work we end up with:
$x(x-y)=(x+y)(x-y)$ where $ x = y $. Now, I know this is pretty basic, but my teacher said that for the next step, one cannot cancel out $(x-y)$ from both sides as $(x-y) = 0 $.
Can someone explain the logic and/or the reasoning behind this?

I’m pretty sure this falls under some obscure basic algebra rule that I’ve forgotten over the years but I cannot find anything about this on the internet.

Edit:

To clear up some confusion here, I am not looking for how to solve this problem, but rather the why this particular rule is so.

The problem I am working on gives a proof. I am supposed to mark the errors in the proof. For this problem, the error was that they cancelled out $(x-y)$ and I am trying to understand why that’s an error.

Solutions Collecting From Web of "Can you cancel out a term if equal to zero?"

As a teacher, I would prefer to enjoin my students to eradicate the word “cancel” from their vocabulary and the supposed process of cancellation from their technique. What we may do is multiply both sides of an equation by any number, knowing that the equality will be preserved. In the example, you are trying to multiply by $1/0$, not a number.

Cancelling out $(x-y)$ is done by dividing through the equation by $(x-y)$ (on both sides), and since we cannot divide by $0$ (I’m assuming you know this), we cannot cancel $(x-y)$ when it is $0$.

I should add a small example. Consider the following equation, and we want to find the real solutions $x$:
$$x^2=3x $$
Now it would be smart to cancel $x$ from each side, but by dividing through with $x$ assumes that $x\neq 0$, so we have to check that possibility separately. Assuming that $x\neq0$ the equation simplifies to
\begin{align}
\frac{x^2}{x} &=\frac{3x}{x}\\
x &= 3
\end{align}
So one solution is $x=3$, but until now we have assumed that $x\neq 0$, so let us check the possibility that $x=0$:
\begin{align}
0^2 &= 3\cdot 0\\
0 &= 0
\end{align}
which is true, so the solutions to this equation are $x=3$ and $x=0$.

It sounds as if the ‘proof’ you were asked to work on was a variation of the following:

$$
\begin{align}
a^2 – a^2 & = a^2 – a^2 \tag{1} \\
a \cdot (a-a) & = (a+a) \cdot (a-a) \tag{2} \\
a & = a+a \tag{3} \\
a & = 2a \tag{4} \\
1 & \overset{?}{=} 2 \tag{5} \\
\end{align}
$$

My grandfather, a maths teacher, told this as a joke. I remember confusing at least one of my maths teachers with it (yeah, I know).

The problem is that calling it ‘cancelling’ hides what’s really going on. You’re not cancelling anything, you’re multiplying or dividing.

To arrive at $(3)$ from $(2)$, you’re supposed to ‘cancel’ $(a-a)$. But it’s not cancelling, it’s dividing! And dividing by $(a-a)$ is dividing by $0$, which as we all know is not good. Had $(2)$ read $a\cdot0 = (a+a)\cdot0$, you wouldn’t have dreamed of ‘cancelling’ the $0$.


Incidentally, the step from $(4)$ to $(5)$ isn’t correct either, since you’re disregarding the possibility that $a$ — which you’re dividing by — could be $0$. But by then you’re already so far down the rabbit hole you probably won’t notice.


As an aside, another fun invalid “cancellation”
$$\require{cancel}
\frac{16}{64} = \frac{1\cancel{6}}{\cancel{6}4} = \frac{1}{4} $$

“Canceling out” is a shortcut procedure that only works in certain circumstances.

If we have $ac = bc$, we can rearrange to get $(a-b)c = 0$. If we have a product of two numbers that is $0$, then one or the other (or both) must be $0$. Thus, if we know $c \neq 0$, then we must have $a-b = 0$ or $a = b$.

That process is simplified as “canceling out”, and it relies on knowing that $c \neq 0$. That is why you cannot cancel out a term that is (or might be) $0$.

Intuitively, we know that $a\times 0 = 0 = b \times 0$ regardless of the values of $a$ and $b$, so it would be inappropriate to conclude that $a\times 0 = b \times 0$ implies $a = b$.

When we divide an equation of the form $ac = bc$ by $c$, we are multiplying by the multiplicative inverse of $c$.

\begin{align*}
ac & = bc\\
acc^{-1} & = bcc^{-1}\\
a & = b
\end{align*}

A real number $c$ has a multiplicative inverse if there exists a real number $d$ such that $cd = dc = 1$. No such number exists if $c = 0$ since $0 \cdot x = 0 \neq 1$ for each real number $x$.

Hence, in your example, we cannot multiply both sides of the equation

$$x(x – y) = (x + y)(x – y)$$

by $(x – y)^{-1}$ since $x – y = 0$ and $0$ does not have a multiplicative inverse.

A very basic explanation:
$$3x=6\Longrightarrow \dfrac{1}{3}\times3x=\dfrac{1}{3}\times6$$
Also,
$$x=2\Longrightarrow 3\times x=3\times2$$
so overall:
$$3x=6\Longleftrightarrow x=2$$

The two are equivalent, that is both contains exactly the same information. This is because $\dfrac{1}{3}$ and $3$ are both $\neq 0$.

Now, $$3x=6 \Longrightarrow 0\times 3x=0\times 6$$
but $$0=0\quad\textbf{ does not imply}\quad 3x=6$$

So $0=0$, which contains in fact no information, does not imply $3x=6$.


In your example, dividing by $x-y$ if $x=y$ leads to something similar to saying that $0=0$ implies $3x=6$ by diving by 0 (duh, I wrote it :/).

Generally you should never cancel but rather exclude terms from equation. Is such situation you make use of main properties of arithmetic operations and transform equation like $$a\cdot c=b\cdot c$$ into $$ac-bc=0$$ (because two expressions are equal iff their difference is zero), then distributivity of multiplication over addition allows you to convert the left hand side to $$(a-b)c=0$$

Now from properties of multiplication you get that at least one of the two terms is zero: $$(a-b=0)\lor (c=0)$$ which finally results in an alternative: $a$ equals $b$ or $c$ equals zero: $$a=b \lor c=0$$

The right term of the alternative can be easily lost when ‘cancelling’, so you should always keep in mind, that ‘cancelling’ the term like $(x-y)$ introduces additional equation $(x-y)=0$ as an alternative solution.

There is no such thing as “cancelling out”.
In this case you want to divide both sides of the equation by (x-y). But always remember before dividing: you can’t divide by zero. But if x=y then in fact (x-y) = 0 and so you would in fact divide by zero which you are not allowed to. But only professors are allowed to divide by zero. 🙂 Just kidding.

If $x=y$ then $x-y=0$ and the equation is equivalent to $0\cdot x =0\cdot (x+y)$
which means that $0=0$.
So you may have $x=300, y=500$ or $x=1 ,y =3.14$ or anything at all.
This means you cannot find the actual values of $x,y$ because the equation is always $0=0$.

$x=0 \implies 1\cdot x=0 \cdot x \implies \dfrac{1 \cdot x}{x}= \dfrac{0 \cdot x}{x}\implies 1=0$ $!!$

Remember that if you divide both sides of an equation by a certain quantity and assert that the result is still true, you are also tacitly asserting that the quantity you divided by was not zero. If it was zero, the equality might hold, but you can’t be absolutely sure anymore. You now have to split the problem into two cases and see what happens if y = x. (But this whole thing is kind of silly because your instructor essentially gave you two equations and two unknowns, where they are obviously not parallel lines or skew, so you could just solve for x and y directly… what was the point of all of this?)

So, you are dividing by (y-x), which is to assert that y does not equal x (because you kept the equal sign at full strength), but at the outset, you asserted that y did equal x. You can’t have it both ways.