Additions Chapter II — Solution of Some Curious and New Arithmetical Problems

Summary: Lagrange’s second Addition applies the continued-fraction theory of Chapter I to four Diophantine-minimum problems, culminating in the periodicity theorem for quadratic irrationals (Art. 34), the first rigorous proof that the Pell equation is always solvable (Art. 37), and Euler’s table of continued fractions for , (Art. 41).

Sources: additions-2

Last updated: 2026-05-10


Preamble (p. 436)

Lagrange notes that the new problems “depend on the same principles” as Chapter I but will be treated directly, “without supposing any thing of what has been before demonstrated: by which means we shall have the satisfaction of seeing how necessarily these subjects lead to the theory of Continued Fractions.” Continued fractions, in his view, are not merely a tool for these problems; they are the inevitable form the answer takes.

This chapter occupies Articles 23–41 (pp. 436–462).


Problem 1 — Best Approximation in the Form (Arts. 23–27)

Statement (Art. 23): Given a positive quantity (rational or not), find positive integers coprime to each other such that is less than for any smaller pair with , .

Strategy: Suppose is optimal and let be any smaller candidate. The minimum condition forces when . Lagrange shows that the optimal satisfies an auxiliary identity

with and of opposite signs (Art. 24). The proof that such exist uses a pigeonhole argument on the residues of modulo (Art. 23, end).

Iterated reduction (Art. 24): Setting , the optimal pair admits the descent

q &= \mu q' + q'', & p &= \mu p' + p'',\\ q' &= \mu' q'' + q''', & p' &= \mu' p'' + p''',\\ q''&= \mu'' q''' + q^{iv},& p''&= \mu'' p''' + p^{iv},\\ &\ \ \vdots & &\ \ \vdots \end{aligned}$$ where the integer multipliers $\mu, \mu', \mu'', \ldots$ are positive, and the sequences $p, p', p'', \ldots$ and $q, q', q'', \ldots$ both decrease, terminating at $p^\rho = 1, q^\rho = 0$. **Determinant identities** (Art. 24): $$pq' - qp' = \pm 1, \quad p'q'' - q'p'' = \mp 1, \quad p''q''' - q''p''' = \pm 1, \ldots$$ with signs alternating. **Master formulas** (Art. 25): Reindex in the *increasing* direction $p^0, p', p'', \ldots$ (and $q^0, q', q'', \ldots$). Then $$\begin{aligned} p^0 &= 1, & q^0 &= 1,\\ p' &= \mu, & q' &= 1,\\ p'' &= \mu' p' + 1, & q'' &= \mu',\\ p''' &= \mu'' p'' + p', & q''' &= \mu'' q'' + q',\\ p^{iv} &= \mu''' p''' + p'', & q^{iv} &= \mu''' q''' + q'',\\ &\ \ \vdots & &\ \ \vdots \end{aligned}$$ with bounds $\mu < a$ and $$\mu' < \frac{p^0 - aq^0}{aq' - p'} < \frac{1}{a - \mu}, \quad \mu'' < \frac{aq' - p'}{p'' - aq''}, \ldots$$ (the sign $<$ here means "the largest integer below"). **Corollary 1 — These are the convergents of $a$** (Art. 26): Setting $$b = \frac{1}{a - \mu}, \quad c = \frac{1}{b - \mu'}, \quad d = \frac{1}{c - \mu''}, \ldots$$ gives $$a = \mu + \cfrac{1}{\mu' + \cfrac{1}{\mu'' + \cfrac{1}{\mu''' + \cdots}}}$$ so the $\mu^k$ are precisely the partial quotients of $a$, and the $p^k/q^k$ are precisely its principal [[convergents]]. **Corollary 2 — Optimality** (Art. 27): Hence every principal convergent $p/q$ of $a$ (from a CF with all positive partial quotients) satisfies $$|p - aq| < |p' - aq'| \quad \text{for every pair } p' < p, q' < q.$$ This is the $|p - aq|$ form of [[best-rational-approximations|Lagrange's best-approximation theorem]] — sharper than the $|a - p/q|$ form of Add. I, Arts. 14–16. --- ## Problem 2 — Minimum of a Homogeneous Form $Ap^m + \cdots + Vq^m$ (Arts. 28–30) **Statement** (Art. 28): Given a homogeneous polynomial $$F(p, q) = Ap^m + Bp^{m-1}q + Cp^{m-2}q^2 + \cdots + Vq^m$$ with integer coefficients, find positive integers $p, q$ minimizing $|F(p,q)|$. **Reduction via root factorization**: Let $\alpha, \beta, \gamma, \ldots$ be the real roots and $\mu \pm \nu\sqrt{-1}, \pi \pm \rho\sqrt{-1}, \ldots$ the imaginary roots of the single-variable equation $$A\kappa^m + B\kappa^{m-1} + \cdots + V = 0.$$ Then $$F(p, q) = A(p - \alpha q)(p - \beta q)\cdots\bigl((p - \mu q)^2 + \nu^2 q^2\bigr)\bigl((p - \pi q)^2 + \rho^2 q^2\bigr)\cdots$$ Each linear factor $|p - \alpha q|$ is minimized by Problem 1 with $a = \alpha$; each quadratic factor $(p - \mu q)^2 + \nu^2 q^2$ is minimized when $|p - \mu q|$ is minimized (Art. 28). Thus the candidate pairs are the convergents to each real root and to each real part of an imaginary root. **Scholium 1 (Art. 29)**: Sign considerations — the minimum may be attained for negative $p$ or $q$ as well, requiring separate inspection. **Scholium 2 (Art. 30)**: When the polynomial has commensurable roots, $F(p,q)$ can be made *zero*, so there is no positive minimum. Otherwise, $F(p, q) \ge 1$ since the coefficients are integers — interpret this as: the equation $F(p, q) = \pm 1$ requires the same machinery, and Lagrange refers to his earlier paper *Mémoires de l'Académie de Berlin* 1768. --- ## Problem 3 — Minimum of a Binary Quadratic Form (Arts. 31–33) **Statement** (Art. 31): For $$F(p, q) = Ap^2 + Bpq + Cq^2$$ with integer $A, B, C$ and integer positive $p, q$, find the minimum of $|F(p, q)|$. **Three cases by discriminant** $\Delta = B^2 - 4AC$: | Case | $\Delta$ | Roots of $Ax^2+Bx+C=0$ | Minimum | |------|----------|--------------------------|---------| | Square | $\ge 0$, square | Rational | $0$ (no minimum) | | Negative | $< 0$ | Imaginary | Use real part $-B/(2A)$ | | Positive non-square | $> 0$, non-square | Real irrational | Use both roots | See [[binary-quadratic-forms]] for the unified treatment. ### Case 1: $\Delta < 0$ (Art. 32) The roots of $Ax^2 + Bx + C = 0$ are imaginary; their common real part is $-B/(2A)$. Reduce $-B/(2A)$ to a continued fraction; the convergents $p/q$ (signed appropriately) yield the candidates for the minimum. **Example** (Art. 32): For $49p^2 - 238pq + 290q^2$, $\Delta = -196$ and $-B/(2A) = 17/7$. The CF $17/7 = [2; 2, 3]$ has convergents $2/1, 5/2, 17/7$. Augmenting with $1/0$: | $p$ | $q$ | $P = 49p^2 - 238pq + 290q^2$ | |-----|-----|----------| | 1 | 0 | 49 | | 2 | 1 | 10 | | 5 | 2 | **5** | | 17 | 7 | 49 | Minimum is $\boxed{5}$ at $(p, q) = (5, 2)$. ### Case 2: $\Delta > 0$, non-square (Art. 33) The roots are $a, b = (-B \pm \sqrt{E})/(2A)$ where $E = B^2 - 4AC$. Reduce *one root* (say $a$, taken positive) to a CF as in Add. I; the partial quotients $\mu, \mu', \mu'', \ldots$ generate sequences $$P^0 = A, \quad Q^0 = \tfrac{1}{2}B,$$ $$P' = A\mu^2 + B\mu + C, \quad Q' = A\mu + \tfrac{1}{2}B,$$ $$P'' = \mu'^2 P' + 2\mu' Q' + P^0, \quad Q'' = \mu' P' + Q',$$ $$P''' = \mu''^2 P'' + 2\mu'' Q'' + P', \quad Q''' = \mu'' P'' + Q',$$ $$\ldots$$ with the **fundamental identity** $$Q^{k\,2} - P^{k-1} P^k = \tfrac{1}{4}E \quad (k = 1, 2, 3, \ldots).$$ The candidate values for the minimum are exactly $|P^0|, |P'|, |P''|, \ldots$ (Art. 33). The integer parts $\mu^k$ are determined by $$\mu^k < \frac{-Q^k \pm \tfrac12\sqrt{E}}{P^k}$$ (sign alternating with $k$). See [[binary-quadratic-forms]] and [[periodicity-quadratic-irrationals]]. --- ## Periodicity Theorem (Arts. 34–36) The sequences $P^0, P', P'', \ldots$ and $Q^0, Q', Q'', \ldots$ generated above are **eventually periodic**. Specifically (Art. 34): 1. Two consecutive $P^k$ with different signs eventually appear; thereafter all $P^k$ alternate in sign. 2. From that point on, $|P^k| \le E$ and $|Q^k| \le \sqrt{E}$ — both sequences are bounded. 3. Since the integer values are bounded, some pair $(P^\pi, Q^\pi)$ recurs; let $\pi + 2\rho$ be the first repetition. Then $$P^{\pi + 2\rho} = P^\pi, \quad Q^{\pi + 2\rho} = Q^\pi, \quad \mu^{\pi + 2\rho} = \mu^\pi$$ and the entire continuation is periodic with period $2\rho$. **Corollary 1 (Art. 35)**: If the minimum value of $|P^k|$ is reached *before* the periodic block starts, it appears infinitely many times along the period — generating infinitely many $(p, q)$ giving the minimum. **Corollary 2 (Art. 36)**: A streamlined formulation: once the sign-alternating regime is entered (say at $P^\lambda$), one has the cleaner recurrence $$\mu^{iv} = \frac{p^v - bq^v}{p^{iv} - bq^{iv}} - \frac{p''' - bq'''}{p^{iv} - bq^{iv}}$$ etc., useful for computation. Lagrange refers to his *Mémoires de Berlin* 1768 for a fuller theory of periodic continued fractions. This is the first rigorous proof of what is now called **Lagrange's theorem on periodic continued fractions** — see [[periodicity-quadratic-irrationals]]. --- ## Pell Equation Always Solvable (Art. 37, Corollary 3) **Theorem**: For any positive integer $K$ that is not a perfect square, the equation $$p^2 - Kq^2 = 1$$ is solvable in positive integers $p, q$. **Proof sketch**: Apply Problem 3 to $F(p, q) = p^2 - Kq^2$ (i.e. $A = 1, B = 0, C = -K$, $E = 4K$, $\sqrt{E}/2 = \sqrt{K}$). Then $P^0 = 1, Q^0 = 0$, and $\mu < \sqrt{K}, \mu' = \mu, P' = \mu^2 - K$ is negative, satisfying $-P' \ge 1$. By the periodicity (Art. 34), the term $P^{2\rho} = P^0 = 1$ recurs after the first full period, and the corresponding $(p, q) = (p^{2\rho}, q^{2\rho})$ is the desired Pell solution. ∎ This is the first rigorous proof of the **existence of nontrivial solutions to Pell's equation** — a classic problem since Brahmagupta and Fermat. Compare the constructive method on the [[pell-equation]] page (Euler's iterative descent), which assumes solvability. --- ## $p^2 - Kq^2 = \pm H$ Forces Convergents (Art. 38, Corollary 4) **Theorem**: If the equation $p^2 - Kq^2 = \pm H$ ($K$ non-square positive, $H < \sqrt{K}$ positive) has a solution in integers, then $p/q$ must be a principal convergent of $\sqrt{K}$. **Proof idea**: From $p^2 - Kq^2 = H$ one writes $(p - q\sqrt{K})(p + q\sqrt{K}) = H$, so $$p - q\sqrt{K} = \frac{H}{p + q\sqrt{K}} < \frac{1}{2q}$$ (when $p/q > \sqrt{K}$ and $H < \sqrt{K}$). This is the [[convergents|Hurwitz-style criterion]] for $p/q$ to be a principal convergent: any rational approximation with $|p/q - \sqrt{K}| < 1/(2q^2)$ is necessarily one of them. ∎ This explains why the algorithmic search for Pell solutions in [[ch2.0.7-pell-equation-method]] is *equivalent* to scanning the CF expansion of $\sqrt{K}$. --- ## Worked Example — $9p^2 - 118pq + 378q^2$ (Art. 40) $A = 9, B = -118, C = 378$, $E = 316$, $\sqrt{E}/2 = \sqrt{79}$. The two roots of $9x^2 - 118x + 378 = 0$ are $$a = \frac{59 \pm \sqrt{79}}{9}, \quad b = \frac{59 \mp \sqrt{79}}{9}.$$ **First case** ($+\sqrt{79}$): $\mu < (59+\sqrt{79})/9$, so $\mu = 7$. Continuing the $P, Q, \mu$ sequences: | $k$ | $P^k$ | $Q^k$ | $\mu^k$ | |----:|------:|------:|--------:| | 0 | 9 | −59 | 7 | | 1 | −7 | 4 | 1 | | 2 | 10 | −3 | 1 | | 3 | −3 | 7 | 5 | | 4 | 5 | −8 | 3 | | 5 | −6 | 7 | 2 | | 6 | 9 | −5 | 1 | | 7 | −7 | 4 | 1 | $P^7 = P', Q^7 = Q'$ — the period is 6, starting at $\pi = 1$. Minimum $P = -3$ at $k = 3$. **Second case** ($-\sqrt{79}$): $\mu = 5$, period 6 starting later, also yielding $P^{iv} = -3$. **Minimum value**: $\boxed{-3}$, attained at $(p, q) = (15, 2)$ in the first case and $(p, q) = (39, 7)$ in the second. The CF expansions of the two roots are $$7 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{5 + \cfrac{1}{3 + \ldots}}}} \quad\text{and}\quad 5 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{3 + \cfrac{1}{5 + \ldots}}}}$$ both periodic with period 6. The **two periods are reverses of each other** — a phenomenon Lagrange notes as a feature of conjugate quadratic surds. --- ## Table of Continued Fractions for $\sqrt{N}$ (Art. 41, Scholium) Lagrange reproduces Euler's table from *New Commentaries of Petersburg*, vol. XI, listing the periodic CF expansion of $\sqrt{N}$ for every non-square $N$ from 2 to 99. Sample entries: | $N$ | $\sqrt{N}$ as CF | Period | |----:|-----------------|-------:| | 2 | $[1; \overline{2}]$ | 1 | | 3 | $[1; \overline{1, 2}]$ | 2 | | 5 | $[2; \overline{4}]$ | 1 | | 7 | $[2; \overline{1, 1, 1, 4}]$ | 4 | | 13 | $[3; \overline{1,1,1,1,6}]$ | 5 | | 19 | $[4; \overline{2,1,3,1,2,8}]$ | 6 | | 23 | $[4; \overline{1,3,1,8}]$ | 4 | | 31 | $[5; \overline{1,1,3,5,3,1,1,10}]$ | 8 | | 61 | $[7; \overline{1,4,3,1,2,2,1,3,4,1,14}]$ | 11 | | 79 | $[8; \overline{1,7,1,16}]$ | 4 | | 94 | $[9; \overline{1,2,3,1,1,5,1,8,1,5,1,1,3,2,1,18}]$ | 16 | (In Lagrange's original layout the table runs in two-row blocks — the upper row gives the partial quotients $\mu, \mu', \mu'', \ldots$ and the lower row gives the corresponding $q, q', q'', \ldots$. See [[square-root-continued-fractions]] for the full table.) For each $N$, the convergents $p/q$ of $\sqrt{N}$ satisfy $p^2 - Nq^2 = \pm 1$ alternately (period odd $\Rightarrow$ both $\pm 1$; period even $\Rightarrow$ only $+1$ at the period boundaries, only $-1$ never), giving direct access to the Pell solutions. --- ## Concept Pages - [[binary-quadratic-forms]] — minimization via $P^k, Q^k$ recursion - [[periodicity-quadratic-irrationals]] — Lagrange's periodicity theorem (Art. 34) - [[square-root-continued-fractions]] — Euler's table from Art. 41 ## Related pages - [[continued-fractions]] — definitions and CF reduction - [[convergents]] — recurrences and identities - [[best-rational-approximations]] — the $|a - p/q|$ form of Lagrange's theorem - [[pell-equation]] — Euler's iterative method (existence proof here in Art. 37) - [[ch2.0.7-pell-equation-method]] — Pell descent in the main text - [[ch2.0.6-integer-solutions-quadratic-squares]] — using Pell to extend solution families - [[add1-continued-fractions]] — the preceding chapter on CF basics