# Trigonometry/Calculating Pi

Various formulae for calculating pi can be obtained from the power series expansion for tan-1(x).

Since $\tan^{-1}(1) = \frac{\pi}{4}$, we have

$\frac{\pi}{4} = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \frac{1}{9} ...$

This formula (due to Gottfried Leibniz) converges too slowly to be of practical use. However, similar formulae with much faster convergence can be found. John Machin (1680-1752) showed that

$\frac{\pi}{4} = 4\tan^{-1} \left(\frac{1}{5}\right) - \tan^{-1} \left(\frac{1}{239} \right).$

This formula was widely used by hand calculators. The first part of the right hand side is easy to calculate since finding $\frac{1}{5^n}$ involves very simple division, and the second part only needs 50 terms to compute 240 decimal places.

Leonhard Euler (1707-1783) showed that

$\frac{\pi}{4} = 5\tan^{-1} \left(\frac{1}{7} \right) + 2\tan^{-1} \left(\frac{3}{79} \right).$

Störmer showed that

$\frac{\pi}{4} = 6\tan^{-1} \left(\frac{1}{8} \right) + 2\tan^{-1} \left(\frac{1}{57} \right) + \tan^{-1} \left(\frac{1}{239} \right),$

and this formula was used in 1962 to calculate π to over 100,000 decimals.