<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] We have: $$6+ \underbrace{\left( 1+\frac{\,\sqrt {2}}{2} \right)  \left( {x}^{2}+{y}^{2}-2\,x+2\,y-2
 \right)}_{=\, 0} -({x}^{2}+{y}^{2}-\sqrt {32})$$
$$=\frac{\,\sqrt {2}}{4} \left( \sqrt {2}\,x-\sqrt {2}-2 \right) ^{2}+\frac{\sqrt{2}}{4}\,
 \left( \sqrt {2}y+\sqrt {2}+2 \right) ^{2}\geqq 0$$
Therefore: $$x^2 +y^2 -\sqrt{32} \leqq 6$$

Use this useful identity: $$ax^2 +bx+c =a(x+\frac{b}{2a})^2 +\frac{4ac-b^2}{4a}$$

</s>