Skip to content

← Math Further 9–12

How Did Madhava Find π Without a Calculator?

Topic 37 · Grades 9–12 · Infinite series for π

What this builds on from class
In this unit 8 sections
  1. Try it: a sum in no hurry
  2. Madhava’s trick at the end
  3. Where does the sum come from?
  4. A faster road: the √12 series
  5. A story from maths
  6. Where this is used
  7. Questions
  8. Where to go next

Kerala, on India’s southwest coast, around the year 1400. An astronomer named Madhava wants the distance around a circle to more decimals than anyone has ever known. He has no calculator, books in his part of the world are written on dried palm leaves, and he works with numbers that run to a dozen digits. His tools are a circle, a square and an idea: add up an endless list of fractions.

Here is the most famous of his sums. Start at 1, take away a third, add a fifth, take away a seventh, add a ninth, and keep going, the odd numbers one after another, for ever:

1−13+15−17+19−⋯ 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \frac{1}{9} - \cdots

Multiply the total by 4, and out comes π, the number you use for every circle: 3.14159… Nothing about circles appears in it, only odd numbers. Before you try it, guess how well it works.

Guess first. You add up the first 100 fractions of this sum and multiply by 4. How many decimals of π (3.14159…) come out right?

Pick an answer to see why.

Try it

Add Madhava’s fractions

Press +1 term and watch the total jump over π and back. Then press × 10 terms again and again: what does each new decimal cost? Then try Simple correction and Madhava’s best, on the same fractions.

π+1−1Totals up to term 5
Terms
5
Value
3.339682539682540
Decimals right
0

Each new term jumps the total across π, a little less each time. A hundred terms get one decimal right; a million get only five.

Try it: a sum in no hurry

Here are the first few totals, each already multiplied by 4:

Terms added Total × 4 Above or below π?
1 4 above
2 2.667 below
3 3.467 above
4 2.895 below
5 3.340 above

Each new term jumps the total across π, a little less far each time: the next term is 4/11 = 0.364, then 4/13 = 0.308. So π is always trapped between two totals in a row. That already tells you something useful: after any number of terms, π lies between the last total and the one before.

Now look at how far off the total is, as the widget showed:

Terms added Total × 4 How far from π
10 3.0418396… 0.0998
100 3.1315929… 0.0100
1,000 3.1405926… 0.0010
10,000 3.1414926… 0.0001

The pattern is very clean: after n terms, the total is off by almost exactly 1/n. Ten times as many terms buys one more decimal, no more. So for ten decimals, the gap must be under 0.00000000005, which needs about 20,000,000,000 terms: twenty billion fractions. Adding one a second, day and night, would take more than six hundred years. Madhava found π to eleven decimals in his lifetime, so he cannot have done it this way.

After 1,000,000 terms (a million), about how far is the total from π?

Pick an answer to see why.

Madhava’s trick at the end

Look again at the zigzag. The totals jump above π, then below, then above, and π sits somewhere between the last two. Where, exactly? If you knew that, you could stop early and correct the total instead of adding billions more terms.

A first guess: π is about halfway between two totals in a row. After 4 terms the total is 2.8952 and the next would be 3.3397; halfway is 3.1175. That is better than either, but only the 3.1 is right.

Madhava’s simplest rule, a step in the Kerala books’ argument, is a little different and much better. In the times-4 form of the sum:

Stop after any odd number, call it p. Take the even number just after it, p + 1. Add 2 ÷ (p + 1) if your last term was taken away, or subtract it if your last term was added.

After 4 terms the last odd number is 7, so p + 1 = 8 and the last term (1/7) was taken away. Add 2/8:

2.8952+0.25=3.1452 2.8952 + 0.25 = 3.1452

Two decimals right, from four fractions, as good as a thousand terms without the trick. After 10 terms the same rule gives 3.14184, three decimals; after 100 terms, six.

Why the even number?

Here is an argument, the kind Madhava’s followers may have used (historians aren’t sure). Call the leftover the amount the total still has to move to reach π. Stop at two odd numbers in a row, say just before 7 and just after it. The two leftovers point in opposite directions, and together they make up the one jump between them: the term with 7, 4/7. So

leftover before 7 + leftover after 7 = 4/7.

The leftovers change only slowly from one stopping place to the next, so each is about half of 4/7. Better still, each leftover belongs to a gap between two odd numbers: the gap after 5 is centered on 6, the gap after 7 on 8. Give each gap the value 2 ÷ (its even number), and the two add to 2/6 + 2/8 = 0.583, very close to 4/7 = 0.571. That is Madhava’s rule: the leftover after the odd number p is about 2 ÷ (p + 1).

The idea of correcting the end of a sum is called an end correction, antya-samskara in the Kerala books. Madhava did not stop at one. Three are credited to him, each sharper than the last. Written for the plain sum (without the 4), after n terms:

Correction After 10 terms, π comes out as Decimals right
none 3.0418396… 0
14n \frac{1}{4n} (the simple one) 3.1418396… 3
n4n2+1 \frac{n}{4n^2 + 1} 3.1415902… 5
n2+14n3+5n \frac{n^2 + 1}{4n^3 + 5n} (the best) 3.1415927… 6

(The first one is the even-number rule again: with n terms the last odd number is 2n − 1, so the even number after it is 2n, and 2 ÷ 2n = 4 × 1/(4n).) With the best correction, 75 terms give π to thirteen decimals. Nobody knows how the third one was found: the books state it, but don’t say how.

After 5 terms the total × 4 is 3.3397, and the last term, 4/9, was added. What does the simple correction give?

Pick an answer to see why.

Where does the sum come from?

Now the real puzzle. Why should odd numbers have anything to do with circles? The Kerala proof, as Jyeshthadeva, three generations of teachers after Madhava, wrote it down in his book Yuktibhasha (between about 1530 and 1550: sources differ), uses only a square, Pythagoras’ theorem, similar triangles and the sum of a geometric series. Here it is.

Take a circle of radius 1, centered at O. Its circumference is 2π, so an eighth of it, the arc from straight across to the diagonal of a square, is 2π ÷ 8 = π/4. That arc is what we will measure.

Draw the square OABC with side 1, O at one corner and A at the end of the radius. Cut the side AB into n equal steps, each 1/n long, and draw lines from O to every cut point. They slice the eighth of a circle into n pieces, one piece per step.

Try it

Slice the eighth of a circle

Move the slider to cut the side into more steps, and tap a slice to see its estimate (from the rule below) against its real length. Watch the total, times 4, as the pieces get thinner.

OABt = 0t = 1Side 1, cut into 4 steps of 1/4
Piece 2: t = 2/4
estimate 0.2000 · real 0.2187
All estimates added, × 4
2.8812 (π = 3.1416)

Each estimate needs one number, t: 1/n divided by 1 + t². More pieces, closer to π.

One piece, measured

Every step on the side is the same length, but the pieces of arc are not: the steps near A make long pieces, those near B, farther from O, make short ones. How short? Take one step, from the cut point P₁ down to P₂, and call its length δ (it is 1/n). The figure shows it.

OAP1​P2​BEFDG1δOne step δ of the side gives the piece EG.
Figure 37.1 One step δ on the side of the square, and the piece of arc EG it cuts off. EF and P₁D are drawn at right angles to the line OP₂. The small purple triangle OEF has the same shape as the bigger triangle OP₁D around it (dashed purple), and the amber triangle P₁P₂D has the same shape as the dashed triangle OP₂A.

Two pairs of similar triangles do all the work.

  1. Triangles P₁P₂D and OP₂A both have a right angle (at D and at A) and share the angle at P₂, so they are similar. Matching sides: P₁D ÷ P₁P₂ = OA ÷ OP₂, so P1D=δ÷OP2 P_1D = \delta \div OP_2 (since OA = 1).
  2. Triangles OEF and OP₁D both have a right angle (at F and at D) and share the angle at O, so they are similar. Matching sides: EF ÷ OE = P₁D ÷ OP₁, and OE = 1, so EF = P₁D ÷ OP₁.

Put them together: EF=δ÷(OP1×OP2) EF = \delta \div (OP_1 \times OP_2) . When the steps are thin, EF is almost the piece of arc EG, and OP₁ and OP₂ are almost equal, so their product is almost OP2 2 OP_2^{\,2} . By Pythagoras, OP2 2=1+t2 OP_2^{\,2} = 1 + t^2 , where t is the distance from A down to P₂. So each piece is about

piece≈1/n1+t2,t=1n,2n,…,nn. \text{piece} \approx \frac{1/n}{1 + t^2}, \qquad t = \frac{1}{n}, \frac{2}{n}, \ldots, \frac{n}{n}.

That is what the widget’s estimate does. With 4 slices, the four estimates add up to 0.7203, and times 4 that is 2.881; with 40 slices, 3.116. The estimates fall a little short, because each piece uses the farther cut point, where 1 + t² is biggest. But the shortfall shrinks as the slices get thinner, and the total heads for π/4. So far this is just a way of measuring the arc very finely. The next step turns it into the sum of odd fractions.

A geometric series inside every piece

Dividing by 1 + t² is awkward. The Kerala trick is to turn it into adding and subtracting powers of t. Look at

1−t2+t4−t6+⋯ 1 - t^2 + t^4 - t^6 + \cdots

It is a geometric series: first term 1, each term the last one times −t2 -t^2 . You met its sum in Grade 10: the first k terms add up to

1−(−t2)k1−(−t2)=1−(−t2)k1+t2. \frac{1 - (-t^2)^k}{1 - (-t^2)} = \frac{1 - (-t^2)^k}{1 + t^2}.

When t is less than 1, (−t2)k (-t^2)^k shrinks towards 0 as k grows, and the sum settles at exactly 11+t2 \frac{1}{1 + t^2} . Check with t = 1/2: 1 ÷ 1.25 = 0.8, and 1 − 0.25 + 0.0625 − 0.015625 = 0.796875, closing in on 0.8. Jyeshthadeva gets the same series a different way, by writing 1/(1 + x) inside itself again and again: 11+x=1−x⋅11+x=1−x(1−x⋅11+x)=⋯ \frac{1}{1+x} = 1 - x \cdot \frac{1}{1+x} = 1 - x\left(1 - x \cdot \frac{1}{1+x}\right) = \cdots

So each piece is about 1n(1−t2+t4−⋯ ) \frac{1}{n}\left(1 - t^2 + t^4 - \cdots\right) . Now add up all n pieces, one column at a time.

  • The 1s: n of them, times 1/n, give 1.
  • The t²s: 1n(12n2+22n2+⋯+n2n2)=12+22+⋯+n2n3 \frac{1}{n}\left(\frac{1^2}{n^2} + \frac{2^2}{n^2} + \cdots + \frac{n^2}{n^2}\right) = \frac{1^2 + 2^2 + \cdots + n^2}{n^3} .
  • The t⁴s: 14+24+⋯+n4n5 \frac{1^4 + 2^4 + \cdots + n^4}{n^5} , and so on.

The sums of powers

What do those fractions come to when n is large? Try them:

n 1+2+⋯+nn2 \frac{1 + 2 + \cdots + n}{n^2} 12+22+⋯+n2n3 \frac{1^2 + 2^2 + \cdots + n^2}{n^3} 14+24+⋯+n4n5 \frac{1^4 + 2^4 + \cdots + n^4}{n^5}
10 0.55 0.385 0.25333
100 0.505 0.33835 0.20503
1,000 0.5005 0.33383 0.20050

They head for 1/2, 1/3 and 1/5. In general, **1ᵐ + 2ᵐ + ⋯ + nᵐ is close to nm+1m+1 \frac{n^{m+1}}{m+1} when n is large.** For squares you can see it exactly from the formula 12+22+⋯+n2=n(n+1)(2n+1)6 1^2 + 2^2 + \cdots + n^2 = \frac{n(n+1)(2n+1)}{6} : divided by n³ it is 16(1+1n)(2+1n) \frac{1}{6}\left(1 + \frac{1}{n}\right)\left(2 + \frac{1}{n}\right) , which goes to 2/6 = 1/3. The Yuktibhasha proves the general rule one power at a time, each from the one before; here we check only the squares.

Put them in the columns, and as the slices get thinner and thinner:

π4=1−13+15−17+⋯ \frac{\pi}{4} = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \cdots

The odd numbers are the 1, 3, 5, 7 under the powers: the sum of the m-th powers brings a 1/(m + 1), and only even powers of t appear. This is the Madhava–Leibniz series. It is an infinite series: a sum with endless terms whose totals settle on a definite number.

A faster road: the √12 series

The sum for π/4 is slow because it uses the arc up to t = 1, where the powers of t don’t shrink at all. Madhava’s second series uses a shorter arc where they do.

Measure a twelfth of the circle instead, the arc of 30°. For 30°, the side of the triangle opposite the angle is tan⁡30∘=13 \tan 30^\circ = \frac{1}{\sqrt 3} , so the same slicing runs only from t = 0 to t = 1/√3, and each power of t² is a third of the one before. The same steps give an arc of π/6, and multiplying by 6 (and tidying 63 \frac{6}{\sqrt 3} into 12 \sqrt{12} ):

π=12(1−13×3+15×32−17×33+⋯ ) \pi = \sqrt{12}\left(1 - \frac{1}{3 \times 3} + \frac{1}{5 \times 3^2} - \frac{1}{7 \times 3^3} + \cdots\right)

Each term is less than a third of the one before, so each one gains about half a decimal:

Terms Total Decimals right
1 3.4641016… 0
2 3.0792014… 0
5 3.1426047… 2
10 3.1415905… 5
21 3.14159265359563… 10

Twenty-one terms give ten decimals, against twenty billion for the first series. Madhava’s value of π, as his followers recorded it, is 3.14159265359: π correctly rounded to eleven decimals, more than anyone before him (in 1424, al-Kashi in Samarkand reached sixteen). (The √12 at the front has to be worked out to as many decimals first, by hand, which is itself a long job.)

Twist: a slow sum with a hidden pattern

The first series is slow, but it hides something strange. Add up exactly 5,000,000 terms, multiply by 4, and compare with π, to 40 decimals:

π 3.1415926535 8979323846 2643383279 5028841971
5,000,000 terms 3.1415924535 8979323846 4643383279 5027841971

The gap rule says it should be off by 1/5,000,000, and it is: the 7th decimal is wrong. But then the digits come back right for thirteen places, then one is wrong again, then twelve more are right. Why? Because the leftover is almost exactly Madhava’s simple correction, 4 × 1/(4n) = 1/5,000,000 = 0.0000002, a number with a single non-zero digit, and what is left after that is tinier still and also “round”. The wrong digits can be predicted exactly, from a famous list of numbers called the Euler numbers; in 1992 Jonathan Borwein and Mark Limber used them to get π to 5,263 decimals out of this slow sum.

A story from maths

Two long, narrow palm leaves tied together with string, covered in rows of small handwritten Malayalam script
Figure 37.2 Palm-leaf pages of the Yuktibhasha, the Kerala school’s book of proofs, written in Malayalam. Photo: Jyesthadeva (author) J. L. Whish (collector), Public domain

Where this is used

Questions

★ What is 4 × (1 − 1/3 + 1/5)?

Pick an answer to see why.

a.★

Aryabhata’s rule: “Add 4 to 100, multiply by 8, and add 62,000: that is approaching the circumference of a circle whose diameter is 20,000.” Work out his value of π. How many decimals of π are right?

Answer
b.★★

For t = 1/3, check that the geometric series 1 − t² + t⁴ − t⁶ + … settles on 1/(1 + t²). Add the first three terms, then the first four.

Answer
c.★★

Use the first four terms of the √12 series to estimate π. (√12 = 3.4641.) How good is it?

Answer
d.★★

Check the sums of squares: work out 1² + 2² + ⋯ + 10² and divide by 10³. Then use the formula n(n + 1)(2n + 1)/6 for n = 100. What are the answers heading for?

Answer
e.★★

Decode Madhava’s verse yourself. In order, its words stand for 33, 2, 8, 8, 3, 3, 3, 4, 27, 8, 2, and the numbers are read from the last word back to the first. Write the number, then divide by 900,000,000,000.

Answer
f.★★★

In the widget, each piece’s estimate (1/n) ÷ (1 + t²) uses the cut point farther from A, and the total falls short of π. With 4 slices it gives 2.881. a. Work out the total if each piece uses the nearer cut point instead (t = 0, 1/4, 2/4, 3/4). b. Is it too big or too small, and why? c. What do you get if you average the two totals?

Hint
Answer
g.★★★

Why can no number of terms of 1 − 1/3 + 1/5 − ⋯, however large, give exactly π/4?

Answer

Where to go next

Where these facts come from
  • Madhava’s dates (c. 1340–1425), Sangamagrama and its two proposed places, his lost works, Parameshvara as his pupil, the line of teachers to Nilakantha, Jyeshthadeva and Sankara Variar, the Yuktibhasha (c. 1530, Malayalam, with proofs), the 21 terms of the √12 series giving 3.14159265359, the three correction terms, and the lack of evidence of transmission to Europe (David Bressoud as quoted there): Wikipedia, “Madhava of Sangamagrama”, read October 2026.
  • The series for sine, cosine and arctangent in the Kerala texts, Sankara Variar’s Yuktidipika, their rediscovery by Newton (1669), Gregory (1671) and Leibniz (1673), and the √12 series from the arctangent of 1/√3: Wikipedia, “Madhava series”, read October 2026.
  • The three correction terms as Nilakantha’s commentary and the Yuktibhasha give them, the “subtler method”, Tantrasangraha completed in 1501, and that how the third was found is unknown: Wikipedia, “Madhava’s correction term”, read October 2026.
  • The 13 decimals from 75 terms with the third correction, Aryabhata’s rule (Aryabhatiya, Ganitapada 10, retold here in our own words) and Nilakantha’s reading of “approaching”, al-Kashi’s sixteen decimals in 1424, and the 2025 record of 314 trillion digits: Wikipedia, “Approximations of π”, read October 2026.
  • The proof by slicing, the two pairs of similar triangles, Jyeshthadeva’s iteration of 1/(1 + x), the sums of powers proved one power at a time, and the derivation of the first end correction: Ranjan Roy, “The Discovery of the Series Formula for π by Leibniz, Gregory and Nilakantha”, Mathematics Magazine 63 (1990), 291–306, pages 302–304, read October 2026.
  • Jyeshthadeva’s description of the series and his warning to use the smaller side, the Yuktibhasha’s date as about 1550, and Madhava’s value to 11 decimals: J. J. O’Connor and E. F. Robertson, “Madhava of Sangamagramma”, MacTutor, read October 2026.
  • The Yuktibhasha’s date as about 1530 and its contents: Wikipedia, “Yuktibhāṣā”; Jyeshthadeva as Damodara’s pupil and a younger contemporary of Nilakantha: Wikipedia, “Jyeṣṭhadeva”; both read October 2026. Whish’s paper (Transactions of the Royal Asiatic Society 3, dated 1834 or 1835 by different sources) and his words on fluxions: Wikipedia, “Kerala school of astronomy and mathematics” and the paper’s record on Zenodo, read October 2026.
  • The verse of Madhava’s value, word by word, and the diameter of nine hundred billion: National Curve Bank, “3.14 and Madhava”, read October 2026.
  • The slowness of the series and the 5,000,000-term total with its isolated wrong digits: Wikipedia, “Leibniz formula for π”, read October 2026.
  • π to 15 decimals for interplanetary navigation, the Voyager circle and 37 decimals for the universe: Marc Rayman, “How Many Decimals of Pi Do We Really Need?”, NASA/JPL Edu (updated 2022), read October 2026 through the Wayback Machine.
  • The 314-trillion-digit record (StorageReview, 110 days, one server), and y-cruncher as a benchmark and stress test: Alexander Yee, y-cruncher, read October 2026. Record computations since 1989 use the Chudnovsky series, based on Ramanujan’s: Wikipedia, “Approximations of π”, read October 2026.
  • The IB’s Maclaurin series by substitution and integration, and its suggested comparison with the Kerala school: IB, Mathematics: analysis and approaches guide (2019), topic AHL 5.19, read October 2026.
  • The photo of the Yuktibhasha’s palm leaves: Wikimedia Commons, “Pages from Yuktibhasa.jpg” (public domain), read October 2026.
  • Every number on this page (the totals with and without each correction, the decimals right, the gaps, the terms needed, the √12 series, the verse’s value, Aryabhata’s value, the slices’ estimates, the sums of powers, the 5,000,000-term digits) was computed by a script, checks/textbooks/math-further-9-12/37/tmp/madhava.py.