On this page
In 1706 the mathematician William Jones printed π to more than 100 decimal places in his book Synopsis Palmariorum Matheseos, crediting the digits to John Machin, who in 1713 became professor of astronomy at Gresham College (MacTutor biography of John Machin). This post proves the identity two ways, shows why it is so fast, and walks you through a hand calculation.
What is Machin's formula for π?
Machin's formula says π/4 = 4 arctan(1/5) − arctan(1/239) (Machin-like formula, Wikipedia).
You can compute each arctangent with the Gregory series arctan x = x − x³/3 + x⁵/5 − x⁷/7 + …, which works for |x| ≤ 1. Put x = 1 and you get the Leibniz series π/4 = 1 − 1/3 + 1/5 − … . Put x = 1/5 or x = 1/239 and every term is much smaller than the one before it. That is the whole trick. Jones gave no hint of how Machin found the identity (MacTutor), but you can check it in a few lines.
How do you prove Machin's formula?
The first proof uses the tan double-angle and subtraction formulas. Let tan a = 1/5. Use tan 2a = 2 tan a / (1 − tan² a), the same identity you use to solve equations like tan⁻¹2x + tan⁻¹3x = π/4.
tan 2a = (2/5) / (1 − 1/25) = (2/5) / (24/25) = 5/12.
tan 4a = (10/12) / (1 − 25/144) = (5/6) / (119/144) = 120/119.
tan(4a − π/4) = (120/119 − 1) / (1 + 120/119) = (1/119) / (239/119) = 1/239.
So 4a − π/4 = arctan(1/239). Since 4a is just over 45°, there is no extra multiple of π to worry about, and the formula follows.
The second proof uses complex numbers. Multiplying complex numbers adds their angles. The angle of 5 + i is arctan(1/5), and the angle of 239 − i is −arctan(1/239). Now multiply:
(5 + i)² = 24 + 10i.
(5 + i)⁴ = (24 + 10i)² = 476 + 480i.
(476 + 480i)(239 − i) = 114244 + 114244i = 4 × 13⁴ × (1 + i).
The answer is a positive multiple of 1 + i, whose angle is π/4. So 4 arctan(1/5) − arctan(1/239) = π/4, which matches the identity (5 + i)⁴(239 − i) = 2² × 13⁴ × (1 + i) given in the Wikipedia article.
Why does it converge so much faster than the Leibniz series?
The Leibniz series converges extremely slowly: you need 5,000 terms to get 4 correct decimal places, and more than five billion terms to get 10 (Leibniz formula for π, Wikipedia). Its terms 1, 1/3, 1/5, … hardly shrink. For why it converges at all, see the alternating series (Leibniz) test.
In the arctan(1/5) series, each term is about 25 times smaller than the one before, because you multiply by (1/5)² each time. That gives you about 1.4 new correct digits per term. In the arctan(1/239) series each term is 239² = 57,121 times smaller, about 4.8 digits per term. Machin's formula needs only six terms to obtain 10 correct digits (Wikipedia). By the same arithmetic, 100 digits need roughly 70 terms of the first series and about 21 of the second: a lot of long division, but possible by hand.
How do you compute π by hand with Machin's formula?
Use 5 terms of arctan(1/5) and 2 terms of arctan(1/239). Keep 10 decimal places throughout.
1/5 = 0.2000000000
1/(3 × 5³) = 1/375 = 0.0026666667
1/(5 × 5⁵) = 1/15625 = 0.0000640000
1/(7 × 5⁷) = 1/546875 = 0.0000018286
1/(9 × 5⁹) = 1/17578125 = 0.0000000569
With alternating signs, arctan(1/5) ≈ 0.2 − 0.0026666667 + 0.000064 − 0.0000018286 + 0.0000000569 = 0.1973955616. Multiply by 16 to get 3.1583289856.
For the small angle, 1/239 = 0.0041841004 and 1/(3 × 239³) = 1/40955757 = 0.0000000244. So arctan(1/239) ≈ 0.0041840760, and 4 times that is 0.0167363040.
Now subtract: π ≈ 3.1583289856 − 0.0167363040 = 3.1415926816. The true value starts 3.1415926536, so seven terms of arithmetic give you π correct to 7 decimal places.
To revise inverse tangents and series, the Fermi Concept Library has a lesson on every concept in mathematics, with its place in the map. When a step stops making sense, the Fermi Problem Library works problems with a step-by-step solver that explains the reasoning rather than printing an answer.
Why does Machin's formula still matter?
Formulas built the same way, called Machin-like formulas, were still being used for record computations almost three centuries later. In 2002 Yasumasa Kanada of Tokyo University computed 1,241,100,000,000 digits of π on a 64-node Hitachi supercomputer, using two four-term Machin-like formulas so each checked the other (Wikipedia).
The book that printed Machin's digits is also where π got its name. Read how William Jones first used the symbol π in 1706.



