<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] Alternative approach:
Let $z = (x + y)$. 
The following equations over-determine the value of $z$.

*

*E-1: $~x^2 + y^2 = 5.$

*E-2: $xy = 1.$

*E-3: $x^3+y^3 = 8.$
Since $~z^2 = x^2 + y^2 + 2xy,~$ 
E-1,E-2 collectively imply that 
$\displaystyle z^2 = 7 ~\implies~  z ~\in ~\left\{+\sqrt{7}, -\sqrt{7}\right\}.$
So, $\displaystyle ~~\left\{+\sqrt{7}, -\sqrt{7}\right\}~$ are the only candidate values for $z$.
Since $z^3 = x^3 + y^3 + 3xy(z)$, 
E-2,E-3 collectively imply that $z^3 = 8 + 3z \implies z^3 - 3z - 8.$
Trying each candidate value in turn gives:

*

*$\displaystyle \left[+\sqrt{7}\right]^3 - 3\left[+\sqrt{7}\right] = 4\sqrt{7} \neq 8.$


*$\displaystyle \left[-\sqrt{7}\right]^3 - 3\left[-\sqrt{7}\right] = -4\sqrt{7} \neq 8.$
So, neither of the two candidate values collectively implied by E-1 and E_2, satisfy the constraint collectively implied by E-2 and E-3.
</s>