Using arctan x=sum from n=0 to infinity
Using $\arctan x=\sum_{n=0}^{\infty}\dfrac{(-1)^nx^{2n+1}}{2n+1}$, calculate $\pi$ with five correct decimal places.
Explanation of Method
Plugging $x=1$ directly gives the Leibniz series, but it converges far too slowly to be practical. Machin's formula rewrites $\pi/4$ as a combination of arctangents of small arguments $1/5$ and $1/239$, so the same series converges dramatically faster.
- Note the impracticality of the direct $\arctan 1$ series.
- Verify Machin's identity $\pi/4=4\arctan\frac15-\arctan\frac1{239}$ using the tangent addition formula.
- Compute both arctangents via the series and combine.
Step 1 · Why not use $x=1$ directly?
$\dfrac\pi4=1-\dfrac13+\dfrac15-\cdots$ converges so slowly that reaching 5 correct decimals would require on the order of $10^5$ terms — impractical by hand.
Step 2 · Verify Machin's formula
Let $\alpha=\arctan\frac15$. Using the double-angle tangent formula twice: $$ \tan2\alpha=\frac{2/5}{1-1/25}=\frac5{12}, \qquad \tan4\alpha=\frac{2\cdot5/12}{1-25/144}=\frac{120}{119}. $$ With $\beta=\arctan\frac1{239}$: $$ \tan(4\alpha-\beta)=\frac{\frac{120}{119}-\frac1{239}}{1+\frac{120}{119\cdot239}}=\frac{120\cdot239-119}{119\cdot239+120}=\frac{28561}{28561}=1, $$ so $4\alpha-\beta=\arctan1=\frac\pi4$.
Step 3 · Compute both series and combine
$$ \arctan\frac15 = \frac15-\frac1{3\cdot5^3}+\frac1{5\cdot5^5}-\frac1{7\cdot5^7}+\cdots \approx 0.197395560, $$ $$ \arctan\frac1{239} = \frac1{239}-\frac1{3\cdot239^3}+\cdots \approx 0.004184076. $$ (Only 5–6 terms of the first series and 2 terms of the second are needed for this precision.) Then: $$ \frac\pi4 = 4(0.197395560)-0.004184076 = 0.785398164, \qquad \pi \approx 3.14159266. $$
Summary Table
| Property | Value |
|---|---|
| Machin's formula | $\pi/4=4\arctan\frac15-\arctan\frac1{239}$ |
| Result | $\pi\approx3.14159$ |
| Terms needed | $\sim8$ total (vs.\ $\sim10^5$ direct) |
Additional Notes
- The dramatic speed-up comes from the small arguments: with $|x|=1/5$, each term shrinks by a factor of roughly $1/25$, and with $|x|=1/239$ the series is essentially exact after two terms.
- John Machin used exactly this formula in 1706 to compute 100 digits of $\pi$ by hand — the same technique (with different small arguments) powered most manual and early computer calculations of $\pi$ well into the 20th century.
- The remainder-estimate technique of Problem 281 justifies stopping after a fixed number of terms here: since each series' ratio of consecutive terms is bounded well below $1$, only a handful of terms are needed to guarantee the required accuracy.