# 17th or 18th century use of the continued fraction expansion of $(1 + \sqrt D)/2$ to solve the diophantine equation $x^2 - D y^2 = 4$

Can someone please provide an early reference to the use of the continued fraction expansion of $$\frac{1+\sqrt D}2$$ to solve the Diophantine equation $$x^2 - D y^2 = 4$$ for a positive integer $$D$$ congruent to $$1$$ modulo $$4$$, $$D$$ not a square? Or some method equivalent to the use of the continued fraction expansion of $$\frac{1+\sqrt D}2$$. An 18th century reference? 17th century? Modern references are easy to find—20th and 21st century.

An equivalent method might involve use of binary quadratic forms, even if the terminology “binary quadratic form” is not used. For example Brouncker's (maybe it's Wallis') method for solving $$x^2 - D y^2 = 1$$ (see André Weil, Number Theory, An approach through history from Hammurapi to Legendre, Birkhäuser, 2001, pp. 92 ff) essentially uses binary quadratic forms and is equivalent to computing the continued fraction of $$\sqrt D$$.

I have been searching for a source for this for a few weeks, and have not found anything. I've looked at Weil, Edwards, Mollin, Jacobson and Williams, Dickson's History (especially Vol II, pp. 351 to 353), Whitford, Fermat's Oeuvres (but I haven't read every page!), Lenstra's 2002 Notices article, Williams's millennial talk, Mahoney, Ribenboim, countless websites, and more.

• For what it's worth, on page 11 of Conrad's Pell’s Equation, II he credits Lagrange with the reductive technique for solving the generalized Pell's equation that "can be settled using the continued fraction of $\sqrt d$." Jul 8, 2023 at 12:54
• The Fermat/Brouncker/Wallis method for solving Pell equations in 1657 is essentially based on the regular continued fraction of $\sqrt{D}$. Lagrange (about 1770) is the first to show this method always works. I am specifically interested in whether there are any references for use of $(1 + \sqrt{D})/2$ prior to the 20th century. Actually, I think the earliest reference I have is 1954 (O. Perron's continued fractions book, third edition). But, the method must pre-date this, whether or not it was proved to always work. Jul 8, 2023 at 18:31