If
\[x=a, \; y=b\]
are solutions are Pell's equation \[x^2-ny^2=1\]
then \[\frac{a}{b}\]
is a convergent of \[\sqrt{n}\]
.Proof
Using this Theorem (When is a Rational Fraction a Convergent of an Infinite Continued Fraction) we show
\[\| \sqrt{n} - \frac{a}{b} \| \lt \frac{1}{2b^2}\]
then \[\frac{a}{b}\]
is a convergent of \[\sqrt{n}\]
.\[x^2-ny^2=()(x+ \sqrt{n} y)=1 \rightarrow x- \sqrt{n} y = \frac{1}{x+ \sqrt{n} y} \gt 0 \]
so \[a \gt b \sqrt{n}\]
.Therefore
\[\| x - \frac{a}{b} \| = \| \frac{a- b \sqrt{n}}{b} \| = \frac{1}{b(a+b \sqrt{n})} \lt \frac{1}{b()b \sqrt{n} + b \sqrt{n})} \lt \frac{1}{2b^2}\]
.Hence
\[\frac{a}{b}\]
is a convergent of \[\sqrt{n}\]
.