If $x^2+y^2-xy-x-y+1=0$ ($x,y$ real) then calculate $x+y$ If $x^2+y^2-xy-x-y+1=0$ ($x,y$ real) then calculate $x+y$
Ideas for solution include factorizing the expression into a multiple of $x+y$ and expressing the left hand side as a sum of some perfect square expressions.  

I'll assume $x$ and $y$ are supposed to be real.
Let $s=x+y$ and $p=xy$; then your equation becomes
$$
s^2-2p-p-s+1=0
$$
or
$$
p=\frac{s^2-s+1}{3}
$$
The equation
$$
z^2-sz+p=0
$$
must have real roots; its discriminant is
$$
s^2-4p=-\frac{(s-2)^2}{3}\le0
$$
so we have $s=2$ (and $p=1$).
