Unit 10 · Topic 10.10 · BC

Error of an alternating partial sum

Builds on partial sums, geometric series and the alternating series test. 12 minutes.

  1. Example 1Check that the alternating error bound applies
  2. Example 2Identify the first omitted term
  3. Example 3Bound the size and direction of the error
  4. Example 4Choose enough terms for a tolerance

An alternating series is a series whose terms \(a_n\) are positive and negative in turn. If their sizes \(\cy{b_n}=|a_n|\) decrease and approach 0, the series converges by the alternating series test (topic 10.7). The test does not give the sum \(S\). In practice, you add the first \(n\) terms and use this partial sum \(\cb{S_n}\) in place of \(S\). Its error is the tail after \(n\) terms (topic 10.1):

\[\cr{S-S_n}=a_{n+1}+a_{n+2}+a_{n+3}+\cdots\]

This topic shows that the size of the first term left out bounds this error, and on which side of \(S_n\) the sum lies. It then uses the bound to choose how many terms to add.

The sum lies between consecutive partial sums

A graph over n from 1 to 8. Teal dots show the partial sums of 1 − 2/3 + 4/9 − 8/27 and so on: 1, 0.33, 0.78, 0.48, 0.68, 0.55, 0.64 and 0.58. Neighboring dots are joined by green segments where the sum rises and red segments where it falls, and a dashed line marks the sum, 0.6. A faint strip runs from the partial sum S_n to the next one, S_(n+1), and an orange bracket at the right end of the strip marks its width. A slider sets n. A toggle changes the sizes to 1 over n cubed for odd n and 1 over n to the power 3/2 for even n; the red steps are then longer than the green steps before them, later partial sums lie below every strip, and the dashed line lies far below them, near 0.13.

Figure 1The teal dots are the partial sums \(\cb{S_n}\) of \(1-\frac23+\frac49-\cdots\), joined by green segments where the sum rises and red ones where it falls. The dashed line is the sum \(S\), and the orange bracket marks the width \(\cy{b_{n+1}}\) of the faint strip from \(S_n\) to \(S_{n+1}\).

Figure 1 shows the series \(1-\frac23+\frac49-\frac8{27}+\cdots\), with sizes \(b_n=\left(\frac23\right)^{n-1}\). It is geometric with ratio \(-\frac23\), so its sum is \(S=\frac{1}{1+2/3}=\frac35\) (topic 10.2), the height of the dashed line. The teal dot above \(n\) is the partial sum \(S_n\). Each segment from one dot to the next is a step that adds one term. It is green where the sum rises and red where it falls.

Because the signs alternate, each step goes the opposite way to the step before it. Because the sizes decrease, no step is longer than the step before it, so each step ends between the two partial sums before it. For example, \(S_3\) lies between \(S_1\) and \(S_2\). In Figure 1, the faint strip runs from \(S_n\) to \(S_{n+1}\). The partial sum \(S_{n+2}\) therefore lies in the strip. Next, \(S_{n+3}\) lies between \(S_{n+1}\) and \(S_{n+2}\), so it is in the strip too, and so on. Every partial sum after \(S_n\) stays in the strip.

Because the sizes decrease and approach 0, the alternating series test applies, and the partial sums approach \(S\). Suppose that \(S\) lay outside the strip, a distance \(d\) beyond its nearer edge. Then every partial sum after \(S_n\) would stay at least \(d\) away from \(S\), and the partial sums could not approach \(S\). Therefore \(S\) lies between \(S_n\) and \(S_{n+1}\), inside the strip or on one of its edges.

The step from \(S_n\) to \(S_{n+1}\) adds the term \(a_{n+1}\), the first omitted term, which is the first term that \(S_n\) leaves out. The size \(\cy{b_{n+1}}\) of this term is the width of the strip, which the orange bracket marks. The distance from \(S_n\) to \(S\) is at most this width, so \(|S-S_n|\le b_{n+1}\). This result is the alternating series error bound, which some books call the Alternating Series Estimation Theorem.

Move \(n\) with the slider. At every \(n\), the dashed line lies in the strip. The readouts under the figure give the error \(S-S_n\) and the next term \(a_{n+1}\), and the error is the smaller of the two in size.

The strip lies on the side of \(S_n\) toward \(S_{n+1}=S_n+a_{n+1}\). If \(a_{n+1}>0\), then \(S\ge S_n\), and if \(a_{n+1}<0\), then \(S\le S_n\). If each size is less than the one before it, \(S\) is not \(S_n\) itself. The same argument, applied to \(S_{n+1}\), puts \(S\) between \(S_{n+1}\) and \(S_{n+2}\), and this second strip does not reach \(S_n\), because \(b_{n+2}<b_{n+1}\). The error \(S-S_n\) then has the sign of \(a_{n+1}\). The partial sum \(S_n\) underestimates \(S\) when \(a_{n+1}>0\) and overestimates it when \(a_{n+1}<0\).

In Figure 1, the first term is positive, so the dots with odd \(n\) lie above \(S\) and the others lie below it. If the first term is negative, the two sides swap. Read the direction from the sign of \(a_{n+1}\), not from \(n\).

The argument for \(S_n\) uses only the steps after \(S_n\). The sizes therefore need to decrease only from \(b_{n+1}\) on, \(b_{n+1}\ge b_{n+2}\ge\cdots\), and the sizes of the terms in \(S_n\) may rise and fall. If the sizes do not approach 0, the terms do not approach 0. The series then diverges by the nth-term test (topic 10.3), and there is no sum to approximate.

The toggle under Figure 1 changes the sizes to \(\frac1{n^3}\) for odd \(n\) and \(\frac1{n^{3/2}}\) for even \(n\). This series converges absolutely by comparison with \(\sum\frac1{n^{3/2}}\) (topic 10.9), and its sizes approach 0, but \(b_4>b_3\), \(b_6>b_5\), and so on. From \(b_4\) on, each red step down is longer than the green step before it, so later partial sums lie below every strip. The dashed line moves to the new sum, below the strip at every \(n\), and the error is larger in size than the next term.

The first omitted term

To find the first omitted term, count the terms by position, not by index. If the index starts at 1, as above, the first \(n\) terms are \(a_1\) to \(a_n\), and the first omitted term is \(a_{n+1}\). If the index starts at 0, the first \(n\) terms are \(a_0\) to \(a_{n-1}\). The first omitted term is then \(a_n\), and the error bound for \(S_n\) is \(b_n\). A sum given by its last term, such as \(a_0+a_1+\cdots+a_6\), has seven terms, and its first omitted term is \(a_7\).

Enough terms for a tolerance

A tolerance is the largest error that you accept. Write it as \(\varepsilon\), the Greek letter epsilon. If \(b_{n+1}\le\varepsilon\), the error bound gives \(|S-S_n|\le\varepsilon\). To find how many terms guarantee this, solve \(b_{n+1}\le\varepsilon\) for \(n\). Round the solution up to a whole number. This whole number is the fewest terms for which the bound guarantees the tolerance, and because the sizes decrease, every larger \(n\) works too. The actual error can be smaller, so fewer terms may happen to be close enough, but the bound cannot show it.

Example 1

Check that the alternating error bound applies

Let \(S\) be the sum of \(\displaystyle\sum_{n=1}^{\infty}(-1)^{n+1}\frac{n}{n^2+16}\). For which partial sums \(S_n\) does the alternating series error bound apply? Use it to bound \(|S-S_3|\).

Solution

The factor \((-1)^{n+1}\) makes the signs alternate, and the sizes are \(b_n=\frac{n}{n^2+16}\). Dividing the top and the bottom by \(n^2\) gives \(\frac{1/n}{1+16/n^2}\), so the sizes approach 0. For the decrease, let \(f(x)=\frac{x}{x^2+16}\), so that \(b_n=f(n)\). By the quotient rule,

\[\begin{aligned}f'(x)&=\frac{\left(x^2+16\right)-x\cdot2x}{\left(x^2+16\right)^2}\\&=\frac{16-x^2}{\left(x^2+16\right)^2}\end{aligned}\]

This is negative for \(x>4\), so \(f\) decreases on \([4,\infty)\), and \(b_4\ge b_5\ge b_6\ge\cdots\). Before that the sizes rise, and \(b_3=\frac3{25}\) is less than \(b_4=\frac18\). The bound for \(S_n\) needs the sizes to decrease from \(b_{n+1}\) on, so it applies when \(n+1\ge4\), that is, for \(n\ge3\). For \(S_3\), it gives

\[|S-S_3|\le b_4=\frac{4}{32}=\frac18\]

Example 2

Identify the first omitted term

Let \(S_5\) be the sum of the first five terms of \(\displaystyle\sum_{n=0}^{\infty}\frac{(-1)^n}{(n+2)!}\), and let \(S\) be the sum of the series. Identify the first omitted term, and use it to bound \(|S-S_5|\).

Solution

The signs alternate. The sizes \(\frac1{(n+2)!}\) decrease, because each factorial is the one before it times a factor greater than 1. They approach 0, because \((n+2)!\ge n+2\), so the bound applies. The index starts at 0, so the first five terms have the indexes 0 to 4:

\[S_5=\frac1{2!}-\frac1{3!}+\frac1{4!}-\frac1{5!}+\frac1{6!}\]

The first omitted term is the next one, with the index 5:

\[a_5=\frac{(-1)^5}{7!}=-\frac1{5040}\]

Its size bounds the error, so \(|S-S_5|\le\frac1{5040}\).

Example 3

Bound the size and direction of the error

The partial sum \(S_4\) approximates the sum \(S\) of \(\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^n}{n\,2^n}\). Use the alternating series error bound to bound \(|S-S_4|\), and determine whether \(S_4\) is greater than or less than \(S\).

Solution

The signs alternate, and the sizes \(\frac1{n\,2^n}\) strictly decrease to 0, because \(n\,2^n\) increases without bound. The first four terms give

\[\begin{aligned}S_4&=-\frac12+\frac18-\frac1{24}+\frac1{64}\\&=-\frac{77}{192}\end{aligned}\]

The first omitted term is

\[a_5=\frac{(-1)^5}{5\cdot2^5}=-\frac1{160}\]

Its size bounds the error, so \(|S-S_4|\le\frac1{160}\). The term \(a_5\) is negative, so \(S\) lies below \(S_4\). The term \(a_6\), the first one that \(S_5\) leaves out, is positive, so \(S\) lies above \(S_5=S_4-\frac1{160}\):

\[-\frac{391}{960}<S<-\frac{77}{192}\]

Therefore \(S_4\) is greater than \(S\), by at most \(\frac1{160}\).

Example 4

Choose enough terms for a tolerance

Find the least number of terms of \(\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n^3}\) for which the alternating series error bound guarantees an error of at most 0.0005.

Solution

The signs alternate, and the sizes \(b_n=\frac1{n^3}\) decrease to 0, so the bound applies to every partial sum. The error of \(S_n\) is at most \(b_{n+1}=\frac1{(n+1)^3}\), so require \(b_{n+1}\le0.0005\). Both sides are positive, so taking reciprocals reverses the inequality:

\[\begin{aligned}\frac1{(n+1)^3}&\le0.0005\\ (n+1)^3&\ge2000\end{aligned}\]

Taking cube roots gives \(n+1\ge\sqrt[3]{2000}\approx12.6\). Because \(n+1\) is a whole number, the least choice is \(n+1=13\), so \(n=12\). With 12 terms, the bound is \(b_{13}=\frac1{2197}\), which is at most 0.0005. With 11 terms, it is \(b_{12}=\frac1{1728}\), which is larger, so 11 terms are not enough for the bound. The least number is 12.

Each example is one of the four skills of topic 10.10 in Which & Why: AP Calculus.