# Can both $x^2 + y+2$ and $y^2+4x$ be squares?

Prove that there exist no positive integers $x$ and $y$ such that both $x^2+y+2$ and $y^2+4x$ are perfect squares.

I thought I could perhaps solve this by square bounding but I couldn't get anywhere with it.

Thanks in advance for any help.

• Where did you get stuck? For instance, how big does $x$ need to be (relative to $y$) for $y^2+4x$ to be square? May 7 '13 at 5:01
• Well, you get that $4x \geq 2y+1$, but wait a moment, $2y+1$ is odd so in fact $4x \geq 4y+4 \; \; \; \implies x \geq y+1$ (1). May 7 '13 at 5:13
• Along that line of thought we have that $y+2 \geq 2x+1 \; \; \; \implies y+1 \geq 2x$ (2). May 7 '13 at 5:14
• Hence by (1) and (2) we have that $x \geq y+1 \geq 2x \; \; \; \implies x \geq 2x$ which is a contradiction as $x$ is positive. Is that it? May 7 '13 at 5:15
• Yup, you got it. If you have a chance, please write this up as an answer to your own question. May 7 '13 at 5:26

Thanks to Erick Wong for setting me on the right track.

Assume for sake of contradiction that $x^2+y+2$ and $y^2+4x$ are both perfect squares.

Then as $y$ is a positive integer, $x^2+y+2 \geq (x+1)^2=x^2 +2x+1$ $$\implies y+2\geq 2x+1$$ $$y+1 \geq 2x \; \; \; \; \; (1)$$

Following a similar argument, as $x$ is a positive integer, $y^2+4x \geq (y+1)^2=y^2+2y+1$ $$\implies 4x \geq 2y+1$$ But, $4x$ is even and $2y+1$ is odd so equality can never hold and hence $$y^2+4x \geq (y+2)^2=y^2+4y+4$$ $$\implies x \geq y+1 \; \; \; \; (2)$$

Combining (1) and (2) we have that $x \geq y+1 \geq 2x$ $$\implies x \geq 2x$$ Which is a contradiction as $x \geq 1$.

Hence there are no positive integers $x$ and $y$ satisfying the requirements. QED

• +1 Nicely written with very clear exposition. May 7 '13 at 5:43
• $(+1)$ Elegant .. May 7 '13 at 5:44

Maybe it is better to solve such a system the system of Diophantine equations:

\left\{\begin{aligned}&x^2+yz+2z^2=q^2\\&y^2+4xz=r^2\end{aligned}\right.

Then the solution can be written.

$$x=p^3+4kp^2-4pk^2-k^3$$

$$y=p^3+142kp^2+49pk^2+4k^3$$

$$z=4p(5k^2+53kp+138p^2)$$

$$q=781p^3+350kp^2+44pk^2+k^3$$

$$r=47p^3+106kp^2+39pk^2+4k^3$$

$p,k$ - integers asked us.