Supriya Ghosh (Editor)

Chakravala method

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

The chakravala method (Sanskrit: चक्रवाल विधि) is a cyclic algorithm to solve indeterminate quadratic equations, including Pell's equation. It is commonly attributed to Bhāskara II, (c. 1114 – 1185 CE) although some attribute it to Jayadeva (c. 950 ~ 1000 CE). Jayadeva pointed out that Brahmagupta's approach to solving equations of this type could be generalized, and he then described this general method, which was later refined by Bhāskara II in his Bijaganita treatise. He called it the Chakravala method: chakra meaning "wheel" in Sanskrit, a reference to the cyclic nature of the algorithm. C.-O. Selenius held that no European performances at the time of Bhāskara, nor much later, exceeded its marvellous height of mathematical complexity.

Contents

This method is also known as the cyclic method and contains traces of mathematical induction.

History

Chakra in Sanskrit means cycle. As per popular legend, Chakravala indicates a mythical range of mountains which orbits around the earth like a wall and not limited by light and darkness.

Brahmagupta in 628 CE studied indeterminate quadratic equations, including Pell's equation

x 2 = N y 2 + 1 ,

for minimum integers x and y. Brahmagupta could solve it for several N, but not all.

Jayadeva (9th century) and Bhaskara (12th century) offered the first complete solution to the equation, using the chakravala method to find for x 2 = 61 y 2 + 1 , the solution

x = 1766319049 , y = 226153980.

This case was notorious for its difficulty, and was first solved in Europe by Brouncker in 1657–58 in response to a challenge by Fermat, using continued fractions. A method for the general problem was first completely described rigorously by Lagrange in 1766. Lagrange's method, however, requires the calculation of 21 successive convergents of the continued fraction for the square root of 61, while the chakravala method is much simpler. Selenius, in his assessment of the chakravala method, states

"The method represents a best approximation algorithm of minimal length that, owing to several minimization properties, with minimal effort and avoiding large numbers automatically produces the best solutions to the equation. The chakravala method anticipated the European methods by more than a thousand years. But no European performances in the whole field of algebra at a time much later than Bhaskara's, nay nearly equal up to our times, equalled the marvellous complexity and ingenuity of chakravala."

Hermann Hankel calls the chakravala method

"the finest thing achieved in the theory of numbers before Lagrange."

The method

From Brahmagupta's identity, we observe that for given N,

( x 1 2 N y 1 2 ) ( x 2 2 N y 2 2 ) = ( x 1 x 2 + N y 1 y 2 ) 2 N ( x 1 y 2 + x 2 y 1 ) 2

For the equation x 2 N y 2 = k , this allows the "composition" (samāsa) of two solution triples ( x 1 , y 1 , k 1 ) and ( x 2 , y 2 , k 2 ) into a new triple

( x 1 x 2 + N y 1 y 2 , x 1 y 2 + x 2 y 1 , k 1 k 2 ) .

In the general method, the main idea is that any triple ( a , b , k ) (that is, one which satisfies a 2 N b 2 = k ) can be composed with the trivial triple ( m , 1 , m 2 N ) to get the new triple ( a m + N b , a + b m , k ( m 2 N ) ) for any m. Assuming we started with a triple for which gcd ( a , b ) = 1 , this can be scaled down by k (this is Bhaskara's lemma):

a 2 N b 2 = k ( a m + N b k ) 2 N ( a + b m k ) 2 = m 2 N k

Since the signs inside the squares do not matter, the following substitutions are possible:

a a m + N b | k | , b a + b m | k | , k m 2 N k

When a positive integer m is chosen so that (a + bm)/k is an integer, so are the other two numbers in the triple. Among such m, the method chooses one that minimizes the absolute value of m2 − N and hence that of (m2 − N)/k. Then the substitution relations are applied for m equal to the chosen value. This results in a new triple (a, b, k). The process is repeated until a triple with k = 1 is found. This method always terminates with a solution (proved by Lagrange in 1768). Optionally, we can stop when k is ±1, ±2, or ±4, as Brahmagupta's approach gives a solution for those cases.

n = 61

The n = 61 case (determining an integer solution satisfying a 2 61 b 2 = 1 ), issued as a challenge by Fermat many centuries later, was given by Bhaskara as an example.

We start with a solution a 2 61 b 2 = k for any k found by any means. In this case we can let b be 1, thus, since 8 2 61 1 2 = 3 , we have the triple ( a , b , k ) = ( 8 , 1 , 3 ) . Composing it with ( m , 1 , m 2 61 ) gives the triple ( 8 m + 61 , 8 + m , 3 ( m 2 61 ) ) , which is scaled down (or Bhaskara's lemma is directly used) to get:

( 8 m + 61 3 , 8 + m 3 , m 2 61 3 ) .

For 3 to divide 8 + m and | m 2 61 | to be minimal, we choose m = 7 , so that we have the triple ( 39 , 5 , 4 ) . Now that k is −4, we can use Brahmagupta's idea: it can be scaled down to the rational solution ( 39 / 2 , 5 / 2 , 1 ) , which composed with itself three times, with m = 7 , 11 , 9 respectively, when k becomes square and scaling can be applied, this gives ( 1523 / 2 , 195 / 2 , 1 ) . Finally, such procedure can be repeated until the solution is found (requiring 9 additional self-compositions and 4 additional square-scalings): ( 1766319049 , 226153980 , 1 ) . This is the minimal integer solution.

n = 67

Suppose we are to solve x 2 67 y 2 = 1 for x and y.

We start with a solution a 2 67 b 2 = k for any k found by any means; in this case we can let b be 1, thus producing 8 2 67 1 2 = 3 . At each step, we find an m > 0 such that k divides a + bm, and |m2 − 67| is minimal. We then update a, b, and k to a m + N b | k | , a + b m | k | ,  and  m 2 N k respectively.

First iteration

We have ( a , b , k ) = ( 8 , 1 , 3 ) . We want a positive integer m such that k divides a + bm, i.e. 3 divides 8 + m, and |m2 − 67| is minimal. The first condition implies that m is of the form 3t + 1 (i.e. 1, 4, 7, 10,… etc.), and among such m, the minimal value is attained for m = 7. Replacing (abk) with ( a m + N b | k | , a + b m | k | , m 2 N k ) , we get the new values a = ( 8 7 + 67 1 ) / 3 = 41 , b = ( 8 + 1 7 ) / 3 = 5 , k = ( 7 2 67 ) / ( 3 ) = 6 . That is, we have the new solution:

41 2 67 ( 5 ) 2 = 6.

At this point, one round of the cyclic algorithm is complete.

Second iteration

We now repeat the process. We have ( a , b , k ) = ( 41 , 5 , 6 ) . We want an m > 0 such that k divides a + bm, i.e. 6 divides 41 + 5m, and |m2 − 67| is minimal. The first condition implies that m is of the form 6t + 5 (i.e. 5, 11, 17,… etc.), and among such m, |m2 − 67| is minimal for m = 5. This leads to the new solution a = (41⋅5 + 67⋅5)/6, etc.:

90 2 67 11 2 = 7.
Third iteration

For 7 to divide 90 + 11m, we must have m = 2 + 7t (i.e. 2, 9, 16,… etc.) and among such m, we pick m = 9.

221 2 67 27 2 = 2.
Final solution

At this point, we could continue with the cyclic method (and it would end, after seven iterations), but since the right-hand side is among ±1, ±2, ±4, we can also use Brahmagupta's observation directly. Composing the triple (221, 27, −2) with itself, we get

( 221 2 + 67 27 2 2 ) 2 67 ( 221 27 ) 2 = 1 ,

that is, we have the integer solution:

48842 2 67 5967 2 = 1.

This equation approximates 67 as 48842 5967 to within a margin of about 2 × 10 9 .

References

Chakravala method Wikipedia