1

Consider the equation $$x^2+5=y^2.\tag{1}$$

  1. If $x,y\in\mathbb{Z}$, what are solutions to (1)?

  2. If $x,y\in\mathbb{Q}$, what are solutions to (1)?

Note: $\mathbb{Z}$ is the set of all integers and $\mathbb{Q}$ is the set of all rational numbers.


My attempt: For problem 1, I run the following Mathematica program:
Solve[x^2 + 5 == y^2, {x, y}, Integers]
The output is
{{x -> -2, y -> -3}, {x -> -2, y -> 3}, {x -> 2, y -> -3}, {x -> 2, 
  y -> 3}}
I do not know if there is any other solutions. If the above result is correct, I would like to know why there is no other solutions.

For problem 2, I run the following Mathematica program:

Solve[(x/a)^2 + 5 == (y/b)^2 && a != 0 && b != 0 && GCD[x, a] == 1 && 
  GCD[y, b] == 1, {a, b, x, y}, Integers]
The output is the same as the input, it means that Mathematica cannot solve this equation.

Any comments and answers are welcome. Thank you very much.

6 Answers6

6

For solutions over $\Bbb Z$ see comments by others.

Finding solutions over $\Bbb Q$ is equivalent to solving $$x^2+5z^2=y^2$$ over $\Bbb Z$, with $x,y,z$ coprime. Without loss of (much) generality assume that $x,y,z$ are positive. Two points first:

  • $x,z$ cannot both be even as then $y$ is even, contradicting coprimality;
  • $x,z$ cannot both be odd as then $y^2\equiv2\pmod4$ which is impossible.

Thus one of $x,z$ is even , the other odd, so $y$ is odd. We have $$5z^2=(y-x)(y+x)\ .$$ First consider the case $x$ odd, $z$ even. Then $y-x$ and $y+x$ are both even and $$5\Bigl(\frac{z}{2}\Bigr)^2=\frac{y-x}{2}\frac{y+x}{2}\ .$$ The two factors on the RHS are coprime, so one of them is a square and the other is $5$ times a square. So there are two possibilities:

  • $(y+x)/2=5a^2$, $(y-x)/2=b^2$, so $x=5a^2-b^2$, $y=5a^2+b^2$, $z=2ab$.
  • $(y-x)/2=5a^2$, $(y+x)/2=b^2$, so $x=b^2-5a^2$, $y=5a^2+b^2$, $z=2ab$.

In both of these $a,b$ must be coprime; and one is even, one odd (since $x$ is odd). This gives positive rational solutions of the original equation as $$\left|\frac{5a^2-b^2}{2ab}\right|\ ,\quad \frac{5a^2+b^2}{2ab}\ .$$

Similarly in the case $x$ even, $z$ odd, $y-x$ and $y+x$ are coprime; similar working leads in fact to the same formulae but with with $a,b$ both odd. So the complete solution is as above, with $a,b$ having no common factor. (And of course if you do allow them to have a common factor you get repetitions of the same solutions.)

David
  • 84,708
  • 9
  • 96
  • 166
1

For a general case: $x^2+5y^2=z^2$ and $\gcd(x,y)=1$, there are 2 cases:

  1. $x$ is odd and $y$ is even:

    then $x=\pm(r^2+5s^2),~y=2rs,~z=r^2+5s^2$

  2. $x$ is even and $y$ is odd:

    then $x=\pm(2r^2+2rs-2s^2),~y=2rs+s^2,~z=2r^2+2rs+3s^2$

Gang men
  • 555
  • 2
  • 8
1

If $x$ and $y$ are to be rational, then the factorization $(y-x)(y+x)=5$ implies $y-x=r$ and $y+x=5/r$, where $r$ can be any (nonzero) rational number, in which case we find

$$x={5-r^2\over2r}\quad\text{and}\quad y={5+r^2\over2r}$$

If $x$ and $y$ are to be integers, then the factorization requires that $r\in\{\pm1,\pm5\}$, so the only solutions are $(x,y)=(\pm2,\pm3)$.

Barry Cipra
  • 81,321
1

Rewrite the equation as $y^2-x^2=5$, which gives $(y+x)(y-x)=5$.

For the set $\mathbb Q$ you can replace the equation as $(y+x)(y-x)=5z^2$, and solve that for integers. Then $\frac xz$ and $\frac yz$ are the required solutions.

Suppose we put $5z^2=720$, then we can represent this as, say, two numbers $8*90$, and $z=12$. This leads to $y=49, x=41, z=12$. We then have $4 \frac 1{12}$ and $3 \frac 5{12}$.

In base 12, this gives $4.1^2 = 14.81$, and $3.5^2 = E.81$, which have the required difference of 5.

That is, $(41/12)^2 + 5 = (49/12)^2$.

And this gives a proof that there are necessarily an infinite number of answers in $\mathbb Q$.

0

Let $ x^2 + 5 = y^2 $ such that $x,y$ are all Rational Numbers.

We can solve this Diophantine equation for a rational solutions

Put $$y=\frac{nx+m}{n}$$

then solve for x we get

$$x=\frac{5n^2-m^2}{2mn}$$ $$y=\frac{5n^2+m^2}{2mn}$$

0

Why do you need computer/software help for this small problem? You are looking for two squares differing by 5. Expand $(x+1)^2$. See how much it differs from $x^2$. This would give you an idea about the difference about consecutive squares.

  • Not that this isn't helpful advice, but seing as we don't even know that $x^2$ and $y^2$ are consecutive squares, and also, how you haven't adressed the rational solutions, this should've been a comment, not an answer. – Arthur Mar 28 '14 at 12:13
  • @ Arthur. Agreed it should have been a comment. For integers solutions $2x+1$ is the difference between $(x+1)^2$ and $x^2$. Easy to find $x$ such that $2x+1$ is 5. If consecutive squares being differing by 5 is rare what about two squares little farther? That was the point I was trying to make. I haven't addressed rational solutions. – P Vanchinathan Mar 28 '14 at 15:02