Density of rational numbers Let $p\in \mathbb{Q}$ such that $p^2<2$. Find $\varepsilon>0$ such that $p+\varepsilon\in \mathbb{Q}$ and $(p+\varepsilon)^2<2$.
I need the explicit form of $\varepsilon$. Can anyone show how to find $\varepsilon$?
 A: If $p<0$ then we can take $\varepsilon = -p >0$. So let's assume that $p\ge0$.
$(p + \varepsilon) ^ 2 = p^2 + 2p\varepsilon +\varepsilon^2$
and so it is enough to take $\varepsilon$ such that $p^2 + 2p\varepsilon +\varepsilon^2< 2$.
We shall look for $\varepsilon < 1$. Then $\varepsilon^2 < \varepsilon$ and so it is enough to take $\varepsilon$ such that $p^2 + 2p\varepsilon +\varepsilon\le 2$. The largest solution is
$$
\varepsilon = \frac{2-p^2}{2p+1}
$$
If $p$ is rational, then so is $\varepsilon$.
Moreover, $p^2 < 2$ implies $\varepsilon >0$.
However, this $\varepsilon$ may not satisfy $\varepsilon <1$.
So we take
$$
\varepsilon = \min\big(1,\frac{2-p^2}{2p+1}\big)
$$
A: Let
$$\epsilon = \frac{1}{\lceil \frac{1}{\sqrt{2} - \lvert p \rvert} \rceil + 1} \in \mathbb{Q}$$
Because
$$0 < \frac{1}{\sqrt{2} - \lvert p \rvert} < \lceil \frac{1}{\sqrt{2} - \lvert p \rvert} \rceil + 1$$
We have
$$0 <\epsilon < \sqrt{2} - \lvert p \rvert \leq \sqrt{2} - p $$
$$ -\sqrt{2} < p + \epsilon< \sqrt{2}$$
$$(p + \epsilon) ^ 2 < 2$$
