In order for two complex numbers to be equal, their real and imaginary parts must match up.
So if
x ² + 2xy + i (y - 1) = x ² - 2x + 2y - i (x + y)
then
x ² + 2xy = x ² - 2x + 2y
and
y - 1 = -x - y
Solve for x and y : the first equation gives
x ² + 2xy = x ² - 2x + 2y
2xy = 2y - 2x
and the second gives
y - 1 = -x - y
2y = 1 - x
Substitute this into the first equation:
x (1 - x) = (1 - x) - 2x
x - x ² = 1 - 3x
x ² - 4x + 1 = 0
x = 2 ± √3
Then
x = 2 - √3 ==> y = (-1 + √3)/2
x = 2 + √3 ==> y = (-1 - √3)/2
both of which make both sides of the equation (2 - √3) + i (√3 - 3)/2.