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. 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
x2=Ny2+1, for minimum integers x and y. Brahmagupta could solve it for several N, but not all. Jayadeva and Bhaskara offered the first complete solution to the equation, using the chakravala method to find for x2=61y2+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 10 iterations (not the 21 often claimed, since 10 iterations gives the solution 297182=61∗38052−1, which can be squared to eliminate the remaining 11 iterations) for successive convergents of the simple 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,
(x1x2+Ny1y2)2−N(x1y2+x2y1)2=(x12−Ny12)(x22−Ny22) For the equation x2−Ny2=k, this allows the "composition" (samāsa) of two solution triples (x1,y1,k1) and (x2,y2,k2) into a new triple
(x1x2+Ny1y2,x1y2+x2y1,k1k2). In the general method, the main idea is that any triple (a,b,k) (that is, one which satisfies a2−Nb2=k) can be composed with the trivial triple (m,1,m2−N) to get the new triple (am+Nb,a+bm,k(m2−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):
a2−Nb2=k⇒(am+Nbk)2−N(a+bmk)2=m2−Nk Since the signs inside the squares do not matter, the following substitutions are possible:
a←am+Nb|k|,b←a+bm|k|,k←m2−Nk 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, as 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.
Brahmagupta's composition method In AD 628, Brahmagupta discovered a general way to find x and y of x2=Ny2+1, when given a2=Nb2+k, when k is ±1, ±2, or ±4.
k = ±1 Using Brahmagupta's identity to compose the triple (a,b,k) with itself:
(a2+Nb2)2−N(2ab)2=k2 ⇒ (2a2−k)2−N(2ab)2=k2 The new triple can be expressed as (2a2−k,2ab,k2). Substituting k=−1 gives a solution:
x=2a2+1,y=2ab For k=1, the original (a,b) was already a solution. Substituting k=1 yields a second:
x=2a2−1,y=2ab
k = ±2 Again using the equation, (2a2−k)2−N(2ab)2=k2⇒(2a2−kk)2−N(2abk)2=1 Substituting k=2,
x=a2−1,y=ab Substituting k=−2,
x=a2+1,y=ab
k = 4 Substituting k=4 into the equation (2a2−kk)2−N(2abk)2=1 creates the triple (a2−22,ab2,1), which is a solution if a is even:
x=a2−22,y=ab2. If a is odd, start with the equations (a2)2−N(b2)2=1 and (2a2−44)2−N(2ab4)2=1. Leading to the triples (a2,b2,1) and (a2−22,ab2,1). Composing the triples gives (a2(a2−3))2−N(b2(a2−1))2=1 When a is odd,
x=a2(a2−3),y=b2(a2−1)
k = −4 When k=−4, then (a2)2−N(b2)2=−1. Composing with itself yields (a2+Nb24)2−N(ab2)2=1⇒(a2+22)2−N(ab2)2=1. Again composing itself yields ((a2+2)2+Na2b24)2−N(ab(a2+2)2)2=1⇒ (a4+4a2+22)2−N(ab(a2+2)2)2=1 Finally, from the earlier equations, compose the triples (a2+22,ab2,1) and (a4+4a2+22,ab(a2+2)2,1), to get
((a2+2)(a4+4a2+2)+Na2b2(a2+2)4)2−N(ab(a4+4a2+3)2)2=1⇒ ((a2+2)(a4+4a2+1)2)2−N(ab(a2+3)(a2+1)2)2=1⇒((a2+2)[(a2+1)(a2+3)−2)]2)2−N(ab(a2+3)(a2+1)2)2=1. This gives us the solutions
x=(a2+2)[(a2+1)(a2+3)−2]2,y=ab(a2+3)(a2+1)2 (Note, k=−4 is useful to find a solution to Pell's Equation, but it is not always the smallest integer pair. e.g. 362−52⋅52=−4. The equation will give you x=1093435849,y=151632270, which when put into Pell's Equation yields 1195601955878350801−1195601955878350800=1, which works, but so does x=649,y=90 for N=52.
Examples
n = 61 The n = 61 case (determining an integer solution satisfying a2−61b2=1), issued as a challenge by Fermat many centuries later, was given by Bhaskara as an example. We start with a solution a2−61b2=k for any k found by any means. In this case we can let b be 1, thus, since 82−61⋅12=3, we have the triple (a,b,k)=(8,1,3). Composing it with (m,1,m2−61) gives the triple (8m+61,8+m,3(m2−61)), which is scaled down (or Bhaskara's lemma is directly used) to get:
… excerpt ends here. Continue reading the full article.