Find value of $x^2+y^2$ using given expression 
Consider two real numbers $x , y$ such that $$\left(x^2+1\right)\left(y^2+1\right)+9=6\left(x+y\right)$$ Hence find the value of $x^2+y^2$.

At first I tried to factorise the condition but the $(xy)^2$ created much problems. I also tried to create a complete square to get a simpler expression but to no avail. And just out of curiosity, can this question be interpreted geometrically so as to find the required value?
 A: Let $u = x + y$, $v = xy$, then you have $x^2 + y^2 = u^2 - 2v$
Expanding the equation gives
$$ v^2 + u^2 - 2v + 10 = 6u $$
Or 
$$ (v-1)^2 + (u-3)^2 = 0 $$
which has a real solution if and only if $v - 1 = u - 3 = 0$
A: Hint. You can rewrite this as $$(y^2 + 1) x^2 - 6x + (y^2 - 6y + 10) = 0.$$
Taken as a quadratic function of $x$ this has discriminant $$36 - 4(y^2 + 1)(y^2 - 6y+10) = -4 (y^2 - 3y + 1)^2;$$ in particular, the only way to get a real solution is with $y^2 - 3y + 1 = 0$, i.e. $y = \frac{3 \pm \sqrt{5}}{2}$.
A: Continuing from Dylan's answer, $xy = 1$ and $x+y = 3$. Then:
$$x^2 + y^2 = (x+y)^2 - 2xy = (3)^2 - 2(1) = \boxed{7}.$$
Moreover, note that we can swap the values of $x$ and $y$ without changing the expression. Therefore from user16394's answer, $x = \frac{1}{2}(3 + \sqrt{5}), y = \frac{1}{2}(3 - \sqrt{5})$ or vice versa. Thus the value of $x^2+y^2$ is again:
$$\frac{1}{4} \left((3 + \sqrt5)^2 + (3 - \sqrt{5})^2 \right) = \frac{1}{4} \cdot 2 \left(3^2 + (\sqrt{5})^2 \right) = \boxed{7}.$$
