info prev up next book cdrom email home

Diophantine Equation--Quadratic

An equation of the form

\begin{displaymath}
x^2-Dy^2=1,
\end{displaymath} (1)

where $D$ is an Integer is called a Pell Equation. Pell equations, as well as the analogous equation with a minus sign on the right, can be solved by finding the Continued Fraction for $\sqrt{D}$. (The trivial solution $x=1$, $y=0$ is ignored in all subsequent discussion.) Let $p_n/q_n$ denote the $n$th Convergent $[a_0, a_1, \dots, a_n]$, then we are looking for a convergent which obeys the identity
\begin{displaymath}
{p_n}^2-D{q_n}^2=(-1)^{n-1},
\end{displaymath} (2)

which turns out to always be possible since the Continued Fraction of a Quadratic Surd always becomes periodic at some term $a_{r+1}$, where $a_{r+1}=2a_0$, i.e.,
\begin{displaymath}
\sqrt{D}=[a_0, \overline{a_1, \ldots, a_r, 2a_0}\,].
\end{displaymath} (3)


If $r$ is Odd, then $(-1)^{r-1}$ is Positive and the solution in terms of smallest Integers is $x=p_r$ and $y=q_r$, where $p_r/q_r$ is the $r$th Convergent. If $r$ is Even, then $(-1)^{r-1}$ is Negative, but

\begin{displaymath}
{p_{2r+1}}^2-D{q_{2r+1}}^2=1,
\end{displaymath} (4)

so the solution in smallest Integers is $x=p_{2r+1}$, $y=q_{2r+1}$. Summarizing,
\begin{displaymath}
(x,y)=\cases{
(p_r,q_r) & for $r$\ odd\cr
(p_{2r+1},p_{2r+1}) & for $r$\ even.\cr}
\end{displaymath} (5)


The more complicated equation

\begin{displaymath}
x^2-Dy^2=\pm c
\end{displaymath} (6)

can also be solved for certain values of $c$ and $D$, but the procedure is more complicated (Chrystal 1961). However, if a single solution to the above equation is known, other solutions can be found. Let $p$ and $q$ be solutions to (6), and $r$ and $s$ solutions to the ``unit'' form. Then
\begin{displaymath}
(p^2-Dq^2)(r^2-Ds^2)=\pm c
\end{displaymath} (7)


\begin{displaymath}
(pr\pm Dqs)^2-D(ps\pm qr)^2=\pm c.
\end{displaymath} (8)


Call a Diophantine equation consisting of finding $m$ Powers equal to a sum of $n$ equal Powers an ``$m-n$ equation.'' The 2-1 equation

\begin{displaymath}
A^2=B^2+C^2,
\end{displaymath} (9)

which corresponds to finding a Pythagorean Triple ($A$, $B$, $C$) has a well-known general solution (Dickson 1966, pp. 165-170). To solve the equation, note that every Prime of the form $4x+1$ can be expressed as the sum of two Relatively Prime squares in exactly one way. To find in how many ways a general number $m$ can be expressed as a sum of two squares, factor it as follows
\begin{displaymath}
m=2^{a_0}{p_1}^{2a_1}\cdots{p_n}^{2a_n}{q_1}^{b_1}\cdots {q_r}^{b_r},
\end{displaymath} (10)

where the $p$s are primes of the form $4x-1$ and the $q$s are primes of the form $x+1$. If the $a$s are integral, then define
\begin{displaymath}
B\equiv (2b_1+1)(2b_2+1)\cdots(2b_r+1)-1.
\end{displaymath} (11)

Then $m$ is a sum of two unequal squares in
\begin{displaymath}
N(m)=\cases{
0\cr
\quad{\rm for\ any\ } a_i \hbox{ half-int...
...
\quad{\rm for\ all\ } a_i {\rm\ integral}, B {\rm\ even}.\cr}
\end{displaymath} (12)


If zero is counted as a square, both Positive and Negative numbers are included, and the order of the two squares is distinguished, Jacobi showed that the number of ways a number can be written as the sum of two squares is four times the excess of the number of Divisors of the form $4x+1$ over the number of Divisors of the form $4x-1$.


A set of Integers satisfying the 3-1 equation

\begin{displaymath}
A^2+B^2+C^2=D^2
\end{displaymath} (13)

is called a Pythagorean Quadruple. Parametric solutions to the 2-2 equation
\begin{displaymath}
A^2+B^2=C^2+D^2
\end{displaymath} (14)

are known (Dickson 1966; Guy 1994, p. 140).


Solutions to an equation of the form

\begin{displaymath}
(A^2+B^2)(C^2+D^2)=E^2+F^2
\end{displaymath} (15)

are given by the Fibonacci Identity
\begin{displaymath}
(a^2+b^2)(c^2+d^2)=(ac\pm bd)^2+(bc\mp ad)^2\equiv e^2+f^2.
\end{displaymath} (16)

Another similar identity is the Euler Four-Square Identity


\begin{displaymath}
({a_1}^2+{a_2}^2)({b_1}^2+{b_2}^2)({c_1}^2+{c_2}^2)({d_1}^2+{d_2}^2) = {e_1}^2+{e_2}^2+{e_3}^2+{e_4}^2
\end{displaymath} (17)

$({a_1}^2+{a_2}^2+{a_3}^2+{a_4}^2)({b_1}^2+{b_2}^2+{b_3}^2+{b_4}^2)$
$=(a_1b_1-a_2b_2-a_3b_3-a_4b_4)^2$
$\phantom{=}+(a_1b_2+a_2b_1+a_3b_4-a_4b_3)^2$
$\phantom{=}+(a_1b_3-a_2b_4+a_3b_1+a_4b_2)^2$
$\phantom{=}+(a_1b_4+a_2b_3-a_3b_2+a_4b_1)^2.$ (18)
Degen's eight-square identity holds for eight squares, but no other number, as proved by Cayley. The two-square identity underlies much of Trigonometry, the four-square identity some of Quaternions, and the eight-square identity, the Cayley Algebra (a noncommutative nonassociative algebra; Bell 1945).

Ramanujan's Square Equation

\begin{displaymath}
2^n-7=x^2
\end{displaymath} (19)

has been proved to have only solutions $n=3$, 4, 5, 7, and 15 (Beeler et al. 1972, Item 31).

See also Algebra, Cannonball Problem, Continued Fraction, Fermat Difference Equation, Lagrange Number (Diophantine Equation), Pell Equation, Pythagorean Quadruple, Pythagorean Triple, Quadratic Residue


References

Beeler, M.; Gosper, R. W.; and Schroeppel, R. HAKMEM. Cambridge, MA: MIT Artificial Intelligence Laboratory, Memo AIM-239, Feb. 1972.

Beiler, A. H. ``The Pellian.'' Ch. 22 in Recreations in the Theory of Numbers: The Queen of Mathematics Entertains. New York: Dover, pp. 248-268, 1966.

Bell, E. T. The Development of Mathematics, 2nd ed. New York: McGraw-Hill, p. 159, 1945.

Chrystal, G. Textbook of Algebra, 2 vols. New York: Chelsea, 1961.

Degan, C. F. Canon Pellianus. Copenhagen, Denmark, 1817.

Dickson, L. E. ``Number of Representations as a Sum of 5, 6, 7, or 8 Squares.'' Ch. 13 in Studies in the Theory of Numbers. Chicago, IL: University of Chicago Press, 1930.

Dickson, L. E. History of the Theory of Numbers, Vol. 2: Diophantine Analysis. New York: Chelsea, 1966.

Guy, R. K. Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, 1994.

Lam, T. Y. The Algebraic Theory of Quadratic Forms. Reading, MA: W. A. Benjamin, 1973.

Rajwade, A. R. Squares. Cambridge, England: Cambridge University Press, 1993.

Scharlau, W. Quadratic and Hermitian Forms. Berlin: Springer-Verlag, 1985.

Shapiro, D. B. ``Products of Sums and Squares.'' Expo. Math. 2, 235-261, 1984.

Smarandache, F. ``Un metodo de resolucion de la ecuacion diofantica.'' Gaz. Math. 1, 151-157, 1988.

Smarandache, F. ``Method to Solve the Diophantine Equation $ax^2-by^2+c=0$.'' In Collected Papers, Vol. 1. Bucharest, Romania: Tempus, 1996.

Taussky, O. ``Sums of Squares.'' Amer. Math. Monthly 77, 805-830, 1970.

Whitford, E. E. Pell Equation. New York: Columbia University Press, 1912.



info prev up next book cdrom email home

© 1996-9 Eric W. Weisstein
1999-05-24