y = x+12
52 = x + y
You plug in the (x+12) for y in (52 = x + y) making the equation 52 = x + x +12 or simplified 52 = 2x + 12. You subtract 12 from both sides of the equation to get 40 = 2x. You divide both sides by 2 to get 20 = x.
You then plug in 20 for x in y = x+12, now y = 20 +12. Simplified y = 32
32 + 20 = 52