Using x + y = 2 → y = 2 - x and xy = 23 ...so....
x(2- x)= 23 expand
2x - x^2 = 23 rearrange
x^2 - 2x + 23 = 0 .....which implies that...
x^2 = 2x -23
And y^2 = (2 - x)^2 = (x -2)^2 = x^2 - 4x + 4
Therefore
x^2 + y^2 =
2x - 23 + x^2 - 4x + 4 =
x^2 - 2x - 19
