# Alternating series test

In mathematical analysis, the alternating series test is the method used to prove that an alternating series with terms that decrease in absolute value is a convergent series. The test was used by Gottfried Leibniz and is sometimes known as Leibniz's test, Leibniz's rule, or the Leibniz criterion.

## Formulation

A series of the form

${\displaystyle \sum _{n=0}^{\infty }(-1)^{n}a_{n}=a_{0}-a_{1}+a_{2}-a_{3}+\cdots \!}$

where either all an are positive or all an are negative, is called an alternating series.

The alternating series test then says: if ${\displaystyle |a_{n}|}$ decreases monotonically and ${\displaystyle \lim _{n\to \infty }a_{n}=0}$ then the alternating series converges.

Moreover, let L denote the sum of the series, then the partial sum

${\displaystyle S_{k}=\sum _{n=1}^{k}(-1)^{n-1}a_{n}\!}$

approximates L with error bounded by the next omitted term:

${\displaystyle \left|S_{k}-L\right\vert \leq \left|S_{k}-S_{k+1}\right\vert =a_{k+1}.\!}$

## Proof

Suppose we are given a series of the form ${\displaystyle \sum _{n=1}^{\infty }(-1)^{n-1}a_{n}\!}$, where ${\displaystyle \lim _{n\rightarrow \infty }a_{n}=0}$ and ${\displaystyle a_{n}\geq a_{n+1}}$ for all natural numbers n. (The case ${\displaystyle \sum _{n=1}^{\infty }(-1)^{n}a_{n}\!}$ follows by taking the negative.)[1]

### Proof of convergence

We will prove that both the partial sums ${\displaystyle S_{2m+1}=\sum _{n=1}^{2m+1}(-1)^{n-1}a_{n}}$ with odd number of terms, and ${\displaystyle S_{2m}=\sum _{n=1}^{2m}(-1)^{n-1}a_{n}}$ with even number of terms, converge to the same number L. Thus the usual partial sum ${\displaystyle S_{k}=\sum _{n=1}^{k}(-1)^{n-1}a_{n}}$ also converges to L.

The odd partial sums decrease monotonically:

${\displaystyle S_{2(m+1)+1}=S_{2m+1}-a_{2m+2}+a_{2m+3}\leq S_{2m+1}}$

while the even partial sums increase monotonically:

${\displaystyle S_{2(m+1)}=S_{2m}+a_{2m+1}-a_{2m+2}\geq S_{2m}}$

both because an decreases monotonically with n.

Moreover, since an are positive, ${\displaystyle S_{2m+1}-S_{2m}=a_{2m+1}\geq 0}$. Thus we can collect these facts to form the following suggestive inequality:

${\displaystyle a_{1}-a_{2}=S_{2}\leq S_{2m}\leq S_{2m+1}\leq S_{1}=a_{1}.}$

Now, note that a1 a2 is a lower bound of the monotonically decreasing sequence S2m+1, the monotone convergence theorem then implies that this sequence converges as m approaches infinity. Similarly, the sequence of even partial sum converges too.

Finally, they must converge to the same number because

${\displaystyle \lim _{m\to \infty }(S_{2m+1}-S_{2m})=\lim _{m\to \infty }a_{2m+1}=0.}$

Call the limit L, then the monotone convergence theorem also tells us an extra information that

${\displaystyle S_{2m}\leq L\leq S_{2m+1}}$

for any m. This means the partial sums of an alternating series also "alternates" above and below the final limit. More precisely, when there are odd (even) number of terms, i.e. the last term is a plus (minus) term, then the partial sum is above (below) the final limit.

This understanding leads immediately to an error bound of partial sums, shown below.

### Proof of partial sum error bound

We would like to show ${\displaystyle \left|S_{k}-L\right|\leq a_{k+1}\!}$ by splitting into two cases.

When k = 2m+1, i.e. odd, then

${\displaystyle \left|S_{2m+1}-L\right|=S_{2m+1}-L\leq S_{2m+1}-S_{2m+2}=a_{(2m+1)+1}}$

When k = 2m, i.e. even, then

${\displaystyle \left|S_{2m}-L\right|=L-S_{2m}\leq S_{2m+1}-S_{2m}=a_{2m+1}}$

as desired.

Both cases rely essentially on the last inequality derived in the previous proof.

For an alternative proof using Cauchy's convergence test, see Alternating series.

For a generalization, see Dirichlet's test.

## Counterexample

All of the conditions in the test, namely convergence to zero and monotonicity, should be met in order for the conclusion to be true. For example, take the series

${\displaystyle {\frac {1}{{\sqrt {2}}-1}}-{\frac {1}{{\sqrt {2}}+1}}+{\frac {1}{{\sqrt {3}}-1}}-{\frac {1}{{\sqrt {3}}+1}}+\cdots }$

The signs are alternating and the terms tend to zero. However, monotonicity is not present and we cannot apply the test. Actually the series is divergent. Indeed, for the partial sum ${\displaystyle S_{2n}}$ we have ${\displaystyle S_{2n}={\frac {2}{1}}+{\frac {2}{2}}+{\frac {2}{3}}+\cdots +{\frac {2}{n-1}}}$ which is twice the partial sum of the harmonic series, which is divergent. Hence the original series is divergent.

^ In practice, the first few terms may increase. What is important is that ${\displaystyle b_{n}\geq b_{n+1}}$ for all ${\displaystyle n}$ after some point.[2]