Arctangent series

In mathematics, the arctangent series, traditionally called Gregory's series, is the Taylor series expansion at the origin of the arctangent function:


 * $$\arctan x = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \cdots = \sum_{k=0}^\infty \frac{(-1)^kx^{2k+1}}{2k+1}.$$

This series converges in the complex disk $$|x| \leq 1,$$ except for $$x = \pm i$$ (where $\arctan \pm i = \infty$).

It was first discovered in the 14th century by Indian mathematician Mādhava of Sangamagrāma (c. 1340 – c. 1425), the founder of the Kerala school, and is described in extant works by Nīlakaṇṭha Somayāji (c. 1500) and Jyeṣṭhadeva (c. 1530). Mādhava's work was unknown in Europe, and the arctangent series was independently rediscovered by James Gregory in 1671 and by Gottfried Leibniz in 1673. In recent literature the arctangent series is sometimes called the Mādhava–Gregory series to recognize Mādhava's priority (see also Mādhava series). For example:, ;     Other combinations of names include,  Madhava–Gregory–Leibniz series:   Madhava–Leibniz–Gregory series:  Nilakantha–Gregory series:   Gregory–Leibniz–Nilakantha formula:

The special case of the arctangent of $π$ is traditionally called the Leibniz formula for $1$, or recently sometimes the Mādhava–Leibniz formula:
 * $$\frac\pi4 = \arctan 1 = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \cdots.$$

The extremely slow convergence of the arctangent series for $$|x| \approx 1$$ makes this formula impractical per se. Kerala-school mathematicians used additional correction terms to speed convergence. John Machin (1706) expressed $π$ as a sum of arctangents of smaller values, eventually resulting in a variety of Machin-like formulas for $\tfrac14\pi$. Isaac Newton (1684) and other mathematicians accelerated the convergence of the series via various transformations.

Proof


If $$y = \arctan x$$ then $$\tan y = x.$$ The derivative is



\frac{dx}{dy} = \sec^2 y = 1 + \tan^2 y. $$

Taking the reciprocal,



\frac{dy}{dx} = \frac{1}{1 + \tan^2 y} = \frac{1}{1 + x^2}. $$

This sometimes is used as a definition of the arctangent:


 * $$\arctan x = \int_0^x\frac{du}{1 + u^2}.$$

The Maclaurin series for $x \mapsto \arctan' x = 1 \big/ \left(1 + x^2\right)$ is a geometric series:


 * $$\frac{1}{1 + x^2} = 1 - x^2 + x^4 - x^6 + \cdots = \sum_{k=0}^\infty \bigl({-x^2}\bigr){\vphantom)}^k.$$

One can find the Maclaurin series for $$\arctan$$ by naïvely integrating term-by-term:


 * $$\begin{align}

\int_0^x \frac{du}{1 + u^2} &= \int_0^x \left(1 - u^2 + u^4 - u^6 + \cdots\right)du \\[5mu] &= x - \frac13 x^3 + \frac15 x^5 - \frac17 x^7 + \cdots = \sum_{k=0}^\infty \frac{(-1)^kx^{2k+1}}{2k+1}. \end{align}$$

While this turns out correctly, integrals and infinite sums cannot always be exchanged in this manner. To prove that the integral on the left converges to the sum on the right for real $$|x| \leq 1,$$ $$\arctan'$$ can instead be written as the finite sum,



\frac{1}{1 + x^2} = 1 - x^2 + x^4 - \cdots + \bigl({-x^2}\bigr){\vphantom)}^N + \frac{\bigl({-x^2}\bigr){}^{N+1}}{1 + x^2}. $$

Again integrating both sides,



\int_0^x \frac{du}{1 + u^2} = \sum_{k=0}^N \frac{(-1)^kx^{2k+1}}{2k+1} + \int_0^x\frac{\bigl({-u^2}\bigr){}^{N+1}}{1 + u^2}\,du. $$

In the limit as $$N \to \infty,$$ the integral on the right above tends to zero when $$|x| \leq 1,$$ because


 * $$\begin{align}

\Biggl| \int_0^x\frac{\bigl({-u^2}\bigr){}^{N+1}}{1 + u^2}\,du \,\Biggr| \,&\leq \int_0^1 \frac{u^{2N+2}}{1 + u^2}\,du \\[5mu] &< \int_0^1 u^{2N+2}du \,=\, \frac{1}{2N+3} \,\to\, 0. \end{align}$$

Therefore,


 * $$\begin{align}

\arctan x = \sum_{k=0}^\infty \frac{(-1)^kx^{2k+1}}{2k+1}. \end{align}$$

Convergence
The series for $\arctan'$ and $$\arctan$$ converge within the complex disk $$|x| < 1$$, where both functions are holomorphic. They diverge for $$|x| > 1$$ because when $$x = \pm i$$, there is a pole:


 * $$\frac1{1 + i^2} = \frac1{1 - 1} = \frac10 = \infty.$$

When $$x = \pm1,$$ the partial sums $\sum_{k=0}^n (-x^2)^k$ alternate between the values $$0$$ and $$1,$$ never converging to the value $\arctan'(\pm1) = \tfrac12.$

However, its term-by-term integral, the series for $\arctan,$ (barely) converges when $$x = \pm 1,$$ because $$\arctan'$$ disagrees with its series only at the point $$\pm1,$$ so the difference in integrals can be made arbitrarily small by taking sufficiently many terms:


 * $$\lim_{N \to \infty} \int_0^1\biggl(\frac{1}{1 + u^2} - \sum_{k=0}^N (-u^2)^k\biggr)du = 0 $$

Because of its exceedingly slow convergence (it takes five billion terms to obtain 10 correct decimal digits), the Leibniz formula is not a very effective practical method for computing $\tfrac14\pi.$ Finding ways to get around this slow convergence has been a subject of great mathematical interest.

Accelerated series
Isaac Newton accelerated the convergence of the arctangent series in 1684 (in an unpublished work; others independently discovered the result and it was later popularized by Leonhard Euler's 1755 textbook; Euler wrote two proofs in 1779), yielding a series converging for x
 * $$\begin{align}

\arctan x &= \frac {x} {1 + x^2} \sum_{n=0}^\infty \prod_{k=1}^n \frac{2k}{2k+1} \, \frac{x^2}{1 + x^2} \\[10mu]

&= \frac {x} {1 + x^2} + \frac23 \frac {x^3} {(1 + x^2)\vphantom{l}^2} + \frac{2\cdot 4}{3 \cdot 5} \frac {x^5} {(1 + x^2)\vphantom{l}^3} + \frac{2\cdot4\cdot6}{3\cdot5\cdot7} \frac {x^7} {(1 + x^2)\vphantom{l}^4} + \cdots \\[10mu]

&= C(x)\left( S(x) + \frac23S(x)^3 + \frac{2\cdot 4}{3 \cdot 5}S(x)^5  + \frac{2\cdot4\cdot6}{3\cdot5\cdot7}S(x)^7 + \cdots \right), \end{align}$$ where $\vphantom\Big| C(x) = 1 \big/ \!\sqrt{1 + x^2} = {}$ $$\cos(\arctan x)$$ and $\vphantom\Big| S(x) = x \big/ \!\sqrt{1 + x^2} = {}$ $\sin(\arctan x).$

Each term of this modified series is a rational function with its poles at $$x = \pm i$$ in the complex plane, the same place where the arctangent function has its poles. By contrast, a polynomial such as the Taylor series for arctangent forces all of its poles to infinity.

History
The earliest person to whom the series can be attributed with confidence is Mādhava of Sangamagrāma (c. 1340 – c. 1425). The original reference (as with much of Mādhava's work) is lost, but he is credited with the discovery by several of his successors in the Kerala school of astronomy and mathematics founded by him. Specific citations to the series for $$\arctan$$ include Nīlakaṇṭha Somayāji's Tantrasaṅgraha (c. 1500), Jyeṣṭhadeva's Yuktibhāṣā (c. 1530), and the Yukti-dipika commentary by Sankara Variyar, where it is given in verses 2.206 – 2.209.