Let,you have an equation=$a^2-2ab+b^2$

This can be written in two ways-

$$a^2-2ab+b^2\space \space \space \space \space \space \space \space \space \space \space \space \space \space \space b^2-2ab+a^2$$

And so,

$$(a-b)^2=(b-a)^2$$

And so $a=b$

But,this is not true clearly. Where is this going wrong?

Thanks for any help!