On linear equations and equations with fractions I'm learning how to solve equations. When solving linear equations I've learnt we have 2 elemental and allowed operations, one of them is the following:

If $P=Q$ is an equation then $aP=aQ$ is an equivalent equation where $a$ is a nonzero real.

I understand that if we multiply the equation by a variable we might not obtain an equivalent equation, so only multiplication by reals is allowed:
$x=5$ is not equivalent to $x^2=5x$.
But now, when solving equations with fractions, I am allowed to multiply by polynomials actually that is the way to solve those equations, multiplying both sides by the least common multiplier of the denominators.
So to solve $\frac{6x}{x-1}+\frac{2x}{x-2}=3$ I have to multiply both sides by $(x-1)(x-2)$.
So I simply do not understand when am I allowed to multiply by polynomials, not only real numbers.
 A: We actually do a checking for "extraneous solutions", which I will do my best to explain.
Let us start simple, with $x=5$.
Compare this to $x^2=5x$, which you correctly note to be not the same.
Consider solving for $x$ in the first example, then solving for $x$ after we multiply on both sides.  This yields
$$x=5\tag1$$
$$x^2=5x\implies x^2-5x=x(x-5)=0\implies x=5,0\tag2$$
Note that $(1)$ was the original, and thus correct, but $(2)$ was affected, and so by nature, is incorrect.  But upon further inspection, $(2)$ is partially incorrect, and partially correct.
We call the partially correct portion the 'answer' and the partially incorrect portion the 'extraneous solution'.
To tell the two apart, return to the original equation and plug in every 'solution' you found, just to see which ones are right and which ones are wrong.  In this manner, you may work with multiplying equations by variables or anything, as a matter of fact, so long as you remember the rule to 'check' back to the original equation.
Here, we have $5=5$, which is correct, but $0\ne5$, so $0$ is an extraneous solution.
For a problem where this is more apparent than your example, we attempt to solve the following equation for $x$:
$$\frac{x+1}{x-1}=\frac{x-1}{x^2-2x+1}$$
We can proceed as follows:
$$\frac{x+1}{x-1}=\frac{x-1}{(x-1)^2}$$
$$(x-1)^2\left(\frac{x+1}{x-1}=\frac{x-1}{(x-1)^2}\right)$$
$$(x+1)(x-1)\to x^2-1=x-1$$
$$0=x^2-x=x(x-1)$$
$$x=0,1$$
Then, to check for the extraneous solutions,
$$\frac{\color{red}{0}+1}{\color{red}{0}-1}=\frac{\color{red}{0}-1}{\color{red}{0}^2-2(\color{red}{0})+1}$$
$$\frac{\color{red}{1}+1}{\color{red}{1}-1}=\frac{\color{red}{1}-1}{\color{red}{1}^2-2(\color{red}{1})+1}$$
Only one of the solutions will make sense.
So the point is that you can proceed so long as you check your work.
A: The $x=5$ equation is equivalent to $x^2=5x$ with the condition $x\ne 0$. You can multiply with a polynomial if and only if you checked if $x$ is not one of the roots
A: The reason you can't multiply by $x$ in the example you suggested is because you have no assurance that it isn't zero - if you add the assumption $x \neq 0$, $x = 5$ and $x^2 = 5x$ are equivalent.
In the case of, for example, $\frac{6}{x - 1} = 5$, the fact that the equation is already dividing by $x - 1$ means that we automatically know $x - 1 \neq 0$ - otherwise the equation would be gibberish. So in this case, we can multiply both sides by $x - 1$ without having to add any assumptions.
