# A property of the negative pell equation

I want to show that if $$(x,y)$$ is a solution to the negative pell equation ($$x^2-dy^2=-1)$$, then $$\frac{x}{y}$$ is a convergent of the continued fraction expansion of $$\sqrt{d}.$$

• One reference is this – rogerl Oct 13 '18 at 21:08

I think it's easier to see the connection in the other direction. Here's a slightly imprecise way to see this. Let $$[a_0; a_1, a_2, \dots]$$ be the regular continued fraction of $$\sqrt{d}$$. Cutting this infinite expression off at $$a_m$$ gives the convergent $$\frac{h_m}{k_m} \approx \sqrt{d}$$ which gives the best approximation by any rational with denominator less than or equal to $$k_m$$. So $$h_m \approx \sqrt{d}k_m$$ $$h_m^2 \approx dk_m^2$$ $$h_m^2 - dk_m^2 \approx 0.$$
But this is an integer expression, so being as close to $$0$$ as possible without actually equaling $$0$$ means $$|h_m^2 - dk_m^2| = 1.$$ So $$(h_m, k_m)$$ satisfies the Pell equation.
The fact that the convergents give the "best possible rational approximation" correspond to the minimality condition on $$x$$ and $$y$$ in the Pell equation! This is also the fact that allows us to (sometimes) use the Pell equation to find the fundamental unit of the real quadratic number field $$\mathbb{Q}[\sqrt{d}]$$.