Inspired by this observation, we consider solving the equation z2−2=0 with Newton's method. Starting from some initial iterate z0, Newton's method gives the iteration
zt+1=zt−2ztzt2−2=2zt+zt1.
If zt is a rational number, then it is clear that zt+1 will be rational as well, and we can write zt=xt/yt for some integers xt and yt. Plugging this in, we get the iteration
yt+1xt+1=2ytxt+xtyt=2xtytxt2+2yt2.
Splitting the numerator and denominator, we have the updates
xt+1=xt2+2yt2andyt+1=2xtyt.
Assume that (xt,yt) is a solution to Pell's equation. Plugging in the update, we see that (xt+1,yt+1) is also a solution:
In other words, given an initial solution to Pell's equation, e.g., (3,2), we can generate additional solutions via Newton's method applied to the root finding problem. The ratio x/y will also provide a better and better approximation to 2.
Exercise 3.5 in the book derives this procedure using a more geometric approach. This derivation via Newton's method may be well-known (my number theory knowledge is very much lacking), but I thought it was an interesting connection.