Solving Diophantine equations involving $x, y, x^2, y^2$ My father-in-law, who is 90 years old and emigrated from Russia, likes to
challenge me with logic and math puzzles. He gave me this one:
Find integers $x$ and $y$ that satisfy both $(1)$ and $(2)$
$$x + y^2 = 8 \tag{1} $$
 $$x^2 + y = 18 \tag{2}$$
I found one solution by deriving this equation:
$$ x(x+1) + y(y+1) = 26$$
which means, I need to find two numbers that add up to $26$, where each number is the product of two consecutive numbers. Through trial and error I found a solution. From college days I seem to remember that there is a more elegant way using the theory of Diophantine equations.
Can someone remind me or point to me to an easy to follow explanation of the method for solving problems like these?
 A: We have $$x^2+x+y^2+y=26\iff(2x+1)^2+(2y+1)^2=106=2\cdot53=2(7^2+2^2)=(7-2)^2+(7+2)^2$$
Observe that $106$ can have only one representation as sum of two squares $(\pm9)^2+(\pm5)^2$ 
See also the Sum of Squares Function and https://mathoverflow.net/questions/29644/enumerating-ways-to-decompose-an-integer-into-the-sum-of-two-squares
A: Here is an alternative way to solve for the original problem.
$$\left\{\begin{array}{ll}x+y^2&=&8\\x^2+y&=&18\end{array}\right. \tag{1}$$
Instead of adding, subtract the two equations and get
$$x^2-y^2+y-x=10\Rightarrow\\(x-y)(x+y-1)=10$$
For two integers $a$ and $b$ to have product $10$, list all possibilities. $$1\times 10,2\times 5,2\times 5, 10\times 1,-1\times -10,-2\times -5,-2\times -5, -10\times -1, $$
Now for each $a$ and $b$, obtain the system $$\left\{\begin{array}{lll}x-y&=&a\\x+y-1&=&b\end{array}\right. \tag{2}$$
This is a linear equation and has solution $x=\dfrac{a+b+1}{2}$ and $y=\dfrac{b-a+1}{2}$ (if instead of $10$, say, we have $16$; use the constraint that $x$ and $y$ are integers to eliminate certain choices. In particular, we can eliminate cases where $a$ and $b$ have same parity because $a+b+1$ and $a-b+1$ have to be even).
Plug in values of $a$ and $b$ obtained from $(2)$ to get possible values for $x$ and $y$ (that are integers). And recheck the values for $x$ and $y$ so obtain matches with the original system (because we are essentially solving $(2)$ and not $(1)$, and we haven't shown that $(2)$ is necessary and sufficient condition for $(1)$ to hold).
$$\begin{array}{rr|rr}
a&b&x&y\\ \hline
1&10&6&5\\
2&5&4&2\\
5&2&2&4\\
-1&-10&-5&-4\\
-2&-5&-3&-1\\
-5&-2&-1&-3\\
-10&-1&-4&-5
\end{array}$$
See that $(4,2)$ is the only possible answer for $(x,y)$.
A: You can do without the theory of Diophantine equations.
$$x^2+y=18\implies y=18-x^2.$$
Plugged in the other equation,
$$x+(18-x^2)^2=8$$or
$$x^4-36x^2+x-316=0.$$
With a polynomial solver, you get two positive roots $x=4$ and $x\approx4.458899113761$.
A: For such tiny values, the best approach is by exhaustive search.
Considering $x+y^2=8$, you know it suffices to make two attempts: $y=1$ and $y=2$, with corresponding $x=7$ and $x=4$ !!!
The remaining equation $x^2+y=18$ confirms $(4,2)$.
A: $$\begin{align}
x^2+x+y^2+y&=26 \quad 
\\
\text{subs}\quad y&=x+d \quad \bigg{|} \quad d \in \mathbb{Z} \implies
\\
2x^2+2(d+1)x+d^2+d-26&=0 \implies
\\
x&=\frac{1}{2} \bigg{[} -(d+1) \pm \sqrt{53-d^2} \bigg{]} \implies
\\
\text{only sol'n} \quad d&=\pm2 \quad \to \quad (x,y) \in \bigg\{(2,4),(-5,-3),\color{red}{(4,2)},(-3,-5)\bigg\}
\end{align}$$
Cool problem.  Even 3 years, 2 months after the fact
