34. Alternating series; absolute vs. conditional convergence

📖 Reading · 10 min
💡 Every code box below is live — edit it and hit Run.

Every test since §7.5 has assumed positive terms — direct comparison, limit comparison, and the integral test all lean on that assumption in their proofs. This lesson lifts the restriction, starting with the simplest way negativity can enter: terms that alternate sign, where cancellation itself can carry a series to convergence even when the positive-term tests would say it shouldn't.

The alternating series test (Leibniz's test)

An alternating series has the form \sum(-1)^{n+1}b_n or \sum(-1)^nb_n, with b_n>0.

If b_n is decreasing (b_{n+1}\le b_n) and b_n\to0, then \sum(-1)^{n+1}b_n converges.

Why this works, geometrically. Plot the partial sums: S_1=b_1 is a step forward; S_2=b_1-b_2 steps back, but by a smaller amount (since b_2\le b_1), landing short of 0; S_3 steps forward again by a still smaller amount. The partial sums zigzag, each swing shrinking, closing in on a limit from both sides like a spring settling — the even-indexed partial sums increase, the odd-indexed ones decrease, both bounded, both converging to the same value by the Monotone Convergence Theorem (§7.1).

A useful bonus: the error bound. If S is the true sum, the alternating series test guarantees

|S-S_N|\le b_{N+1}

— the error after N terms is no larger than the first omitted term. This is a genuinely practical estimate, with no analogue in the positive-term tests: it tells you exactly how many terms to add for a desired accuracy, without knowing S itself.

Absolute vs. conditional convergence

Two different things can happen when a series has mixed-sign terms:

\sum a_n\text{ converges }\textbf{absolutely}\text{ if }\sum|a_n|\text{ converges}

\sum a_n\text{ converges }\textbf{conditionally}\text{ if }\sum a_n\text{ converges but }\sum|a_n|\text{ diverges}

Absolute convergence is the stronger property, and it implies ordinary convergence:

If \sum|a_n| converges, then \sum a_n converges.

This means every positive-term test in §7.5–§7.7 — divergence, integral, comparison, limit comparison — can be pointed at |a_n| to prove ordinary convergence of a_n, even when a_n itself has mixed signs. This is the main practical payoff of the whole idea: it extends the entire positive-term toolkit to mixed-sign series, at the cost of only proving convergence, not divergence (a series can fail to converge absolutely and still converge conditionally, so \sum|a_n| diverging settles nothing about \sum a_n by itself).

The alternating harmonic series is the standard example of conditional convergence:

\sum_{n=1}^\infty\frac{(-1)^{n+1}}n=1-\frac12+\frac13-\frac14+\cdots=\ln2

b_n=\frac1n is decreasing and \to0, so the alternating series test guarantees convergence — to \ln2, a fact provable with Taylor series in Module 8. But \sum\left|\frac{(-1)^{n+1}}n\right|=\sum\frac1n is exactly the harmonic series, which §7.5 proved diverges. Convergent, but only because of the alternating cancellation — strip the signs away and divergence reappears immediately.

Doing it in Python

The alternating harmonic series' partial sums, zigzagging in toward \ln2 from alternating sides:

from fractions import Fraction
import math

print(f"{'N':>4} {'S_N':>10}")
for N in (1, 5, 10, 20):
    S_N = sum(Fraction((-1)**(k+1), k) for k in range(1, N + 1))
    print(f"{N:>4} {float(S_N):>10.6f}")
print(f"\nln(2) = {math.log(2):.6f}  -- the partial sums oscillate toward this")

Confirming absolute vs. conditional convergence for two similar-looking alternating series:

import sympy as sp

n = sp.Symbol('n')

# conditionally convergent: alternating harmonic
absolute_sum_1 = sp.summation(1/n, (n, 1, sp.oo))
print(f"sum |(-1)^n / n|      = {absolute_sum_1}  -> diverges, only conditional")

# absolutely convergent: alternating 1/n^2
absolute_sum_2 = sp.summation(1/n**2, (n, 1, sp.oo))
print(f"sum |(-1)^n / n^2|    = {absolute_sum_2}  -> converges, so absolute")

Using the alternating series error bound to determine how many terms are needed for a given accuracy:

from fractions import Fraction

target_error = 0.001
b = lambda n: 1 / n   # terms of the alternating harmonic series

N = 1
while b(N + 1) > target_error:
    N += 1

print(f"need N = {N} terms so the error is at most b_(N+1) = {b(N+1):.6f}")
print(f"(no need to know the exact sum ln(2) to make this guarantee)")

Worked example

Determine whether \displaystyle\sum_{n=1}^\infty\dfrac{(-1)^{n+1}}{n^2} converges absolutely, conditionally, or diverges.

Check absolute convergence first — it's the stronger claim, and if it holds, the mixed-sign question is answered immediately.

\sum_{n=1}^\infty\left|\frac{(-1)^{n+1}}{n^2}\right|=\sum_{n=1}^\infty\frac1{n^2}

This is a p-series with p=2>1 — converges (§7.6).

\boxed{\text{converges absolutely}}

Since absolute convergence implies ordinary convergence, there's no need to separately invoke the alternating series test at all here — though it would confirm the same conclusion, since b_n=\frac1{n^2} is indeed decreasing and \to0.

Sanity check. Compare this to the alternating harmonic series: the only difference is the exponent, n^2 instead of n — and that single exponent change is exactly what moves the series from "converges only because of alternating cancellation" to "converges outright, cancellation or not." This mirrors §7.6's p-series threshold precisely: p=1 is where the un-alternated series stops converging, and it's also where conditional convergence (needing the sign flips to succeed) becomes the only way through. ✓

Your turn

1. Determine whether \displaystyle\sum_{n=1}^\infty\frac{(-1)^n}{\sqrt n} converges absolutely, conditionally, or diverges.

2. Using the alternating series error bound, how many terms of \displaystyle\sum_{n=1}^\infty\frac{(-1)^{n+1}}{n^3} are needed to guarantee an error under 0.0001?

3. True or false: every alternating series (terms alternating in sign) converges.

Solutions

1. Absolute series: \sum\left|\frac{(-1)^n}{\sqrt n}\right|=\sum\frac1{\sqrt n}, a p-series with p=\frac12<1 — diverges (§7.6). So not absolutely convergent. Check the alternating series test directly: b_n=\frac1{\sqrt n} is decreasing and \to0, so the series does converge.

\boxed{\text{converges conditionally}}

2. Need b_{N+1}=\frac1{(N+1)^3}<0.0001=\frac1{10000}, i.e. (N+1)^3>10000, i.e. N+1>10000^{1/3}\approx21.54, so N+1\ge22, \boxed{N\ge21} terms.

3. False. The alternating series test requires b_n to be decreasing (in addition to b_n\to0) — without that, a series can alternate sign and still fail to converge. For example, \sum(-1)^n\cdot\frac{2+(-1)^n}n alternates in overall sign trend but has terms that don't decrease monotonically, and more simply, \sum(-1)^n\cdot1 (terms -1,1,-1,1,\ldots, technically alternating but not shrinking at all, since b_n=1\not\to0) diverges by oscillation — already ruled out by the divergence test in §7.5. Alternating sign is a necessary setup for the test, not a guarantee of its conclusion.

Check yourself in code

Compute the partial sums S_N of the alternating harmonic series \sum(-1)^{n+1}/n for N=1,5,10,20, and compare to \ln2.

Print exactly this:

   1   1.000000
   5   0.783333
  10   0.645635
  20   0.668771
ln(2) = 0.693147
from fractions import Fraction
import math

for N in (1, 5, 10, 20):
    S_N = sum(Fraction((-1)**(k + 1), k) for k in range(1, N + 1))
    # print N and S_N as a decimal, right-aligned
    print(...)
print(f"ln(2) = {math.log(2):.6f}")
from fractions import Fraction
import math

for N in (1, 5, 10, 20):
    S_N = sum(Fraction((-1)**(k + 1), k) for k in range(1, N + 1))
    print(f"{N:>4} {float(S_N):>10.6f}")
print(f"ln(2) = {math.log(2):.6f}")

The alternating series test converts a decreasing, vanishing sequence of positive terms into a guaranteed-convergent alternating series, with a built-in error bound — the first omitted term — that no positive-term test provides. Absolute convergence (\sum|a_n| converging) is the stronger, more useful property, since it hands the entire positive-term toolkit back to a mixed-sign series and always implies ordinary convergence; conditional convergence is what's left when a series only survives because of its sign cancellations, the alternating harmonic series' \ln2 being the textbook case.

Next: two more tests, built specifically for series involving factorials and nth powers — exactly the terms that will dominate power series in Module 8.