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}$.

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