In the following question posted
Few Questions about analysis in Rudins book
I did not understood how they associated the rational number q with the equation. $$ q = p - \frac{p^2 - 2}{p + 2} $$
Need to understand on how $$ p^2 - 2 $$ and $$ p + 2 $$ is chosen.