<s>[INST] Let $x, y \in \mathbb R$ such that $x^2+y^2=2x-2y+2$. Find the largest possible value of $x^2+y^2$ 
Let $x, y \in \mathbb R$ s. t . $x^2+y^2=2x-2y+2$.  Find the largest possible value of $x^2+y^2-\sqrt{32}$

I know this is a duplicate of another question, but that question has solutions involving calculus and geometry, while I want a solution relying on algebra and basic inequalities only to solve this problem.
 [/INST] Yet another approach: Let $S=\{(x,y) : x^2+y^2=2x-2y+2\}$ be the algebraic curve of the constraint and let $A=\{(x,y): x+y=0\}$ be the anti-diagonal. We have the basic inequality: $(x-y)^2 \leq 2(x^2+y^2)$ with equality iff $(x,y)\in A$. Thus, for points in $S$ we have:
  $$ (x-y)^2 \leq 4(x-y) + 4 $$
with equality iff $(x,y)\in A$ (in addition to being in $S$).
Equivalently,  $(x-y-2)^2 \leq 8$ or $2-2\sqrt{2} \leq x-y \leq 2+2\sqrt{2}$, with the two extremal cases corresponding to $S\cap A$. Evaluating on $S$ we get the upper bound:
  $$ x^2+y^2 -\sqrt{32} \leq 2(2+2\sqrt{2}) + 2 - 4\sqrt{2} = 6$$
with equality  being attained at the unique intersection of $x-y=2+2\sqrt{2}$ and $x+y=0$, i.e. $x=-y=1+\sqrt{2}$
</s>