Considering only the integral in the last term, we have:
Therefore, by the squeeze theorem, as n → ∞, we are left with the Leibniz series:
Proof 2
Let , when , the series converges uniformly, then
Therefore, if approaches so that it is continuous and converges uniformly, the proof is complete, where, the series to be converges by the Leibniz's test, and also, approaches from within the Stolz angle, so from Abel's theorem this is correct.
Convergence
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.[4] Even better than Calabrese or Johnsonbaugh error bounds are available.[5]
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
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 numbersEn according to the asymptotic formula
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 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.[6]
Euler product
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.[7] The product is conditionally convergent; its terms must be taken in order of increasing p.
^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].