(x + y)^2 = 31 ( x - y)^2 = x^2 - 2xy + y^2 =
x^2 + 2xy + y^2 = 31 (x^2 + y^2) - 2xy
x^2 + y^2 = 31 - 2xy (x^2 + y^2) - 2(6)
x^2 + y^2 = 31 - 2(6) (x^2 + y^2) -12 (2)
(x^2 + y^2) = 31 -12 = 19 (1)
Sub (1) into (2) and we have that
(x - y)^2 = (x^2 +y^2) - 12 = (19) - 12 = 7