[guided]We close the argument by tightening the constants. From the previous step,
\begin{align*}
|p_n^2 - N q_n^2| < \frac{2 q_n}{q_{n+1}} \sqrt{N} + \frac{1}{q_{n+1}^2}. \qquad (\star)
\end{align*}
We want to show the right-hand side is $\leq 2\sqrt{N}$. Rearranging, this is equivalent to
\begin{align*}
2 \sqrt{N} \cdot \frac{q_{n+1} - q_n}{q_{n+1}} \geq \frac{1}{q_{n+1}^2}, \quad \text{i.e.,} \quad 2\sqrt{N} (q_{n+1} - q_n) q_{n+1} \geq 1.
\end{align*}
We verify this inequality case by case.
**Case 1: $n \geq 1$.** Then $q_{n+1} > q_n$, so $q_{n+1} - q_n \geq 1$. Also $q_{n+1} \geq 2$ (since $q_n \geq 1$ and $q_{n+1} > q_n$). Hence
\begin{align*}
2\sqrt{N}(q_{n+1} - q_n)q_{n+1} \geq 2\sqrt{N} \cdot 1 \cdot 2 = 4\sqrt{N} \geq 4\sqrt{2} > 1,
\end{align*}
using $N \geq 2$ (since $N$ is a positive non-square integer, so $N \in \{2, 3, 5, 6, 7, 8, 10, \ldots\}$ and the smallest value is $N = 2$).
**Case 2: $n = 0$.** In this case $q_0 = 1$ and $q_1 = a_1 \geq 1$. If $a_1 \geq 1$ strictly, i.e., $q_1 \geq 2$, the argument of Case 1 applies. If $q_1 = 1$, then $q_0 = q_1 = 1$ and the expression $(\star)$ becomes
\begin{align*}
|p_0^2 - N q_0^2| < 2\sqrt{N} \cdot 1 + 1 = 2\sqrt{N} + 1,
\end{align*}
which is not the bound we seek. However, $n = 0$ with $q_0 = q_1 = 1$ corresponds to $a_0 = \lfloor \sqrt{N} \rfloor$ and $\theta_1 > 1$ (the first partial quotient is $1$ only when $\sqrt{N} - \lfloor \sqrt{N} \rfloor > 1/2$, else $a_1 \geq 2$). In this edge case we verify the bound directly: $p_0 = a_0$, so
\begin{align*}
|p_0^2 - N q_0^2| = |a_0^2 - N| = N - a_0^2,
\end{align*}
since $a_0 = \lfloor \sqrt{N} \rfloor < \sqrt{N}$ gives $a_0^2 < N$. Writing $a_0 = \sqrt{N} - \varepsilon$ with $0 < \varepsilon < 1$,
\begin{align*}
N - a_0^2 = (\sqrt{N} - a_0)(\sqrt{N} + a_0) = \varepsilon(2\sqrt{N} - \varepsilon) < 2\sqrt{N} \cdot 1 = 2\sqrt{N}.
\end{align*}
In every case, $|p_n^2 - N q_n^2| \leq 2\sqrt{N}$. This completes the proof.[/guided]