# System of diophantine equations $x^2+3y=u^2$, $y^2+3x=v^2$

Solve the following system of Diophantine equations(the unknowns are positive integers):
$$\left\{ \begin{array}{c} x^2+3y=u^2 \\ y^2+3x=v^2 \end{array} \right.$$

I worked as follows:
subtract the two equations to get: $4x^2-4y^2-12(x-y)=9y^2-9x^2\ \implies\ ... (x-y)(13x+13y-12)=0\implies x=y\ or\ 13x+13y-12=0$
The first equation has infinite answers and the second has none(since $gcd(13,13)$ does not divide $12$), am I right??

• Shouldn't subtraction give you $x^2 + 3y - y^2 - 3x = u^2 - v^2$? – An Hoa Jun 13 '16 at 2:57
• @AnHoa Yes you are right,but before that I had deduced that since $u^2-x^2=3y$ so $u-x=3$ and $u+x=y$ – Hamid Reza Ebrahimi Jun 13 '16 at 3:37

We can without (much) loss of generality assume that $y\le x$. Note that $x^2+3y$ is a perfect square greater than $x^2$.

Thus we have $x^2+3y\ge (x+1)^2$. But $x^2+3y\lt (x+2)^2$. It follows that $3y=2x+1$.

Since $y^2+3x$ is a perfect square, so is $9y^2+27x$, that is, $4x^2+31x+1$. This has to be a square, so $4x^2+31x+1$ is equal to one of $(2x+1)^2$ or $(2x+2)^2$ and so on up to $(2x+7)^2$, since $(2x+8)^2$ is clearly too big.

The case $(2x+1)^2$ does not work, and neither does $(2x+2)^2$, nor $(2x+3)^2$. The case $(2x+4)^2$ gives $x=1$. The case $(2x+5)^2$ does not work. The case $(2x+6)^2$ gives $x=5$, which does not work because $y$ is not an integer, and the case $(2x+7)^2$ gives $x=16$.

We conclude that the solutions are $x=1,y=1$, $x=16, y=11$, (and $x=11,y=16$).

• It seems there are other answers for unknowns too,for example: $x=16,y=11,u=17,v=13x=16,y=11,u=17,v=13$... – – Hamid Reza Ebrahimi Jun 13 '16 at 4:01
• @HamidRezaEbrahimi: My approach used a few more cases than perhaps necessary, but I think things are OK now. – André Nicolas Jun 13 '16 at 5:02

The solution to this system of equations there. http://www.artofproblemsolving.com/community/c3046h1046718__4

\left\{\begin{aligned}&x^2+qy=z^2\\&y^2+qx=v^2\end{aligned}\right.

Use this decision.

$$x=2psb^2-a^2p^2$$

$$y=2abp^2-b^2s^2$$

$$q=as(4bp-as)$$

$$z=a^2p^2+2psb^2-abs^2$$

$$v=2abp^2-psa^2+b^2s^2$$

In our case, it is necessary to $b=1$ ; $p=1$ and $(a,s) - (\pm3;\pm1)$

$$x^2-y^2-3(x-y)=u^2-v^2$$ $$(x-y)(x+y-3)=(u+v)(u-v)$$ Assuming $u^2-v^2\neq 0$, we have: $$\dfrac{x-y}{u-v}=\dfrac{u+v}{x+y-3}=\dfrac{r}{s}$$ where $\gcd(r,s)=1$. $$x-y=\dfrac{r(u-v)}{s}$$ $$x+y=\dfrac{s(u+v)}{r}+3$$ since $x,y$ are integers, and $u,v$ have the same parity, then there exist $p,q$ such that: $$u-v=ps$$ $$u+v=qr$$ Hence, $$x-y=pr$$ $$x+y=qs+3$$ with $$x=\dfrac{qs+pr+3}{2}$$ $$y=\dfrac{qs-pr+3}{2}$$ $$u=\dfrac{qr+ps}{2}$$ $$v=\dfrac{qr-ps}{2}$$ where either $qr$ and $ps$ have the same parity and $pr$ and $qs$ have opposite parity.