MathLabs

Grade 10

Indian, Islamic and Chinese mathematics

From Brahmagupta's cyclic-quadrilateral formula S=(s−a)(s−b)(s−c)(s−d)S=\sqrt{(s-a)(s-b)(s-c)(s-d)} and his Pell equation x2−Ny2=1x^2-Ny^2=1, through al-Khwarizmi's algebra and Omar Khayyam's conic solutions of cubics, to Liu Hui's polygon-doubling π\pi and the Chinese remainder theorem.

IntuitionThree Civilizations, One River of Ideas

Between roughly the 3rd and the 13th century, while Europe kept relatively few written mathematical records, three civilizations pushed mathematics forward with remarkably concrete, hands-on methods: Indian astronomer-mathematicians such as Brahmagupta worked out exact formulas for cyclic quadrilaterals and integer solutions of x2−Ny2=1x^2-Ny^2=1; scholars of the Islamic world such as al-Khwarizmi and Omar Khayyam turned ad-hoc tricks into a systematic algebra, solving equations by literally cutting and rearranging squares, or by intersecting curves; and Chinese mathematicians such as Liu Hui and the authors of the Sunzi Suanjing refined π\pi by relentlessly doubling polygons and solved calendar puzzles with what we now call the Chinese remainder theorem.

Unit circle with a draggable angle theta, illustrating the central angle of a regular n-gon used in polygon-doubling approximations of pi.
Inscribe a regular nn-gon in a unit circle: adjacent vertices are separated by the central angle θ=360∘/n\theta=360^\circ/n. Drag θ\theta toward 30∘30^\circ (n=12n=12) and imagine halving it again toward a 2424-gon — the gap between polygon and circle shrinks, which is exactly the geometric idea behind Liu Hui's method for approximating π\pi.

SchoolBrahmagupta's Formula for Cyclic Quadrilaterals

Definition: Cyclic quadrilateral and semiperimeter

A quadrilateral with sides a,b,c,da,b,c,d is cyclic if all four vertices lie on one circle; this forces opposite angles to be supplementary. Its semiperimeter is s=a+b+c+d2s=\dfrac{a+b+c+d}{2}.

s=a+b+c+d2s=\dfrac{a+b+c+d}{2}

Brahmagupta's theorem (Brahmasphutasiddhanta, year 628) states that the area of such a quadrilateral depends only on its four side lengths, exactly as Heron's formula does for a triangle: S=(s−a)(s−b)(s−c)(s−d)S=\sqrt{(s-a)(s-b)(s-c)(s-d)}.

S=(s−a)(s−b)(s−c)(s−d)S=\sqrt{(s-a)(s-b)(s-c)(s-d)}

Where does this come from? Draw diagonal ACAC splitting the quadrilateral into triangles ABCABC (sides a,ba,b) and ACDACD (sides c,dc,d), with angles BB and DD opposite each other. Because opposite angles of a cyclic quadrilateral are supplementary, B+D=180∘B+D=180^\circ, hence cos⁡B=−cos⁡D\cos B=-\cos D. The law of cosines in each triangle gives AC2=a2+b2−2abcos⁡BAC^2=a^2+b^2-2ab\cos B and AC2=c2+d2−2cdcos⁡DAC^2=c^2+d^2-2cd\cos D; substituting cos⁡D=−cos⁡B\cos D=-\cos B into the second and equating both expressions for AC2AC^2 lets you eliminate cos⁡B\cos B in favor of the areas of the two triangles (12absin⁡B\tfrac12 ab\sin B and 12cdsin⁡D\tfrac12 cd\sin D, with sin⁡B=sin⁡D\sin B=\sin D), and after algebraic simplification (completing squares and factoring using s=a+b+c+d2s=\tfrac{a+b+c+d}2) the four separate side lengths collapse into the single symmetric product above.

Liu Hui's polygon-doubling approximation of π\pi (unit circle, r=1r=1)
Sides nnSide length lnl_nEstimate n ln/2n\,l_n/2
61.00003.0000
120.51763.1058
240.26113.1326
480.13083.1394
960.06543.1410

UndergraduatePell's Equation and the Chakravala Method

In the same 628 treatise, Brahmagupta studied what is now called Pell's equation, x2−Ny2=1x^2-Ny^2=1, for a fixed non-square positive integer NN: find integers x,yx,y satisfying it. He discovered the bhavana (composition) identity, letting two solutions be combined into a new one, and centuries later Bhaskara II turned this into the chakravala (cyclic) algorithm: start from a rough solution to x2−Ny2=kx^2-Ny^2=k for some small kk, then repeatedly compose it with a suitably chosen trivial solution to shrink ∣k∣|k| step by step until k=±1k=\pm1, at which point a solution with k=1k=1 is at hand or one more composition step produces it.

x2−Ny2=1x^2-Ny^2=1

Nearly five centuries earlier, Omar Khayyam attacked a different problem: solving cubic equations, which cannot be done with straightedge and compass alone. In his Treatise on Demonstration of Problems of Algebra (c. 1070), he showed that every cubic can be solved by intersecting two conic sections.

Concretely, take the cubic x3+a2x=a2bx^3+a^2x=a^2b with a,b>0a,b>0. Intersect the parabola x2=ayx^2=ay with the circle y2=x(b−x)y^2=x(b-x) (the semicircle of diameter bb sitting on the positive xx-axis, passing through the origin). Substituting y=x2/ay=x^2/a from the parabola into the circle's equation gives (x2/a)2=x(b−x)\left(x^2/a\right)^2=x(b-x), i.e. x4/a2=bx−x2x^4/a^2=bx-x^2; dividing by x≠0x\neq0 and multiplying by a2a^2 recovers exactly x3+a2x=a2bx^3+a^2x=a^2b. So the xx-coordinate of the (non-origin) intersection point is the root — a curve crossing replaces radicals.

Take a=1,b=2a=1,b=2: the cubic x3+x=2x^3+x=2, the parabola x2=yx^2=y, and the circle y2=x(2−x)y^2=x(2-x). They meet (besides the origin) at (1,1)(1,1): indeed y2=1y^2=1 and x(2−x)=1⋅1=1x(2-x)=1\cdot1=1 match, and 13+1=21^3+1=2 checks the cubic directly. Khayyam's construction handles cubics whose roots are irrational just as well — the curves still cross, even when no clean number falls out.

UndergraduateLiu Hui's Polygon-Doubling Algorithm for π\pi

Around 263, commenting on the classic Nine Chapters on the Mathematical Art, Liu Hui inscribed a regular hexagon in a circle of radius rr and repeatedly doubled the number of sides. If lnl_n is the side length of the inscribed regular nn-gon, its apothem (distance from center to a side's midpoint) is r2−(ln/2)2\sqrt{r^2-(l_n/2)^2} by the Pythagorean theorem, and the sagitta — the gap between that midpoint and the circle — is r−r2−(ln/2)2r-\sqrt{r^2-(l_n/2)^2}. Connecting one original vertex to the new vertex sitting on the arc above that gap gives a right triangle, so the doubled side length obeys the recurrence l2n=(ln2)2+(r−r2−(ln2)2)2l_{2n}=\sqrt{\left(\dfrac{l_n}{2}\right)^2+\left(r-\sqrt{r^2-\left(\dfrac{l_n}{2}\right)^2}\right)^2}. Since the nn-gon's perimeter n lnn\,l_n approaches the circle's circumference 2πr2\pi r as nn grows, π≈n ln2r\pi\approx\dfrac{n\,l_n}{2r} gives better and better estimates.

l2n=(ln2)2+(r−r2−(ln2)2)2l_{2n}=\sqrt{\left(\dfrac{l_n}{2}\right)^2+\left(r-\sqrt{r^2-\left(\dfrac{l_n}{2}\right)^2}\right)^2}

Starting from a hexagon (l6=rl_6=r, since a regular hexagon's side equals the radius) and doubling four times to a 96-gon, Liu Hui reached π≈3.14\pi\approx3.14; later, doubling all the way to a 3072-gon, he obtained the celebrated value 3.14163.1416, accurate to four decimal digits — thirteen centuries before pocket calculators.

For b>0b>0 and c>0c>0, the positive solution of x2+bx=cx^2+bx=c is x=c+(b2)2−b2x=\sqrt{c+\left(\dfrac b2\right)^2}-\dfrac b2.

Why is it true?

Al-Khwarizmi (Baghdad, c. 820, in his book Al-Jabr wal-Muqabala — the origin of the word 'algebra') had no negative numbers or symbolic notation, so he solved quadratics by literally drawing squares and rectangles and physically completing a bigger square, a picture that makes the otherwise mysterious formula obvious.

Proof

Draw a square of side xx; its area is x2x^2, the first term of x2+bx=cx^2+bx=c. Attach to two adjacent sides of this square two thin rectangles, each of width b/2b/2 and length xx, so their combined area is 2⋅b2⋅x=bx2\cdot\tfrac b2\cdot x=bx, the second term. The resulting L-shaped figure (a "gnomon") has area x2+bx=cx^2+bx=c.

This gnomon is a big square of side x+b/2x+b/2 with one small b2×b2\tfrac b2\times\tfrac b2 corner square missing. To see this, notice the two rectangles plus the original square leave exactly a (b/2)×(b/2)(b/2)\times(b/2) gap at the outer corner where they meet. Fill that gap in: the whole figure — gnomon plus corner square — is now a genuine square of side x+b/2x+b/2, whose area is therefore c+(b/2)2c+(b/2)^2 (the gnomon's area cc plus the corner square's area (b/2)2(b/2)^2, added exactly once).

So (x+b2)2=c+(b2)2(x+\tfrac b2)^2=c+\left(\tfrac b2\right)^2. Taking the positive square root of both sides (side lengths are positive) gives x+b2=c+(b2)2x+\dfrac b2=\sqrt{c+\left(\dfrac b2\right)^2}, and isolating xx yields x=c+(b2)2−b2x=\sqrt{c+\left(\dfrac b2\right)^2}-\dfrac b2.

Algebraic check: expanding (c+(b/2)2−b/2)2+b(c+(b/2)2−b/2)\left(\sqrt{c+(b/2)^2}-b/2\right)^2+b\left(\sqrt{c+(b/2)^2}-b/2\right) term by term reduces, after the ±bc+(b/2)2 b/2\pm b\sqrt{c+(b/2)^2}\,b/2 cross terms cancel, exactly to cc — confirming the formula independently of the picture. Numerically, for x2+10x=39x^2+10x=39 (so b=10,c=39b=10,c=39): x=39+25−5=64−5=8−5=3x=\sqrt{39+25}-5=\sqrt{64}-5=8-5=3, and indeed 32+10⋅3=9+30=393^2+10\cdot3=9+30=39.

UndergraduateThe Chinese Remainder Theorem

Let m1,m2,…,mkm_1,m_2,\dots,m_k be pairwise coprime positive integers and let a1,…,aka_1,\dots,a_k be any integers. Then the system of congruences x≡ai(modmi)x\equiv a_i\pmod{m_i} for every ii has a solution xx, and this solution is unique modulo M=m1m2⋯mkM=m_1m_2\cdots m_k.

Why is it true?

First recorded around the 3rd–5th century in the Sunzi Suanjing ('the unknown number of things') and given a complete general algorithm by Qin Jiushao in 1247 (Da-yan rule), this theorem says that pairwise-coprime moduli carry independent information: knowing a number's remainder mod 3, mod 5, mod 7 pins it down uniquely mod 105, with no information lost or contradictory, because the moduli never 'overlap'.

Proof

Existence, step 1 (build the pieces): for each ii define Mi=M/miM_i=M/m_i, the product of all moduli except mim_i. Because the mjm_j are pairwise coprime, every prime factor of mim_i is absent from every mjm_j (j≠ij\neq i), so gcd⁡(Mi,mi)=1\gcd(M_i,m_i)=1. By Bezout's identity (extended Euclidean algorithm) there exists an integer yiy_i — the modular inverse of MiM_i mod mim_i — with Miyi≡1(modmi)M_iy_i\equiv1\pmod{m_i}.

Existence, step 2 (assemble the solution): set x=∑i=1kaiMiyi mod Mx=\sum_{i=1}^{k}a_iM_iy_i\bmod M. Fix any index ii and reduce this sum mod mim_i. For every j≠ij\neq i, the factor Mj=M/mjM_j=M/m_j contains mim_i as one of its factors (since i≠ji\neq j), so mi∣Mjm_i\mid M_j and the term ajMjyj≡0(modmi)a_jM_jy_j\equiv0\pmod{m_i}. Only the ii-th term survives: x≡aiMiyi≡ai⋅1=ai(modmi)x\equiv a_iM_iy_i\equiv a_i\cdot1=a_i\pmod{m_i} (using Miyi≡1(modmi)M_iy_i\equiv1\pmod{m_i}). Since ii was arbitrary, xx satisfies every congruence x≡ai(modmi)x\equiv a_i\pmod{m_i} at once.

Uniqueness mod MM: suppose x′x' is another integer satisfying every x≡ai(modmi)x\equiv a_i\pmod{m_i}. Then x−x′≡0(modmi)x-x'\equiv0\pmod{m_i} for every ii, i.e. every mim_i divides x−x′x-x'. Because the mim_i are pairwise coprime, their least common multiple equals their product MM, so M∣(x−x′)M\mid(x-x') as well — any common multiple of pairwise-coprime numbers must already be a multiple of their product. Hence x≡x′(modM)x\equiv x'\pmod M: the solution is unique modulo MM, exactly as claimed.

Toy verification: take m1=3,m2=5m_1=3,m_2=5 with a1=2,a2=3a_1=2,a_2=3, i.e. the system x≡2(mod3), x≡3(mod5)x\equiv2\pmod3,\ x\equiv3\pmod5. Here M=15M=15; M1=5M_1=5 needs 5y1≡1(mod3)5y_1\equiv1\pmod3, i.e. 2y1≡1(mod3)2y_1\equiv1\pmod3, so y1=2y_1=2; M2=3M_2=3 needs 3y2≡1(mod5)3y_2\equiv1\pmod5, so y2=2y_2=2. Then x=2⋅5⋅2+3⋅3⋅2=20+18=38≡8(mod15)x=2\cdot5\cdot2+3\cdot3\cdot2=20+18=38\equiv8\pmod{15}, so x=8x=8. Check: 8=2⋅3+28=2\cdot3+2 leaves remainder 22 mod 33, and 8=1⋅5+38=1\cdot5+3 leaves remainder 33 mod 55 — both congruences hold, confirming the construction.

UndergraduateReal-World Applications and Worked Examples

These are not museum pieces. Sunzi's problem was invented to synchronize calendars: ancient Chinese astronomers tracked several cycles at once (a 60-day sexagenary cycle, planetary periods, lunar months), and the remainder theorem let them pinpoint a date from a handful of remainders instead of counting days one by one — exactly the calendar-and-navigation use case for which it was built. The very same idea now powers modern cryptography: RSA decryption combines a huge modulus n=pqn=pq with the Chinese remainder theorem (the 'CRT-RSA' optimization) to do the modular exponentiation separately mod pp and mod qq — each roughly half the bit-length — and then recombine, which is about four times faster than working mod nn directly.

Example: Brahmagupta's Formula on a Concrete Quadrilateral

A quadrilateral inscribed in a circle has consecutive sides a=3,b=4,c=5,d=6a=3,b=4,c=5,d=6. Find its area.

Solution

Compute the semiperimeter first: s=3+4+5+62=182=9s=\dfrac{3+4+5+6}{2}=\dfrac{18}{2}=9.

Now form each factor s−a,s−b,s−c,s−ds-a,s-b,s-c,s-d: s−a=9−3=6s-a=9-3=6, s−b=9−4=5s-b=9-4=5, s−c=9−5=4s-c=9-5=4, s−d=9−6=3s-d=9-6=3.

Apply Brahmagupta's formula: S=(s−a)(s−b)(s−c)(s−d)=6⋅5⋅4⋅3=360S=\sqrt{(s-a)(s-b)(s-c)(s-d)}=\sqrt{6\cdot5\cdot4\cdot3}=\sqrt{360}.

Simplify the radical: 360=36⋅10360=36\cdot10, so S=36⋅10=610S=\sqrt{36\cdot10}=6\sqrt{10}, approximately 18.9718.97 square units — a single formula that needed no knowledge of the individual angles or diagonals.

Example: Sunzi's Original Remainder Problem

The Sunzi Suanjing (3rd–5th century) poses: find the smallest positive xx with x≡2(mod3), x≡3(mod5), x≡2(mod7)x\equiv2\pmod3,\ x\equiv3\pmod5,\ x\equiv2\pmod7

Solution

The moduli 3,5,73,5,7 are pairwise coprime, so the Chinese remainder theorem applies with M=3⋅5⋅7=105M=3\cdot5\cdot7=105.

Compute each MiM_i and its inverse yiy_i: M1=105/3=35M_1=105/3=35, and 35y1≡1(mod3)35y_1\equiv1\pmod3 means 2y1≡1(mod3)2y_1\equiv1\pmod3 (since 35≡235\equiv2), so y1=2y_1=2 (2⋅2=4≡1(mod3)2\cdot2=4\equiv1\pmod3). Next M2=105/5=21M_2=105/5=21, and 21y2≡1(mod5)21y_2\equiv1\pmod5 means 1⋅y2≡1(mod5)1\cdot y_2\equiv1\pmod5 (since 21≡121\equiv1), so y2=1y_2=1. Finally M3=105/7=15M_3=105/7=15, and 15y3≡1(mod7)15y_3\equiv1\pmod7 means 1⋅y3≡1(mod7)1\cdot y_3\equiv1\pmod7 (since 15≡115\equiv1), so y3=1y_3=1.

Assemble: x=a1M1y1+a2M2y2+a3M3y3=2⋅35⋅2+3⋅21⋅1+2⋅15⋅1=140+63+30=233x=a_1M_1y_1+a_2M_2y_2+a_3M_3y_3=2\cdot35\cdot2+3\cdot21\cdot1+2\cdot15\cdot1=140+63+30=233.

Reduce mod M=105M=105: 233=2⋅105+23233=2\cdot105+23, so 233≡23(mod105)233\equiv23\pmod{105}, giving x=23x=23.

Check all three congruences: 23=7⋅3+223=7\cdot3+2 (remainder 22 mod 33), 23=4⋅5+323=4\cdot5+3 (remainder 33 mod 55), 23=3⋅7+223=3\cdot7+2 (remainder 22 mod 77) — all match, and since 23<10523<105 it is the smallest positive solution.

A cyclic quadrilateral has sides 3,4,5,63,4,5,6. Using Brahmagupta's formula S=(s−a)(s−b)(s−c)(s−d)S=\sqrt{(s-a)(s-b)(s-c)(s-d)}, what is its area?

Which equation, studied by Brahmagupta in 628 and later solved algorithmically by the chakravala method, is now called Pell's equation?

In his Treatise on Demonstration of Problems of Algebra, Omar Khayyam solved cubic equations geometrically by intersecting which two curves?

Sunzi's remainder problem was invented for calendar and astronomical calculations; the same Chinese remainder theorem speeds up modern RSA decryption mainly by...

References

  1. Victor J. Katz (2009). A History of Mathematics: An Introduction
  2. Oliver Knill (2012). A Multivariable Chinese Remainder Theorem · arXiv:1206.5114