# How to prove that a series expansion of pi has converged to a certain accuracy?

Wikipedia has a great article on methods for calculating pi with arbitrary precision, using for example Machin's infinite series expansion:

$\frac{\pi}{ 4} = 4$ arccot $5 -$arccot $239$

where

arccot $x = \frac{1}{x} - \frac{1}{3 x^3} + \frac{1}{5 x^5} - \frac{1}{7 x^7} + \dots$

The only problem is that they never mention how to prove how many digits you have accurately computed pi to. How is this done? In general, how do you prove this for any series that converges?

Edit: I used pi with an alternating series as an example, but I'm more interested in general techniques for any convergent series.

-
In a convergent alternating series with terms decreasing in absolute value, the error is always less that the size of the first omitted term. – Mark Bennet Jul 31 '12 at 20:52

The series that you mention are alternating series. That means that the terms alternate in sign, go down in absolute value, and the absolute values of the terms approach $0$.

For alternating series, the error made by truncating at a particular place has absolute value less than the first omitted term. This criterion is easy to use, and ordinarily one cannot do substantially better. The sign of the first neglected term also tells you the direction of the error. If it is negative, truncation produces an overestimate. If it is positive, then truncation produces an underestimate.

-
What about non-alternating series? – Mike Izbicki Jul 31 '12 at 20:59
It can get complicated. But for power series we can often get an estimate by bounding above using a suitable geometric series. For example, suppose we are dealing with the series for $e^x$, $x=1/2$, or anyway positive and less than $1$. If we cut off at the term $(1/9!)x^9$, our error is less than $(1/10!)(x^{10}+x^{11}+\cdots)$ (we can do better). – André Nicolas Jul 31 '12 at 21:08
Each of the usual convergence tests corresponds to a method of estimating the error. Thus if $|a_n| < b_n$ and $\sum_n b_n$ converges, the error in $\sum_{n\le N} a_n$ is bounded by $\sum_{n > N} b_n$. – Robert Israel Jul 31 '12 at 21:09