Eliminating x = 0 from an equation when x can be equal to all real numbers

algebra-precalculus

If we have the equation:

$$2+0x=a+0x$$
The solution to this equation for $x$ is all real numbers. If I then multiply each side by $x$ I get:
$$2x=ax$$
The solution to this equation for $x$ is still all real numbers. If I wanted to divide each side by $x$, I would have to assume that $x$ is not equal to $0$. So if I do that:
$$2=a$$
which is also equal to $$2+0x=a+0x$$ which has $x =$ all real numbers. But since I divided by $x$ didn't I remove $x = 0$ from the solutions of $x$? But $x = 0$ still works in the last equation?

Best Answer

When you divide by $x$, you say

if $x \ne 0$, then $2 = a$; which is true (here, we are not even considering the case where $x=0$).

But in your case, even if $x=0$, then also $2 = a$; because before multiplying by $x$, we already knew that $a=2$.