31. The divergence test and the harmonic series
§7.2 noted that a series' terms must shrink to zero for the series to have any hope of converging, and §7.3 flagged the harmonic series as a case where that necessary condition holds and convergence still fails. This lesson turns the first observation into a formal, one-line test, and then proves the second — the harmonic series really does diverge, with one of the oldest and most elegant arguments in this course.
The divergence test
If \displaystyle\lim_{n\to\infty}a_n\ne0 (or the limit doesn't exist), then \displaystyle\sum_{n=1}^\infty a_n diverges.
Why this works: if a series converges to S, then S_N\to S and also S_{N-1}\to S (the same limit, one step behind). Since a_N=S_N-S_{N-1}, taking the limit of both sides gives \lim_{N\to\infty}a_N=S-S=0. Convergence forces terms to vanish — so if they don't, convergence is impossible. This is exactly the contrapositive of the necessary condition §7.2 already noticed informally.
What this test can never do: prove convergence. If a_n\to0, the test gives no information — the series might converge (like \sum\frac1{2^n}) or diverge (like the harmonic series, coming up next). The divergence test is a one-way filter: useful for instantly ruling series out, useless for ruling them in.
Fast application: \sum\frac n{n+1} has a_n=\frac n{n+1}\to1\ne0 (§7.0's technique: divide by n) — diverges immediately, no partial-sum analysis needed at all.
The harmonic series diverges
\sum_{n=1}^\infty\frac1n=1+\frac12+\frac13+\frac14+\cdots
Here a_n=\frac1n\to0 — the divergence test says nothing. A direct argument is needed, and the classic one (due to Nicole Oresme, 14th century) groups the terms into clusters whose sizes double each time, and shows every cluster contributes at least \frac12:
1+\underbrace{\frac12}_{\ge\frac12}+\underbrace{\left(\frac13+\frac14\right)}_{\ge\frac14+\frac14=\frac12}+\underbrace{\left(\frac15+\frac16+\frac17+\frac18\right)}_{\ge\frac18\cdot4=\frac12}+\cdots
Each group's terms are all at least as large as the group's smallest term, so replacing every term in a group with its smallest member can only shrink the group's sum — and that replacement always sums to exactly \frac12 (group size 2^{k-1}, smallest term \frac1{2^k}, product \frac{2^{k-1}}{2^k}=\frac12). With infinitely many groups, each contributing at least \frac12, the partial sums grow without bound:
S_{2^K}\ge1+\frac K2\ \xrightarrow{K\to\infty}\ \infty
\boxed{\sum_{n=1}^\infty\frac1n\text{ diverges}}
This is a genuine surprise worth sitting with. The harmonic series' terms shrink to zero — exactly as required by the divergence test — and yet the sum still grows without bound. It just does so at a punishing pace: the partial sums grow like \ln N (a fact confirmed numerically below), which means reaching a partial sum of just 100 requires roughly e^{100} terms — a number vastly larger than the count of atoms in the observable universe. Divergence to infinity and "practically indistinguishable from convergence at any computable scale" are not the same thing, and the harmonic series is the standard example proving it.
Doing it in Python
Confirming each Oresme group sums to at least \frac12:
for k in range(1, 6):
lo, hi = 2**(k-1) + 1, 2**k
group_sum = sum(1/i for i in range(lo, hi + 1))
print(f"group {k}: terms 1/{lo} through 1/{hi}, sum = {group_sum:.4f}")
print("\nevery group sum >= 0.5, and there are infinitely many groups")
Watching the harmonic series' partial sums grow, and comparing to \ln N+\gamma (the Euler-Mascheroni constant, \gamma\approx0.5772) — the asymptotic growth rate that makes the slow divergence precise:
import math
gamma = 0.5772156649
print(f"{'N':>10} {'ln(N) + gamma':>15}")
for N in (10, 100, 1000, 1000000):
approx = math.log(N) + gamma
print(f"{N:>10} {approx:>15.6f}")
print("\npartial sums grow like ln(N) -- unboundedly, but agonizingly slowly")
The divergence test applied instantly to a series that would be painful to attack any other way:
import sympy as sp
n = sp.Symbol('n')
a_n = n / (n + 1)
limit = sp.limit(a_n, n, sp.oo)
print(f"lim a_n = {limit}")
print(f"series diverges (divergence test): {limit != 0}")
Worked example
Determine whether \displaystyle\sum_{n=1}^\infty\frac{2n^2+1}{n^2+3} converges or diverges.
Check the divergence test first, since it's the cheapest thing to try:
\lim_{n\to\infty}\frac{2n^2+1}{n^2+3}=\lim_{n\to\infty}\frac{2+\frac1{n^2}}{1+\frac3{n^2}}=\frac{2+0}{1+0}=2
(§7.0's divide-by-the-highest-power technique.) The limit is 2\ne0.
\boxed{\text{diverges, by the divergence test}}
Sanity check. For large n, a_n\approx\frac{2n^2}{n^2}=2 — the terms approach 2, not 0, so the series is really just adding numbers close to 2 over and over, forever. Any series whose terms settle near a nonzero constant obviously can't have bounded partial sums — this is the divergence test's whole content, made visible. ✓
Your turn
1. Apply the divergence test to \displaystyle\sum_{n=1}^\infty\cos\!\left(\frac1n\right).
2. Apply the divergence test to \displaystyle\sum_{n=1}^\infty\frac1{\sqrt n} — what does it conclude, and what does it not conclude?
3. True or false: the divergence test proves \displaystyle\sum_{n=1}^\infty\frac1{n^2} converges, since \frac1{n^2}\to0.
Solutions
1. \cos\!\left(\frac1n\right)\to\cos(0)=1\ne0 as n\to\infty (continuity of cosine, §1.7, applied to \frac1n\to0).
\boxed{\text{diverges, by the divergence test}}
2. \frac1{\sqrt n}\to0, so the divergence test gives no conclusion — it neither proves nor disproves convergence. (This series does, in fact, diverge — it's a p-series with p=\frac12<1, a family §7.6 covers next — but that requires a different tool entirely; the divergence test alone cannot settle it.)
3. False. The divergence test can never prove convergence — it is strictly a one-way filter for ruling divergence in. \frac1{n^2}\to0 only tells you the test is inconclusive, not that the series converges (even though, as it happens, \sum\frac1{n^2} genuinely does converge — to \frac{\pi^2}6, as seen numerically back in §7.2 — but that fact needs a different argument, coming in §7.6).
Check yourself in code
Compute the harmonic series' partial sum group totals for k=1 through 5 (group k runs from \frac1{2^{k-1}+1} to \frac1{2^k}), confirming each is at least 0.5.
Print exactly this:
group 1: terms 2..2, sum=0.5000
group 2: terms 3..4, sum=0.5833
group 3: terms 5..8, sum=0.6345
group 4: terms 9..16, sum=0.6629
group 5: terms 17..32, sum=0.6778
for k in range(1, 6):
lo, hi = 2**(k - 1) + 1, 2**k
group_sum = sum(1 / i for i in range(lo, hi + 1))
print(f"group {k}: terms {lo}..{hi}, sum=...")
for k in range(1, 6):
lo, hi = 2**(k - 1) + 1, 2**k
group_sum = sum(1 / i for i in range(lo, hi + 1))
print(f"group {k}: terms {lo}..{hi}, sum={group_sum:.4f}")
The divergence test says a series can only converge if its terms shrink to zero — a direct consequence of a_N=S_N-S_{N-1} and both sequences sharing a limit — but it only ever rules out convergence, never proves it. The harmonic series is the test's most famous blind spot: its terms vanish, and yet Oresme's grouping argument shows the partial sums still climb without bound, just so slowly (like \ln N) that no realistic amount of computation could ever reveal the divergence by brute-force summing alone.
Next: a general-purpose tool for exactly the harmonic series' blind spot — comparing a series to an integral, which settles convergence for an entire family of series, harmonic included, in one stroke.