In mathematics, the Leibniz formula for , named after Gottfried Wilhelm Leibniz, states that
It is sometimes called the Madhava–Leibniz series as it was first discovered by the Indian mathematician Madhava of Sangamagrama or his followers in the 14th–15th century (see Madhava series), and was later independently rediscovered by James Gregory in 1671 and Leibniz in 1673.[1] The Taylor series for the inverse tangent function, often called Gregory's series, is
The Leibniz formula is the special case
It also is the Dirichlet -series of the non-principal Dirichlet character of modulus 4 evaluated at
s=1,
Considering only the integral in the last term, we have:
Therefore, by the squeeze theorem, as, we are left with the Leibniz series:
Let
f(z)=
infty | |
\sum | |
n=0 |
(-1)n | |
2n+1 |
z2n+1
|z|<1
infty | |
\sum | |
k=0 |
(-1)kz2k
Therefore, if
f(z)
f(1)
infty | |
\sum | |
n=0 |
(-1)n | |
2n+1 |
f(z)
f(1)
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 for (one needs to apply Calabrese error bound). To get 4 correct decimal places (error of 0.00005) one needs 5000 terms.[2] Even better than Calabrese or Johnsonbaugh error bounds are available.[3]
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 the underlined digits are wrong. The errors can in fact be predicted; they are generated by the Euler numbers according to the asymptotic formula
where is an integer divisible by 4. If 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 Euler–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:In this product, each term is a superparticular ratio, each numerator is an odd prime number, and each denominator is the nearest multiple of 4 to the numerator.[4]