I have a rectangle of sides x and y

x+y=5

The diagonal of the rectangle is 4

Show that 2x^2-10x+9=0

I did $\displaystyle \sqrt{x^2+y^2}=4\longrightarrow x^2+y^2=16, x+y=10$

so i tried doing a simultaneous equation by cancelling out the y^2 first

I did the x+y=10 times (x-y)

$\displaystyle 10x-10y=x^2-y^2$

So I added them together

$\displaystyle -2x^2+10x+16=10y$

Now I'm stuck. What have I done wrong?