The Integral Test

Suppose you keep adding ever-smaller amounts forever — the fading echoes of a sound, or the growing overhang of a stack of books each nudged a little further than the last. Does the running total settle on a finite answer, or grow without limit? The integral test decides by trading the impossible sum for an area you can actually measure.

Infinite sums are awkward. You can't add up infinitely many numbers one by one, and most series have no tidy closed form to check against. But by now you own a machine that computes infinitely many contributions in one stroke: the integral. The Fundamental Theorem of Calculus turns "area stretching to infinity" into "find an antiderivative and take a limit" — a two-line computation. So here is the trade of the century: swap the sum you can't do for an integral you can.

The swap is legal whenever the terms of the series come from a curve. If a_n = f(n) for a positive, decreasing function f, then the series is a staircase of unit-wide rectangles and the integral is the smooth area under the curve those rectangles are hugging. Slide the staircase one unit sideways and it swaps from sitting above the curve to fitting below it — so the sum and the area under the curve differ by at most a single column of rectangles. They are within touching distance of each other forever, and therefore must share the same fate:

a_n = f(n), \quad f \text{ positive, decreasing} \;\;\Longrightarrow\;\; \sum_{n=1}^{\infty} a_n \text{ and } \int_{1}^{\infty} f(x)\,dx \text{ converge together.}

A question about an infinite sum has become a question about an improper integral — a question you already know how to answer. This is the test that finally settles the p-series \sum 1/n^p for every exponent at once, including pinning down exactly where the harmonic series tips over into divergence.

The rectangle sandwich

Everything in this test — the verdict, the error bounds, even the fine print about "decreasing" — is read off one picture: unit-wide rectangles stacked against a falling curve. Fix a positive, decreasing function f with a_n = f(n), and draw the rectangles twice.

Step 1 — over-estimate the area with left rectangles. On each interval [k, k+1] the function is decreasing, so its biggest value is at the left end, f(k) = a_k. A rectangle of height a_k and width 1 therefore covers the area under the curve on that strip:

a_k \;\ge\; \int_{k}^{k+1} f(x)\,dx.

Step 2 — sum the left rectangles from 1 to n. The integrals join up end to end into one big integral:

\sum_{k=1}^{n} a_k \;\ge\; \sum_{k=1}^{n} \int_{k}^{k+1} f(x)\,dx = \int_{1}^{n+1} f(x)\,dx.

Step 3 — under-estimate the area with right rectangles. Now slide the staircase one unit to the left. The smallest value on [k-1, k] is at the right end, f(k) = a_k, so the same rectangle now fits underneath the curve:

a_k \;\le\; \int_{k-1}^{k} f(x)\,dx.

Step 4 — sum the right rectangles from 2 to n (the first term a_1 has no strip to its left, so set it aside):

\sum_{k=2}^{n} a_k \;\le\; \int_{1}^{n} f(x)\,dx, \qquad\text{so}\qquad \sum_{k=1}^{n} a_k \;\le\; a_1 + \int_{1}^{n} f(x)\,dx.

Step 5 — the sandwich. Stacking Steps 2 and 4 traps the partial sum s_n = \sum_{k=1}^{n} a_k between two integrals:

\int_{1}^{n+1} f(x)\,dx \;\le\; s_n \;\le\; a_1 + \int_{1}^{n} f(x)\,dx.

Step 6 — read off both directions. If the integral \int_1^\infty f converges, the right-hand bound stays finite, so the increasing partial sums s_n are bounded above and must converge. If the integral diverges, the left-hand bound \int_1^{n+1} f \to \infty drags s_n to infinity with it. Either way:

\sum_{n=1}^{\infty} a_n \text{ converges} \;\iff\; \int_{1}^{\infty} f(x)\,dx \text{ converges.}

Notice where each hypothesis earned its keep: positive makes the partial sums increase (so "bounded" forces "convergent"); decreasing is what let us say which end of each strip holds the biggest value — it is the entire reason the rectangles sandwich the curve; and continuous simply guarantees the integral exists at all. Remove any one of them and the argument collapses.

Let f be positive, continuous and decreasing on [1, \infty), and set a_n = f(n). Then:

See the rectangles hug the curve

Below, the bars are the terms a_k = 1/k^{p} (each a unit-wide rectangle of height 1/k^p); the smooth curve is f(x) = 1/x^{p}. Each left rectangle pokes above the curve on its strip — and if you imagine the whole staircase nudged one unit to the right, the same bars duck below it. That is the sandwich, made visible: the shaded staircase area (the series) and the area under the curve (the integral) can never drift far apart.

Now slide p. At p = 0.5 the curve falls lazily and drags an infinite area behind it — the bars follow, and the series diverges. Push past p = 1 and the curve dives fast enough for the tail area to become finite; the staircase is pinned beneath a finite roof and the series converges. The whole p-series law is in that one slider: the boundary is not "the terms shrink" (they always do here) but "the area under the curve is finite".

Three workouts

1. The flagship: \sum 1/n^{p}, settled for every p

Take f(x) = x^{-p} with p > 0: positive, continuous, and decreasing on [1,\infty) — the hypotheses check out, so the test applies. For p \ne 1, antidifferentiate and take the limit:

\int_{1}^{\infty} x^{-p}\,dx \;=\; \lim_{t \to \infty}\left[\frac{x^{1-p}}{1-p}\right]_{1}^{t} \;=\; \lim_{t \to \infty}\frac{t^{1-p} - 1}{1-p}.

The exponent 1 - p decides everything. If p > 1 then 1 - p < 0, so t^{1-p} \to 0 and the integral settles at the finite value

\int_{1}^{\infty} \frac{dx}{x^{p}} = \frac{1}{p-1} \qquad (p > 1),

so the series converges — for instance p = 2 gives \int_1^\infty x^{-2}\,dx = 1, and p = 3 gives \tfrac12. If p < 1 the exponent 1-p is positive, t^{1-p} \to \infty, and the integral diverges — so \sum 1/\sqrt{n} diverges even though its terms shrink to zero. The boundary case p = 1 needs its own antiderivative:

\int_{1}^{\infty} \frac{dx}{x} = \lim_{t\to\infty} \ln t = \infty,

so the harmonic series diverges — but only just: the sandwich says its partial sums grow like \ln n, the slowest crawl to infinity you will meet for a while. Verdict: convergence exactly when p > 1. One integral, every exponent settled forever.

2. The sneaky one: \sum_{n=2}^{\infty} \dfrac{1}{n \ln n}

These terms shrink faster than 1/n (the extra \ln n downstairs helps), yet slower than 1/n^{p} for every p > 1. It lives in the crack between the p-series — comparison tests get you nowhere. The integral test walks straight through: f(x) = 1/(x \ln x) is positive, continuous and decreasing on [2, \infty), and the substitution u = \ln x, du = dx/x makes the integral melt:

\int_{2}^{\infty} \frac{dx}{x \ln x} \;=\; \int_{\ln 2}^{\infty} \frac{du}{u} \;=\; \Bigl[\ln u\Bigr]_{\ln 2}^{\infty} \;=\; \lim_{t\to\infty} \ln(\ln t) - \ln(\ln 2) \;=\; \infty.

The iterated logarithm \ln(\ln t) does go to infinity — just unimaginably slowly. So the series diverges. (And the pattern continues: the same substitution shows \sum 1/\bigl(n (\ln n)^{q}\bigr) converges exactly when q > 1 — a whole second family of borderline series, settled by the same trick.)

3. A fast faller: \sum_{n=1}^{\infty} n\,e^{-n^2}

Here f(x) = x e^{-x^2}. Positive and continuous, yes — but decreasing? Check the derivative: f'(x) = e^{-x^2}(1 - 2x^2) < 0 for x \ge 1, since 2x^2 > 1 there. Good — the hypothesis holds on the whole range we need (always verify it; do not assume it). Now the integral is a gift, because x\,dx is begging for the substitution u = x^{2}:

\int_{1}^{\infty} x e^{-x^2}\,dx \;=\; \lim_{t\to\infty}\Bigl[-\tfrac12 e^{-x^2}\Bigr]_{1}^{t} \;=\; 0 - \bigl(-\tfrac12 e^{-1}\bigr) \;=\; \frac{1}{2e}.

Finite, so the series converges. Notice what the test did not tell you: the sum is not \tfrac{1}{2e} \approx 0.184 — in fact the first term alone is e^{-1} \approx 0.368, already bigger. The integral delivers the verdict and brackets the sum (here between \tfrac{1}{2e} and e^{-1} + \tfrac{1}{2e}); it does not equal it.

The same rectangle picture does more than decide convergence — it bounds the tail. The remainder after n terms, R_n = \sum_{k=n+1}^{\infty} a_k, is itself sandwiched by integrals of the leftover region:

\int_{n+1}^{\infty} f(x)\,dx \;\le\; R_n \;\le\; \int_{n}^{\infty} f(x)\,dx.

For \sum 1/n^2, this gives R_n \le \int_n^\infty x^{-2}\,dx = \tfrac1n: to pin the sum to three decimals you need only about a thousand terms, and you know it without summing the infinite tail. Better still, adding the partial sum to the midpoint of the two integral bounds cuts the error roughly in half again. A test that decides convergence usually tells you, for free, how fast you are converging.

Two traps catch nearly every first-time user of this test:

The test says \sum 1/(n \ln n) diverges — its partial sums pass 10, pass 100, pass any number you name. But when? The sandwich answers that too: the partial sum up to N is about \ln(\ln N). To reach a mere 10 you need \ln(\ln N) \approx 10, i.e. N \approx e^{e^{10}} = e^{22{,}026} \approx 10^{9{,}566} terms. The observable universe holds roughly 10^{80} atoms — write one term on every atom and you fall short of reaching 10 by about nine and a half thousand orders of magnitude. Every computer that will ever exist will observe this series apparently converging; only the integral knows it never does.

And on the convergent side sits a famous shocker. The test told mathematicians early on that \sum 1/n^{2} converges to something between 1 and 2 — but to what? The question (the "Basel problem") stumped the best minds for ninety years, until 1735, when a 28-year-old Euler stunned Europe with the answer: \pi^{2}/6. The circle constant, hiding inside a sum of square reciprocals. The integral test is the honest workhorse — it says whether; finding what can take a genius.

See it explained