I am reading Baby Rudin and stuck at one small point. $A$ is set of all positive rationals $p$ such that $p^2<2$ and $B$ is set of all positive rationals $p$ such that $p^2>2$. We wanted to show $A$ contains no largest element and $B$ contains no smallest element. So for any such $p$ in either set, author associated number $q$ as,
$q=p-\frac{p^2-2}{p+2}$, which works fine.
I was trying to figure out how to obtain the quantity $\frac{p^2-2}{p+2}$.
I did it for set $A$ as follows.
So, we have positive rational $p$ such that $p^2<2$. We want some $k>0$ such that $(p+k)^2 <2$
i.e. $p^2+2pk+k^2<2$
As all three quantities are positive, we can say
$p^2+2pk<2$, which gives
$k<\frac{2-p^2}{2p}$.
But as $p^2<2$, we have $p<2 \Rightarrow p+p=2p<p+2$
Therefore, we can choose $k=\frac{2-p^2}{p+2}$.
But I am stuck while deriving it for set $B$.
I did following.
So, we have positive rational $p$ such that $p^2>2$. We want some $k<0$ such that $(p+k)^2 >2$
i.e. $p^2+2pk+k^2>2$.
From this point, I can say $p^2+k^2>2$, but not sure how this will take me to the desired result.
Any hint or help. Thank you.