History of Math

Madhava’s Series for π

The Madhava–Leibniz series π/4 = 1 − 1/3 + 1/5 − … converges painfully slowly. This demo steps through partial sums, plots the error on a log scale, and shows how adding half of the next term sharply accelerates convergence.

7 minLevel 3/3The interactive stage stays ad-free.
Terms6Partial sum0.744011544π/40.785398163Error4.14e-2Next term0.076923Corrected0.782473082Corrected error2.93e-3
1e01e-11e-21e-31e-41e-5050100150200|error| vs termsraw partial sumwith next term / 2number of terms

π/4 = 1 − 1/3 + 1/5 − 1/7 + … · S(6) = 0.744011544 · error = 4.139e-2 · first correction 0.076923 / 2 → 0.782473082

ktermpartial sumnext / 2corrected
01.0000001.000000-0.1666670.833333
1-0.3333330.6666670.1000000.766667
20.2000000.866667-0.0714290.795238
3-0.1428570.7238100.0555560.779365
40.1111110.834921-0.0454550.789466
5-0.0909090.7440120.0384620.782473
60.0769230.820935-0.0333330.787601
7-0.0666670.7542680.0294120.783680
80.0588240.813091-0.0263160.786776
9-0.0526320.7604600.0238100.784269
100.0476190.808079-0.0217390.786340
11-0.0434780.7646010.0200000.784601
First correction. For an alternating series whose terms shrink to zero, the true value lies between two consecutive partial sums. Averaging them, S + next term / 2, cancels the leading error and speeds convergence dramatically — the green curve. It is still an approximation, not a proof of the limit.
Kerala school, 14th–15th centuryThe series for π is associated with Madhava of Sangamagrama and the Kerala school, and later with Gregory, Leibniz, and others in Europe. What is historically secure is that the Kerala texts present infinite-series reasoning and this π series centuries before the European rediscovery. Attributing every related series to a single person is not secure.
Speedup0.07×

The raw alternating sum crawls toward π/4 ≈ 0.785398163. Its error falls like 1/N, so you need thousands of terms for a few digits. Adding half of the next term cancels most of that error and converges much faster, as the green curve shows. The Kerala school used such series reasoning long before Europe.

What you are seeing

1

Term k is (−1)^k/(2k+1), so the partial sums alternate above and below π/4. The error shrinks only like 1/N for the raw sum.

2

The true value lies between consecutive partial sums. Adding half of the next term, S + term/2, cancels the leading error and converges much faster.

3

The chart plots both errors on a log scale against the number of terms, so you can compare convergence slopes directly.

Why it matters

This is one of the earliest uses of infinite series to compute a constant. It also teaches a lasting lesson: the same sum can converge slowly or quickly depending on how you extrapolate it.

Complexity & details

Computing N terms costs O(N). The correction adds O(1) work, and plots sample up to 201 points with a stride.

Frequently asked questions

Did Madhava discover this exact series?+

The π series is associated with Madhava and the Kerala school, and independently with later European mathematicians. Which related series came from exactly whom is not fully secure, so the demo credits the tradition rather than a single person for everything.

Why does halving the next term help so much?+

For an alternating series with decreasing terms, the limit sits between S and S + next term. The midpoint S + next/2 is far closer, removing the dominant half-step error, so the remaining error drops much faster.