Tests for Convergence
Adding up partial sums can fool you: the harmonic series looks like it is settling down but never does. A convergence test is a quick check that decides whether a series converges without finding its sum. This lesson states the standard tests a pre-calculus student should know, explains why each is believable, and shows how to try them numerically. Proofs come later in calculus.
A toolbox of tests
Here are the terms of . Most tests are for series with positive terms.
| Test | What you check | Conclusion |
|---|---|---|
| Divergence (-th term) | does ? | if not, the series diverges |
| Geometric | converges if , diverges otherwise | |
| p-series | converges if , diverges if | |
| Comparison | converges converges; diverges diverges | |
| Ratio | converges, diverges, no verdict | |
| Alternating series | signs alternate, shrinks to 0 | converges |
Note: The divergence test can only prove divergence. If it tells you nothing, and you must try another test.
p-series: the benchmark
The series are the yardsticks that other series are compared against. The harmonic series () diverges, but just a little more shrinkage, like , is enough to converge (to , a famous result by Euler).
import math
for p in [0.5, 1, 1.5, 2]:
row = []
for N in [10, 1_000, 100_000]:
row.append(sum(1 / n**p for n in range(1, N + 1)))
print(f"p = {p:<3}: " + " ".join(f"{s:10.4f}" for s in row))
print("pi^2/6 =", round(math.pi**2 / 6, 4))p = 0.5: 5.0210 61.8010 630.9968
p = 1 : 2.9290 7.4855 12.0901
p = 1.5: 1.9953 2.5491 2.6061
p = 2 : 1.5498 1.6439 1.6449
pi^2/6 = 1.6449
For and the totals keep climbing; for and 2 they level off. Notice how slowly settles: its true sum is about 2.612, and even 100 000 terms leave a gap of about 0.006.
Comparison
If your terms are smaller than the terms of a series that converges, your series converges too: the total is squeezed under a finite bound. If they are bigger than the terms of a divergent positive series, yours diverges.
The trick is to keep the biggest power on top and bottom: for large , behaves like , so you expect convergence, and comparison makes it official.
The ratio test
The ratio test asks: for large , how much does each term shrink compared with the one before? If the ratio settles at , the series eventually behaves like a geometric series with ratio , so it converges. It is the go-to test when terms contain factorials or powers like .
import math
def ratios(term, ns):
return [term(n + 1) / term(n) for n in ns]
ns = [1, 5, 10, 50, 100]
tests = {
"n / 2^n ": lambda n: n / 2**n,
"5^n / n! ": lambda n: 5**n / math.factorial(n),
"n^2 ": lambda n: n**2,
"1 / n^2 ": lambda n: 1 / n**2,
}
for name, term in tests.items():
print(name, " ".join(f"{r:.4f}" for r in ratios(term, ns)))n / 2^n 1.0000 0.6000 0.5500 0.5100 0.5050
5^n / n! 2.5000 0.8333 0.4545 0.0980 0.0495
n^2 4.0000 1.4400 1.2100 1.0404 1.0201
1 / n^2 0.2500 0.6944 0.8264 0.9612 0.9803
- : ratios , so it converges.
- : ratios . Factorials beat any power, so it converges (its sum is ).
- : ratios , but the terms grow, so the divergence test already settles it: diverges.
- : ratios too, so the ratio test gives no verdict even though the series converges (p-series, ). When , switch tests.
Alternating series
converges (to ) even though the harmonic series without the signs diverges. Each partial sum overshoots, then undershoots, and the swings shrink to zero. A bonus: the error after stopping is smaller than the first term you left out. Such a series is called conditionally convergent; if also converges it is absolutely convergent.
In software
Convergence matters any time code sums a series: approximating functions (Power Series), computing discounted rewards, or summing probabilities. The ratio test also explains why Taylor series with factorials in the denominator converge so fast that a dozen terms often reach full double precision. The proofs of these tests and the integral, limit comparison and root tests are in Convergence Tests and in depth in Comparison Tests, Alternating Series and Ratio and Root Tests.
Exercises
Exercise 1: Divergence test
Does converge?
Answer
No, it diverges.
Solution
Exercise 2: Pick the p
For each series, say converge or diverge: (a) , (b) , (c) .
Answer
(a) converges, (b) diverges, (c) converges.
Solution
Exercise 3: Comparison
Show that converges.
Answer
It converges, by comparison with .
Solution
Exercise 4: Ratio test in code
Use the ratio test on : compute the limit by hand, then print for .
Answer
, so the series converges.
Solution
for n in [10, 100, 1000]:
print(n, round(((n + 1) / n)**3 / 3, 6))10 0.443667
100 0.343434
1000 0.334334
Test yourself
The ratio test gives L = 1. What do you conclude?
- The series converges
- The series diverges
- Nothing: try another test
- The sum is 1
Which p-series converges?
Why does converge although diverges?
- Because the signs alternate and the term sizes shrink to 0
- Because its terms are negative
- Because it is geometric
- It does not converge