Leibniz formula for π
|Part of a series of articles on the|
|mathematical constant π|
an alternating series. It is also called the Madhava–Leibniz series as it is a special case of a more general series expansion for the inverse tangent function, first discovered by the Indian mathematician Madhava of Sangamagrama in the 14th century, the specific case first published by Leibniz around 1676. The series for the inverse tangent function, which is also known as Gregory's series, can be given by:
The Leibniz formula for can be obtained by putting into this series.
Considering only the integral in the last term, we have:
Therefore, by the squeeze theorem, as n → ∞, we are left with the Leibniz series:
When , converges uniformly, therefore
If approaches so that it is continuous and converges uniformly, the proof is complete. From Leibniz's test, converges, also approaches from within the Stolz angle, so from Abel's theorem this is correct.
Leibniz's formula converges extremely slowly: it exhibits sublinear convergence. Calculating π to 10 correct decimal places using direct summation of the series requires precisely five billion terms because 4/2k + 1 < 10−10 for k > 2 × 1010 − 1/2 (one needs to apply Calabrese error bound). To get 4 correct decimal places (error of 0.00005) one needs 5000 terms. Even better than Calabrese or Johnsonbaugh error bounds are available.
However, the Leibniz formula can be used to calculate π to high precision (hundreds of digits or more) using various convergence acceleration techniques. For example, the Shanks transformation, Euler transform or Van Wijngaarden transformation, which are general methods for alternating series, can be applied effectively to the partial sums of the Leibniz series. Further, combining terms pairwise gives the non-alternating series
which can be evaluated to high precision from a small number of terms using Richardson extrapolation or the Euler–Maclaurin formula. This series can also be transformed into an integral by means of the Abel–Plana formula and evaluated using techniques for numerical integration.
If the series is truncated at the right time, the decimal expansion of the approximation will agree with that of π for many more digits, except for isolated digits or digit groups. For example, taking five million terms yields
where N is an integer divisible by 4. If N is chosen to be a power of ten, each term in the right sum becomes a finite decimal fraction. The formula is a special case of the Boole summation formula for alternating series, providing yet another example of a convergence acceleration technique that can be applied to the Leibniz series. In 1992, Jonathan Borwein and Mark Limber used the first thousand Euler numbers to calculate π to 5,263 decimal places with the Leibniz formula.
The Leibniz formula can be interpreted as a Dirichlet series using the unique non-principal Dirichlet character modulo 4. As with other Dirichlet series, this allows the infinite sum to be converted to an infinite product with one term for each prime number. Such a product is called an Euler product. It is:
- Plofker, Kim (November 2012), "Tantrasaṅgraha of Nīlakaṇṭha Somayājī by K. Ramasubramanian and M. S. Sriram", The Mathematical Intelligencer, 35 (1): 86–88, doi:10.1007/s00283-012-9344-6, S2CID 124507583
- Edwards, Charles Henry (1994), The historical development of the calculus, Springer Study Edition Series (3 ed.), Springer, p. 247, ISBN 978-0-387-94313-8
- Andrews, George E.; Askey, Richard; Roy, Ranjan (1999), Special Functions, Cambridge University Press, p. 58, ISBN 0-521-78988-5
- Villarino, Mark B. (2018-04-21). "The Error in an Alternating Series". The American Mathematical Monthly. 125 (4): 360–364. doi:10.1080/00029890.2017.1416875. hdl:10669/75532. ISSN 0002-9890. S2CID 56124579.
- Rattaggi, Diego (2018-08-30). "Error estimates for the Gregory-Leibniz series and the alternating harmonic series using Dalzell integrals". arXiv:1809.00998 [math.CA].
- Borwein, Jonathan; Bailey, David; Girgensohn, Roland (2004), "1.8.1: Gregory's Series Reexamined", Experimentation in mathematics: Computational paths to discovery, A K Peters, pp. 28–30, ISBN 1-56881-136-5, MR 2051473
- Debnath, Lokenath (2010), The Legacy of Leonhard Euler: A Tricentennial Tribute, World Scientific, p. 214, ISBN 9781848165267.