How can I use these two formulas to come up with two infinite series, each of which is used to calculate $\pi$?: $$\begin{align*} \frac{\pi}4 &= \arctan(1/2) + \arctan(1/3)\\ \frac{\pi}4 &= 4\arctan(1/5) - \arctan(1/239) \end{align*}$$

- 75,051

- 205
-
A related thread. – J. M. ain't a mathematician Dec 16 '11 at 05:17
-
3I like $$ \pi = \arctan 1 + \arctan 2 + \arctan 3 $$ – Will Jagy Dec 16 '11 at 07:47
-
2@WillJagy, pretty but $\arctan x$ is easier to compute for $x<1$. – lhf Dec 16 '11 at 10:22
2 Answers
You need the power series for $\arctan x$: $$\arctan x=x-\frac{x^3}{3}+\frac{x^5}{5}-\frac{x^7}{7}+\cdots.$$
This power series expansion is often called the Leibniz series, although more properly his name should be associated with the pretty but not terribly useful special case $x=1$. The general series was independently discovered by Gregory. It was also well-known to South Indian mathematicians around $200$ years before Leibniz or Gregory were born. The name Nilakantha is sometimes associated with the discovery, but there is unfortunately no certainty; it may go all the way back to the late fourteenth century mathematician Madhava. For details on the Kerala school of mathematics, please see Kim Plofker's book.
The "Nilakantha" series converges to $\arctan x$ when $-1\le x\le 1$, though the convergence is hopelessly slow at $x=\pm 1$.
Using $\dfrac{\pi}{4}=\arctan(1/2)+\arctan(1/3)$ we get $$\frac{\pi}{4}=\left(\frac{1}{2}-\frac{1}{3\cdot 2^3} + \frac{1}{5\cdot 2^5}-\frac{1}{7\cdot 2^7}+\cdots \right)+ \left(\frac{1}{3}-\frac{1}{3\cdot 3^3} + \frac{1}{5\cdot 3^5}-\frac{1}{7\cdot 3^7}+\cdots \right) .$$ The terms go down reasonably fast. For each part, the error made when we truncate the infinite series at a certain place is smaller, in absolute value, than the first "neglected" term.
We get better performance from the second formula that you quoted, which is called Machin's Formula. The negative powers of $5$ and $239$ go down much faster than was the case for $2$ and $3$. Moreover, the fractions $\dfrac{1}{5^{2n+1}}$ are particularly pleasant if we are using decimal arithmetic.
The Machin Formula, and relatives, together with the power series for $\arctan x$, are the method used for most high-precision approximations to $\pi$ from the eighteenth century until now. Viable alternatives have only emerged recently.

- 507,029
-
-
2In general, since Maclaurin series converge much faster when their arguments are near zero, it makes sense to use a Machin formula whose arctangent arguments are as small as they can be. – J. M. ain't a mathematician Dec 16 '11 at 05:27
-
+1 Nice answer, do you have any references for further reading? – AD - Stop Putin - Dec 16 '11 at 06:50
-
-
@J.M. Thanks, but I was more interested in the historical refs (perhaps it is contained in some of the papers I don't know since I don't have access). – AD - Stop Putin - Dec 16 '11 at 08:05
-
2@AD.: I added a reference to Plofker's Mathematics in India. There is also a fairly recent less scholarly book on Kerala mathematics by George Joseph. – André Nicolas Dec 16 '11 at 08:25
-
Just to complete: To prove the equality $$\pi/4 = \arctan(1/2) + \arctan(1/3)$$ consider that $$(2+i)(3+i) =5+5i.$$ Now, taking the arguments of both sides and since the argument of a product is the sum of the arguments of the factors, the equality follows.

- 111