I am solving for x and y
nx+my = a
-nx+my = b add the two equations and we get
2my = a + b divide both sides by 2m
y = (a + b) / (2m)
Put this back into the first equation for y
nx + m [ (a + b) / (2m)] = a simplify
nx + (a + b) / 2 = a subtract (a + b) / 2 from both sides
nx = a - (a + b) / 2 we can write this as
nx = [ 2a - a - b ] / 2
nx = [ a - b] / 2 divide both sides by n
x = ( a - b ) / (2n)