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


If $x,y\in\mathbb{Z}$, what are solutions to (1)?
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 &amp;&amp; a != 0 &amp;&amp; b != 0 &amp;&amp; GCD[x, a] == 1 &amp;&amp; 
  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.
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.)
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.