Here is an modular equation
$$5x \equiv 6 \bmod 4$$
And I can solve it, $x = 2$.
But what if each side of the above equation times 8, which looks like this
$$40x \equiv 48 \bmod 4$$
Apparently now, $x = 0$. Why is that? Am I not solving the modular equation in a right way, or should I divide both side with their greatest-common-divisor before solving it?
To clarify, I was solving a system of modular equations, using Gaussian Elimination, and after applying the elimination on the coefficient matrix, the last row of the echelon-form matrix is :
$$0, \dots, 40 | 48$$
but I think each row in the echelon-form should have been divided by its greatest common divisor, that turns it into :
$$0, \dots, 5 | 6$$
But apparently they result into different solution, one is $x = 0,1,2,3....$, the other $x = 2$. And why? Am I applying Gaussian-Elimination wrong?