See this:
Lets assume x = y
That means 2x = 2y
That means 2*(x-y) = 1*(x-y)
Dividing by (x-y) both sides, we get 2 = 1
So, that is wrong since x = y being x-y = 0. As such division by 0 is not acceptable in Mathmatics. You can call it Infinity.
That is why that error.