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 && 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.