Calculating Pi using Elementary Calculus ## Calculating Pi using Elementary Calculus

There are many powerful and sophisticated methods known for the calculation of pi, and, using these methods, pi has been calculated to billions of decimal places. Here we present two methods for the calculation of pi which only use elementary calculus, but nevertheless are surprisingly effective.

By way of comparison, note that *pi = 3.14159265358979323846... .*

## Method 1

This method uses the fact that

Setting *x = pi/n*, we see that, for *n* large, *pi* is approximately equal to *n·sin(pi/n)*.

To use this, we must be able to compute *sin(pi/n)*. Recall the trigonometric identities

*sin(x/2) = sqrt((1-cos(x))/2), cos(x/2) = sqrt((1+cos(x))/2),* valid for

*0 <= x <= pi*, where we take the positive square roots. Thus, if we know

*sin(pi/n)* and

*cos(pi/n)*, we may compute

*sin(pi/2n)* and

*cos(pi/2n)*, and then proceed recursively. Of course, we know

*sin(pi/6) = 1/2* and

*cos(pi/6) = sqrt(3)/2*. We thus obtain the following table:

*n* | *sin(pi/n)* | *cos(pi/n)* | *n·sin(pi/n)* |

6 | 0.50000000 | 0.86602540 | 3.00000000 |

12 | 0.25881904 | 0.96592582 | 3.10582854 |

24 | 0.13052619 | 0.99144486 | 3.13262868 |

48 | 0.06540312 | 0.99785892 | 3.13935027 |

96 | 0.03271908 | 0.99946458 | 3.14103199 |

192 | 0.01636173 | 0.99986613 | 3.14145242 |

384 | 0.00818113 | 0.99996653 | 3.14155767 |

## Method 2

Beginning with the integral

and writing *1/(1 + t*^{2}) = 1 - t^{2} + t^{4} - t^{6} + ... and integrating term-by-term, we obtain the infinite series

*tan*^{-1}(x) = x - x^{3}/3 + x^{5}/5 - x^{7}/7 + ... , which converges for *-1 <= x <= 1*. Substituting *x = 1*, we obtain Leibniz's series

*pi = 4(1 - 1/3 + 1/5 - 1/7 + 1/9 - ...)* . However, because *x = 1* is an endpoint of the interval of convergence, this series converges very slowly and so is impractical for calculation. (For example, the first five terms give the approximations *4., 2.666, 3.466, 2.895, 3.339* to *pi*.)

On the other hand, we may substitute *x = 1/sqrt(3) = tan*^{-1}(pi/6). Then, after some algebraic manipulation, we obtain the series

*pi = 2·sqrt(3)(1 - 1/3·3 + 1/5·3*^{2} - 1/7·3^{3} + 1/9·3^{4} - ...) and the first five terms of this series give the approximations *3.46410, 3.07920, 3.15618, 3.13785, 3.14260* to *pi*, the last of which differs from *pi* by litle more than *.001*.

Indeed, we can do even better. Substituting *x = tan(pi/n)* for *n >= 4* (so that the series converges), we obtain the series

*pi = n(tan(pi/n) - tan*^{3}(pi/n)/3 + tan^{5}(pi/n)/5 - tan^{7}(pi/n)/7 + tan^{9}(pi/n)/9 - ...). Now *tan(x/2) = sqrt((1 - cos(x))/(1 + cos(x)))*, so we may again compute *tan(pi/n)* recursively, starting with *n = 6*. We obtain the following approximations to *pi*, where in the last two columns of this table, *S*_{k}(tan(pi/n)) denotes the approximation obtained by using the first *k* terms of the above series.

n | *S*_{5}(tan(pi/n)) | *S*_{10}(tan(pi/n)) |

6 | 3.14260474566308467280 | 3.14159051063808009964 |

12 | 3.14159317934909787183 | 3.14159265358927023954 |

24 | 3.14159265403260366883 | 3.14159265358979323810 |

*-- Steven Weintraub*