Finding the extremum of function z = x ^ + XY + y ^ + X-Y + 1

Finding the extremum of function z = x ^ + XY + y ^ + X-Y + 1

z=x²+xy+y²+x-y+1
=x²/2+xy+y²/2+x²/2+x+1/2+y²/2-y+1/2
=(1/2)(x+y)²+(1/2)(x+1)²+(1/2)(y-1)²
The square term is constant and nonnegative, Z ≥ 0
x+y=0
x+1=0
y-1=0
The solution is x = - 1, y = 1
When x = - 1, y = 1, the function has a minimum Zmin = 0 and no maximum