The Integral Test

A series is a sum of rectangles of width one; an integral is the smooth area under a curve. When the terms come from a positive, decreasing function — a_n = f(n) — those two pictures are within a single rectangle of each other, so the series and the improper integral must share the same fate: both converge, or both diverge.

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.}

This is the test that finally settles the p-series \sum 1/n^p — including pinning down exactly where the harmonic series tips over into divergence.

Sandwiching the partial sum between two integrals

Fix a positive, decreasing function f with a_n = f(n). The whole proof is reading off two rectangle pictures against the curve, then squeezing.

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 the smallest value on [k-1, k] is at the right end, f(k) = a_k, so that rectangle 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.}

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

The p-series, settled

Apply the test to f(x) = x^{-p} (positive and decreasing for p > 0). For p \ne 1,

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

The exponent 1 - p decides everything: if p > 1 then 1 - p < 0 and x^{1-p} \to 0, leaving the finite value \tfrac{1}{p-1}; if p < 1 the exponent is positive and the integral blows up. The boundary case p = 1 gives \int_1^\infty x^{-1}\,dx = [\ln x]_1^\infty = \infty. Hence convergence exactly when p > 1.

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. A test that decides convergence usually tells you, for free, how fast you are converging.

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 and each right rectangle ducks below it — that is the sandwich, made visible. Slide p past 1 to watch the area become finite.