Multiply both sides by (x-y) to get (x+y)(x-y)=2a(x-y).
That is x2-y2=2ax-2ay.
It can be converted into x2-2ax=y2-2ay.
Add a2 to both sides to get (x-a)2=(y-a)2.
Square both sides to get x-a = y-a.
So x=y