How to Solve Pell's Equation

The Pell equation is the equation x² - Ny² = 1, where “x” and “y” are positive integers and “N” is a given nonzero integer. Solutions in which either “x,” “y,” or “N” are zero, are called trivial solutions to the equation, and are not of much concern to mathematicians. The smallest nontrivial solutions to the equations are called fundamental solutions. The larger solutions can be determined using a pair of simple formulas once the fundamental solution has been found.

Things You'll Need

  • Calculator
Show More

Instructions

    • 1

      Calculate the square root of “N.” The ratio of “x” to “y” in the fundamental solution will be an approximation of the square root of “N”, and the ratios for larger values of “x” and “y” will be increasingly close to the actual square root. If “N” is a perfect square, then the equation can be solved by factoring the equation into (x-my)(x+my)=1, where “m” is the square root of “N.” Solving for this yields another trivial answer, which is not of much concern. If the original equation were x² - 23y² = 1, you would find the square root of 23, which is approximately 4.79583.

    • 2

      Compute the continued fraction equivalent of the square root, until the expansion begins to repeat. A continued fraction is a nested complex fraction preceded by the integer portion of the square root. The fractional part consists of the integer “1” divided by another integer plus one divided by another integer plus one divided by another integer, etc., or A + 1/(B + 1/(C + 1/(D…))), where “A,” “B,” “C,” and “D” are integers. The square root of 23 would be approximated by the continued fraction 4 + 1/(1 + 1/(3 + 1/(1 + 1/(8 + …))), after which the fractions begin to repeat.

    • 3

      Drop the portion of the fraction that begins to repeat, and the last element of the original cycle. In the example above, 1/8 and everything after it would be dropped, leaving 4 + 1/(1 + 1/(3 + 1/1)).

    • 4

      Simplify the fraction. The resulting ratio represents the fundamental solutions for the value of “x” over the value of “y.” The fraction above simplifies to 24/5, so the values of “x” and “y” for x² - 23y² = 1 are 24 and 5, respectively.

Learnify Hub © www.0685.com All Rights Reserved