Skip to Main Content
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:

nsin(pi/n)cos(pi/n)n·sin(pi/n)
60.500000000.866025403.00000000
120.258819040.965925823.10582854
240.130526190.991444863.13262868
480.065403120.997858923.13935027
960.032719080.999464583.14103199
1920.016361730.999866133.14145242
3840.008181130.999966533.14155767


Method 2

Beginning with the integral

and writing 1/(1 + t2) = 1 - t2 + t4 - t6 + ... and integrating term-by-term, we obtain the infinite series

tan-1(x) = x - x3/3 + x5/5 - x7/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·32 - 1/7·33 + 1/9·34 - ...)

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) - tan3(pi/n)/3 + tan5(pi/n)/5 - tan7(pi/n)/7 + tan9(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, Sk(tan(pi/n)) denotes the approximation obtained by using the first k terms of the above series.

nS5(tan(pi/n))S10(tan(pi/n))
63.142604745663084672803.14159051063808009964
123.141593179349097871833.14159265358927023954
243.141592654032603668833.14159265358979323810

-- Steven Weintraub