Here is the solution
(x+y) =(a+b) -------------(1)
ax-by =a2-b2 ----------------(2)
Multiplying eq (1) by b and adding (1)and (2)
(bx+by)+(ax-by) = (ab +b2)+(a2-b2)
x(a+b) = ab+a2
x(a+b)= a(a+b)
x=a
Putting this value in eq (1)
a+y=a+b
y=b
Hence x=a and y=b