Find the largest value of $x$ for which \[x^2 + y^2 = x + y\]has a solution, if $x$ and $y$ are real.
Rearange as
x^2 - x + y^2 - y = 0 complete the square on x and y
x^2 - x +1/4 + y^2 - y + 1/4 = 1/4 + 1/4 factor
(x - 1/2)^2 + ( y -1/2)^2 = 1/2
x will be maximized when y = 1/2
So
( x - 1/2)^2 + (1/2 - 1/2)^2 = 1/2
(x -1/2)^2 + 0 = 1/2
(x - 1/2)^2 = 1/2 take the positive root
x - 1/2 = sqrt (1/2)
x - 1/2 = sqrt (2) / 2
x = [ 1 + sqrt (2) ] / 2