<s>[INST] When are we permitted to multiply or divide both sides of an equation by a variable? As it is said in the mathematics books (at least the one I have), we are not permitted to divide or multiply both sides of an equation by a variable, because it is possible to lose some answers. For example, in the following equation
$$x^2=x$$
if we divide both sides by $x$, we would have $x = 1$, but the original equation has two answers, $0$ and $1$, and we've lost $x = 0$ by dividing it by a variable.
But in the same book, in order to solve a rational equation, the author multiplies both sides of the equation by $x(x-2)$, solving the equation:
$$\begin{align*}
\frac {x+2}{x-2} - \frac1x &= \frac{2}{x(x-2)}\\\\
x(x-2)\frac {x+2}{x-2} - x(x-2)\frac 1x &= x(x-2)\frac{2}{x(x-2)}\\\\
x(x+2)-(x-2)&=2\\\\
x^2+x&=0\\\\
x(x+1)&=0\\\\
x&=0\\
x&=-1
\end{align*}$$
Can someone please explain when we are allowed to do this and when we are not? I got a bit confused!
 [/INST] When $c\ne0$, $a=b$ and $ac=bc$ are equivalent, that's about all you need to know.

Applications:


*

*$x^2=x$ is equivalent to $x=1$ when $x\ne0$. Obviously, $0^2=0$ so that $x=0$ is also a solution (and there are no others).

*$\dfrac {x+2}{x-2} - \dfrac1x = \dfrac{2}{x(x-2)}$ and $x(x+2) - (x-2)= 2$ are equivalent when $x(x-2)\ne0$. Then $x=0$ and $x=2$ are known not to be solutions, as the expressions are undefined for them. So if they appear later in the computation as possible roots, these must be discarded.
</s>