<s>[INST] Finding $x+y$, given $xy= 1$, $x^2+y^2=5$, $x^3+y^3=8$ This problem is from a math competition, but I think is wrong:

Find the value of $x+y$ if:
$$\begin{align}
xy &= 1 \\ 
x^2 + y^2 &= 5 \\ 
x^3+y^3 &= 8
\end{align}$$

Solution (I think is wrong):
$x^3 + y^3 = (x + y)(x^2-xy+y^2) = (x+y)(5-1) = 4(x+y)$
So we have:
$x^3+y^3 = 4(x+y)$
$x^3+y^3 = 8$
Then:
$8 = 4(x+y)$
$x+y = 2$
However if we replace that value in $(x+y)^2$ we have:
$(x+y)^2 = 2^2 =4$
$(x+y)^2 = x^2+y^2+2xy = 5 + 2 = 7$
As you can see $4 \neq 7$, what is happening?
 [/INST] The following method has the advantage that it can be generalized
for similar kinds of problems with more variables.
Consider the equation satisfied by $\;z=x\;$ and $\;z=y\;$
$$ z^2 - (x+y)z + (xy) = (z-x)(z-y) = 0. \tag1 $$
Then for all integer $n\ge 0$ it is true that
$$ z^{n+2} - (x+y)z^{n+1} + (xy)z^n = 0. \tag2 $$
Substitute $x$ and $y$ for $z$ in this equation and add the two equations to get
$$ (x^{n+2} + y^{n+2}) - (x+y)(x^{n+1} + y^{n+1}) + (x^n + y^n) = 0. \tag3 $$
Define $\;c := x^1+y^1 = x+y \;$ and note that $\;x^0 + y^0 = 2.\;$
Now assume that
$$ x\,y = 1, \quad x^2 + y^2 = 5, \quad \text{ and } \quad x^3 + y^3 = 8. \tag4 $$
Use equation $(3)$  with $\;n=1,\;n=0\;$ and assumptions $(4)$ to get
$$ 8 - c\,5 + c = 0 \qquad \text{ and } \qquad 5 - c\,c + 2 = 0. \tag5 $$
The equation for $\;n=1\;$ implies that $\;c=2\;$ but this is inconsistent
with the equation for $\;n=0.\;$
Thus the assumptions in $(4)$ are inconsistent and there is no solution.
</s>