## Arctan Formulae for Computing π

### Derivation of the Machin Formula

In 1706 John Machin, Professor of Astronomy in London, computed π to 100 digits using the formula (Formula 8):

**π = 16·arctan(1/5) − 4·arctan(1/239)**

This is not an arbitrary formula. It can be derived easily.

First, start with:

**tan α = 1/5**

for some angle α that we need not be concerned with since it will disappear from the final result. (For the curious, α ≈ 11° 18' 35.8").

Using the trig formula for double angles:

**tan 2α = ** | __ 2·tan α __ | ** = ** | __ 2/5 __ | ** = ** | __ 5 __ |

** 1 − tan**^{2} α | **1 − 1/25** | **12** |

Applying the double angle formula once more:

**tan 4α = ** | __ 2·tan 2α __ | ** = ** | __ 5/6 __ | ** = ** | __ 120 __ |

** 1 − tan**^{2} 2α | **1 − 25/144** | **119** |

This differs from 1 by only the small value 1/119, but tan π/4 = 1; therefore, 4α differs from π/4 by a small value so that tan (4α − π/4) is small. Indeed, it is just:

**tan (4α − π/4) = ** | __ tan 4α − tan π/4 __ | ** = ** | __ tan 4α − 1 __ | ** = ** | __ 120/119 − 1 __ | ** = ** | __ 1 __ |

**tan 4α + tan π/4** | **tan 4α + 1** | **120/119 + 1** | **239** |

Taking the arctan of both sides results in:

**4α − π/4 = arctan (1/239)**

Solving for **π** and substituting **α = arctan(1/5)** finally gives:

**π = 16·arctan(1/5) − 4·arctan(1/239)**