8.5 Alternating Series
When the signs take turns, terms that shrink steadily to zero are enough for convergence โ and the error is never bigger than the first term you leave out.
In Section 8.2 we met a disappointing fact: the harmonic series $1+\tfrac12+\tfrac13+\tfrac14+\cdots$ diverges, even though its terms shrink to zero. The partial sums creep upward forever. Now flip every second sign: $$1-\frac12+\frac13-\frac14+\frac15-\cdots$$ Each step now goes the other way, and by a smaller amount than the step before. Up by $1$, down by $\tfrac12$, up by $\tfrac13$, down by $\tfrac14$โฆ The partial sums zig-zag, overshooting and undershooting, but the swings keep getting narrower. It is hard to believe they could wander off to infinity โ and indeed they don't.
Series whose signs alternate appear everywhere: in the Taylor series of $\sin x$, $\cos x$ and $\ln(1+x)$ (Chapter 9), in Fourier series used in signal processing, and in physics whenever successive corrections push in opposite directions. In this section we find a very simple test for their convergence, and โ just as useful in practice โ a free, guaranteed error bound for every partial sum. We then separate series that converge robustly (absolutely) from series that converge only thanks to the cancellation between signs (conditionally), and see the surprising things that can happen to the second kind.
Alternating Series and the Alternating Series Test
For example, $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n}$ (the alternating harmonic series), $\displaystyle\sum_{n=0}^{\infty}\frac{(-1)^n}{2n+1}=1-\frac13+\frac15-\cdots$ and $\displaystyle\sum_{n=1}^{\infty}\cos(n\pi)\,\frac1{n^2}$ (because $\cos(n\pi)=(-1)^n$) are all alternating. A series such as $\displaystyle\sum\frac{\sin n}{n^2}$ is not alternating: its signs follow an irregular pattern.
- $b_n\gt 0$ for all $n$;
- the sizes are eventually decreasing: there is an index $N_0$ with $b_{n+1}\le b_n$ for all $n\ge N_0$;
- $\displaystyle\lim_{n\to\infty}b_n=0$.
Why it works. Take the case $\sum(-1)^{n+1}b_n$ with $b_n$ decreasing from the very first term. Group the even partial sums in pairs: $$S_{2k}=(b_1-b_2)+(b_3-b_4)+\cdots+(b_{2k-1}-b_{2k}).$$ Every bracket is $\ge 0$, so $S_2\le S_4\le S_6\le\cdots$ is increasing. Grouping differently, $$S_{2k}=b_1-(b_2-b_3)-(b_4-b_5)-\cdots-(b_{2k-2}-b_{2k-1})-b_{2k}\le b_1,$$ so the even partial sums are bounded above. By the Monotone Convergence Theorem for sequences (Section 8.1) they converge to some number $S$. Finally $S_{2k+1}=S_{2k}+b_{2k+1}$ and $b_{2k+1}\to 0$, so the odd partial sums converge to the same $S$. Hence $S_n\to S$. (If the decrease only starts at $N_0$, the first $N_0$ terms change the sum but not whether it exists.) Interactive 1 below lets you watch exactly this: even sums climbing, odd sums falling, the two closing in from either side.
1. Forgetting the decrease condition. $b_n\to0$ alone is not enough. Consider $$1-\frac14+\frac13-\frac1{16}+\frac15-\frac1{36}+\cdots,$$ where the positive terms are $\frac1{2k-1}$ and the negative terms are $\frac1{(2k)^2}$. The signs alternate and the terms tend to $0$, but the sizes are not decreasing ($\tfrac14\lt\tfrac13$). The sum of the first $2k$ terms is $\displaystyle\sum_{j=1}^{k}\frac1{2j-1}-\sum_{j=1}^{k}\frac1{4j^2}$; the first sum grows without bound (it is larger than $\tfrac12\sum_{j=1}^k\tfrac1j$) while the second stays below $\tfrac{\pi^2}{24}$. So this series diverges.
2. Using the AST to "prove" divergence. If a hypothesis fails, the AST simply says nothing. Check $\lim a_n$ with the divergence test instead (as in Example 2(b)).
3. Mixing up $a_n$ and $b_n$. The conditions are on the positive sizes $b_n=|a_n|$, not on the signed terms $a_n$ (which are certainly not decreasing!).
Estimating the Sum: the Alternating Series Remainder
Most series cannot be summed exactly, so we stop after $N$ terms and use $S_N$ as an approximation. The remainder $R_N=S-S_N$ is the error we make. For general series, bounding $R_N$ takes work (Sections 8.3 and 8.4). For alternating series it is almost free: the true sum is always trapped between two consecutive partial sums.
Why. The tail $R_N=(-1)^{N+2}\left(b_{N+1}-b_{N+2}+b_{N+3}-\cdots\right)$ is itself an alternating series with decreasing sizes. By the grouping argument above, the bracket lies between $0$ and its first term $b_{N+1}$. So $|R_N|\le b_{N+1}$, and the sign of $R_N$ is the sign of the first omitted term.
Absolute and Conditional Convergence
The series $\sum\frac{(-1)^{n+1}}{n^2}$ and $\sum\frac{(-1)^{n+1}}{n}$ both converge, but for very different reasons. The first would converge even if we made every sign positive ($\sum\frac1{n^2}$ is a convergent $p$-series). The second converges only because positive and negative terms cancel; make the signs positive and it diverges. This distinction matters a great deal.
- absolutely convergent if the series of absolute values $\sum|a_n|$ converges;
- conditionally convergent if $\sum a_n$ converges but $\sum|a_n|$ diverges.
Why. For every $n$, $-|a_n|\le a_n\le|a_n|$, so $0\le a_n+|a_n|\le2|a_n|$. Since $\sum2|a_n|$ converges, the Comparison Test (Section 8.4) shows that $\sum(a_n+|a_n|)$ converges. Then $\sum a_n=\sum(a_n+|a_n|)-\sum|a_n|$ is the difference of two convergent series, so it converges. This theorem is powerful because it lets us use all our tests for positive series (comparison, integral, and โ in Section 8.6 โ ratio and root) on series whose signs are mixed, even irregularly.
- Check $\lim a_n$. If it is not $0$, the series diverges (divergence test). Stop.
- Test $\sum|a_n|$ with a positive-series test. If it converges, $\sum a_n$ is absolutely convergent. Stop.
- If $\sum|a_n|$ diverges and the series is alternating, try the AST. If it applies, the series is conditionally convergent.
The Sum $\ln 2$ and Rearrangements
Why. For $t\ne-1$ the finite geometric sum gives $1-t+t^2-\cdots+(-1)^{N-1}t^{N-1}=\dfrac{1-(-t)^N}{1+t}$. Integrate both sides from $0$ to $1$: $$\underbrace{1-\frac12+\frac13-\cdots+\frac{(-1)^{N-1}}{N}}_{S_N}=\int_0^1\frac{dt}{1+t}-(-1)^N\int_0^1\frac{t^N}{1+t}\,dt=\ln2-(-1)^N\int_0^1\frac{t^N}{1+t}\,dt.$$ Since $0\le\dfrac{t^N}{1+t}\le t^N$ on $[0,1]$, the last integral lies between $0$ and $\displaystyle\int_0^1t^N\,dt=\frac1{N+1}$, which tends to $0$. Hence $S_N\to\ln2$. (Notice the error bound $\frac1{N+1}=b_{N+1}$ โ exactly Theorem 8.18.)
For a finite sum, the order of the terms never matters. For an infinite series it can. Watch what happens if we take the alternating harmonic series and write one positive term followed by two negative terms: $$\left(1-\frac12\right)-\frac14+\left(\frac13-\frac16\right)-\frac18+\left(\frac15-\frac1{10}\right)-\frac1{12}+\cdots=\frac12-\frac14+\frac16-\frac18+\frac1{10}-\frac1{12}+\cdots=\frac12\ln2.$$ Every term of the original series appears exactly once โ yet the sum has been halved! This is no trick of notation: the partial sums of the rearranged series really do converge to $\tfrac12\ln 2\approx0.3466$.
- If $\sum a_n$ is absolutely convergent with sum $S$, then every rearrangement of $\sum a_n$ also converges, with the same sum $S$.
- If $\sum a_n$ is conditionally convergent and $T$ is any real number, there is a rearrangement of $\sum a_n$ whose sum is $T$. There are also rearrangements that diverge to $+\infty$ or $-\infty$.
The idea behind part 2 is simple. In a conditionally convergent series, the positive terms alone add up to $+\infty$ and the negative terms alone add up to $-\infty$ (otherwise the series would converge absolutely), yet the individual terms tend to $0$. So: add positive terms until you pass $T$, then negative terms until you fall below $T$, then positive terms again, and so on. Each overshoot is at most the size of the last term used, which tends to $0$, so the partial sums close in on $T$. Interactive 2 runs this recipe.
A conditionally convergent series is delicate: its sum depends on the order in which the terms are added, so you must keep the terms in their given order and must not regroup infinitely many terms carelessly. An absolutely convergent series is robust: you may reorder, regroup or split it into its positive and negative parts and the sum will not change. This is one reason mathematicians, engineers and physicists like to establish absolute convergence whenever they can โ and why the ratio and root tests of Section 8.6, which prove absolute convergence, are so popular.
Exercises
- 1 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{2n-1}$
- 2 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n}}{\sqrt{n+1}}$
- 3 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}\,n}{3n+2}$
- 4 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n}}{\ln(n+1)}$
- 5 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}\,n}{n^2+4}$
- 6 $\displaystyle\sum_{n=1}^{\infty}(-1)^{n}\,n\,e^{-n}$
- 7 $\displaystyle\sum_{n=1}^{\infty}(-1)^{n+1}\,\frac{n+1}{n}$
- 8 $\displaystyle\sum_{n=1}^{\infty}(-1)^{n}\cos\left(\frac{\pi}{n}\right)$
- 9 $\displaystyle\sum_{n=1}^{\infty}(-1)^{n+1}\sin\left(\frac1n\right)$
- 10 $\displaystyle\sum_{n=1}^{\infty}\frac{\cos(n\pi)}{n^{2/3}}$
- 11 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n}\sqrt n}{n+5}$
- 1 How many terms of $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^2}$ are needed to guarantee an error less than $0.001$?
- 2 How many terms of $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^4}$ are needed to guarantee an error less than $10^{-4}$?
- 3 The series $\displaystyle\sum_{n=0}^{\infty}\frac{(-1)^n}{2n+1}$ has sum $\dfrac{\pi}{4}$. How many terms guarantee an error less than $10^{-3}$? What accuracy does that give for $\pi$ itself?
- 4 Approximate $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n\,2^n}$ with error less than $0.0005$. (Its exact value is $\ln\tfrac32$.)
- 5 Bound the error made by approximating $\dfrac1e=\displaystyle\sum_{n=0}^{\infty}\frac{(-1)^n}{n!}$ with the first six terms ($n=0$ to $5$). Compare with the actual error.
- 6 Compute $S_{10}$ for $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n}$ and give its error bound. Without using a calculator for $\ln 2$, decide whether $S_{10}$ is above or below the sum.
- 7 Use $S_4$ and $S_5$ to find an interval that contains $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^2}$.
- 8 Show that $b_n=\dfrac{n}{4^n}$ is decreasing, then find how many terms of $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}n}{4^n}$ guarantee an error less than $0.001$. Compute the estimate.
- 1 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^n}{n^{3/2}}$
- 2 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{\sqrt[3]{n}}$
- 3 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n}\,n^2}{n^3+1}$
- 4 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n}}{n^2+1}$
- 5 $\displaystyle\sum_{n=1}^{\infty}(-1)^{n+1}\left(\frac23\right)^n$
- 6 $\displaystyle\sum_{n=1}^{\infty}\frac{\cos n}{n^2}$
- 7 $\displaystyle\sum_{n=2}^{\infty}\frac{(-1)^{n}\ln n}{n}$
- 8 $\displaystyle\sum_{n=1}^{\infty}(-1)^{n}\,\frac{n+1}{n}$
- 9 $\displaystyle\sum_{n=2}^{\infty}\frac{(-1)^{n+1}}{n\ln n}$
- 10 $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n}}{\sqrt n\,(n+1)}$
- 1 Applied. A cleaning robot on a straight corridor moves $1$ m forward, then $\tfrac12$ m back, then $\tfrac13$ m forward, $\tfrac14$ m back, and so on. Where does it end up (relative to its start)? How many moves guarantee that it is within $1$ cm of that final position?
- 2 Show that the rearrangement $1-\tfrac12-\tfrac14+\tfrac13-\tfrac16-\tfrac18+\tfrac15-\tfrac1{10}-\tfrac1{12}+\cdots$ has sum $\tfrac12\ln2$. (Hint: combine the first two terms of each group of three.)
- 3 True or false? Justify. (a) If $\sum a_n$ converges, then $\sum|a_n|$ converges. (b) If $\sum|a_n|$ converges, then $\sum(-1)^na_n$ converges. (c) If $b_n\gt0$ and $b_n\to0$, then $\sum(-1)^nb_n$ converges. (d) For a series satisfying the AST with decreasing $b_n$, consecutive partial sums lie on opposite sides of the sum.
- 4 For which real numbers $p$ is $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^p}$ absolutely convergent, conditionally convergent, divergent?
- 5 Applied. A damped pendulum's successive half-swings move the bob by signed displacements $d_n=(-1)^{n+1}\,20\,(0.9)^{n-1}$ cm. Find the total net displacement $\sum d_n$, and use Theorem 8.18 to find how many half-swings guarantee that the partial sum is within $0.5$ cm of it.
Research question. Can we squeeze far more accuracy out of a slowly converging alternating series than the bound $b_{N+1}$ suggests?
Why it matters. The series $1-\tfrac13+\tfrac15-\cdots=\tfrac\pi4$ was found by the Kerala mathematician Madhava around 1400 and rediscovered in Europe centuries later. It converges painfully slowly, yet Madhava computed $\pi$ to 11 decimal places โ by adding clever correction terms. Today, numerical analysts use "series acceleration" to speed up slowly converging sums in physics simulations, finance and signal processing.
What to do.
- In a spreadsheet, list $n=0,1,\dots,60$, the terms $\frac{(-1)^n}{2n+1}$, and the partial sums $S_N$ (sum of the first $N$ terms). Plot $4S_N-\pi$ against $N$.
- Confirm that $|\tfrac\pi4-S_N|\le\tfrac1{2N+1}$ for every $N$, and that $\tfrac\pi4$ always lies between $S_N$ and $S_{N+1}$.
- Because the sum lies between consecutive partial sums, try their average $A_N=\tfrac12(S_N+S_{N+1})$. Compare the errors $|4A_N-\pi|$ and $|4S_N-\pi|$ at $N=50$.
- Average again: $B_N=\tfrac12(A_N+A_{N+1})$, then a third time. How many correct decimal places do you gain each time?
- Explain, using the zig-zag picture of Interactive 1, why averaging helps.
Tools: Spreadsheet or Python; Interactive 1 above.
Hand in: A one-page note with a table of errors for $S_{50}$, $A_{50}$, $B_{50}$ and the third average, a log-scale plot, and a two-sentence explanation.
Going further. Try the same averaging on the alternating harmonic series ($\ln2$) and on $\sum\frac{(-1)^{n+1}}{\sqrt n}$. Does it work equally well? Look up the "Euler transform" of a series.
๐งช Self-check quiz
Q1. Which of these is not a hypothesis of the alternating series test for $\sum(-1)^{n+1}b_n$?
Q2. We approximate $\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^2}$ by the sum of its first $9$ terms. The error is at most
Q3. The series $\sum_{n=1}^{\infty}\frac{(-1)^n}{\sqrt n}$ is
Q4. $1-\tfrac12+\tfrac13-\tfrac14+\cdots=$
Q5. By Riemann's theorem, the terms of a conditionally convergent series can be rearranged to give