Calculus, Machin's Formula

atan(x)

Consider yet another function, the arctangent of x. This starts at 0 and approaches π/2 as x approaches infinity. By definition, the function is odd; approaching -π/2 as x approaches -infinity. Its derivative is 1 / (1+x2). For x < 1, this expression is equal to the geometric sum 1 - x2 + x4 - x6 + … Exchange sum and integral, and the taylor series for atan(x) is x - x3/3 + x5/5 - x7/7 + … This is valid for |x| < 1, or |z| < 1 if you like complex analysis. This series also converges on the circle, i.e. |z| = 1.

Calculating π

Since the tangent of π/4 is 1, we finally have a formula for π, namely 4×atan(1). This is certainly easier than trapping the circle between regular polygons, which had been done since the time of Archimedes.

π/4 = 1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + …

Although this looks promising, it isn't very efficient. After adding a million fractions together, no easy task, you still only have 6 decimal digits of precision. John Machin (biography) was the first to substantially improve upon this formula. Consider the sine of 4 times atan(1/5). (You'll need the double angle formulas.) The sine is 480/676, and the cosine is 476/676. Then consider the arctangent of 1/239. Its sine is 1 / 169×sqrt(2), and its cosine is 239 / 169×sqrt(2). Finally, use these values to derive the sine of 4×atan(1/5) - atan(1/239). (You'll need the angle addition formula.) The result is 1 / sqrt(2), which is the sine of π/4. Thus we have proved Machin's formula:

π/4 = 4 × atan(1/5) - atan(1/239)

Since small fractions converge quickly, this formula is much more efficient. It was especially pleasing in the days before calculators, because 0.2 is a nice decimal number, easy to work with, and the powers of 1/239, albeit awkward, converge quickly. In fact, Machin became the first individual to correctly compute the first 100 digits of π.

There are much more efficient formulas today, and π has been calculated to billions of digits. These formulas are beyond the scope of elementary calculus.