Find all $n \in \mathbb{Z}$ such that $\sqrt{\frac{4n-2}{n+5}}$ is a rational number How does one approach this problem, where
all  $\sqrt{\frac{4n-2}{n+5}}$ is a rational number when $n \in \mathbb{Z}$.
 A: If so there are coprime $\,a,b\,$ with $\,\dfrac{4n\!-\!2}{n\!+\!5} = \dfrac{a^2}{b^2}\ $ so $\,\begin{align}4n\!-\!2 &\,=\, ca^2\\ n\!+\!5 &\,=\, cb^2\end{align}\,,\,$ $\, c=\gcd(4n\!-\!2,n\!+\!5)$
Eliminating $\,n\,$ yields $\  {-}22\, =\, c(a^2-4b^2)\, =\, c(a-2b)(a+2b)$
So we need only test when $\,-22/c\,$ splits into  factors $\,a\pm 2b\,$ that are $\,\equiv\!\pmod{\! 4},\,$ a few cases.
A: As observed in the comments to the question, $p/q$ is a rational square if and only $pq$ is an integer square. Therefore $(4n-2)(n+5)=4n^2+18n-10$ should be a square:
$$
4n^2+18n-10-k^2=0
$$
Then $121+4k^2$ must be a square. Thus we have a primitive Pythagorean triple (note that $11\mid k$ leads to a contradiction).
A: Let $p,q$ be relatively prime positive integers such that $$\frac{4n-2}{n+5} = \frac{p^2}{q^2}$$
(note that $p\neq 0$ because $4n-2=0$ doesn't have integer solution.)
Then, we have $4n-2 = q^2k$, $n+5=p^2k$, $k\in\Bbb Z$. Now, $$4n-2 = 4(n+5) - 22\implies (4p^2-q^2)k = 22 \implies (2p-q)(2p+q)k = 22.$$
Notice that $2p-q\equiv2p+q\pmod 2$, and since $4\not\mid 22$, they must both be odd, implying that $$(2p-q)(2p+q)\mid 11$$
This leads to small number of cases:


*

*$(2p-q)(2p+q) = 11$


(We will come back to this case.)


*$(2p-q)(2p+q) = -11$ 


This would imply that $(2p-q)+(2p+q) = \pm 10$. Contradiction.


*$(2p-q)(2p+q) = 1$


This would imply that $2p-q=2p+q$, i.e. $q = 0$. Contradiction.


*$(2p-q)(2p+q) = -1$


This would imply that $(2p-q)+(2p+q) = 0$, i.e. $p = 0$. Contradiction.
Finally, we conclude that $(2p-q)(2p+q) = 11$, and since $2p-q<2p+q$, we have that $2p-q = 1$ and $2p-q=11$ (the other case when negative factors are chosen leads to negative $p$ and $q$). Solving the system we get $p=3$ and $q = 5$ (also, $k = 2$). This gives us
\begin{align}
4n-2 &= 50\\
n+5 &= 18
\end{align}
which implies that $n = 13$.
