---
title: Series and the Integral Test
module: Infinite Sequences and Series
moduleNumber: 9
lessonNumber: 2
order: 902
summary: >
  Adding infinitely many terms is made precise as the limit of partial sums. The
  two series with closed-form partial sums are geometric and telescoping; the
  harmonic series diverges even as its terms shrink to zero. The Integral Test
  compares a positive series to an improper integral, settling the p-series and
  supplying a remainder bound for estimating sums.
topics: [Infinite Sequences and Series]
sources:
  - book: Stewart
    ref: "Ch. 11; §11.2 Series"
  - book: Stewart
    ref: "§11.3 The Integral Test and Estimates of Sums"
---

Writing a number as an infinite decimal already commits us to adding infinitely
many terms. The statement $\pi = 3.14159\ldots$ means

$$
\pi = 3 + \frac{1}{10} + \frac{4}{10^2} + \frac{1}{10^3} + \frac{5}{10^4} + \cdots,
$$

and the "$\cdots$" says the sum continues forever, with each added term bringing
us closer to $\pi$. A sum of infinitely many terms must be defined before it can
be computed.

Given a [sequence](/calculus/sequences-and-series/sequences) $\{a_n\}$, the
expression

$$
\sum_{n=1}^{\infty} a_n = a_1 + a_2 + a_3 + \cdots
$$

is an **infinite series**. Adding infinitely many numbers is not an operation we
can perform, so we define the sum through a sequence we _can_ control.

> **Definition (Sum of a series).** Given $\sum a_n$, let $s_n$ be its $n$th
> **partial sum**:
> $$
> s_n = \sum_{i=1}^{n} a_i = a_1 + a_2 + \cdots + a_n.
> $$
> If the sequence $\{s_n\}$ converges to a real number $s$, the series
> **converges** and $\sum a_n = s$; the number $s$ is the **sum**. If $\{s_n\}$
> diverges, the series **diverges**.

The sum of a series is the limit of its partial sums, nothing more. So
$\sum a_n = s$ means that by adding enough terms we can make the running total as
close to $s$ as we like. Every series carries two sequences: the terms
$\{a_n\}$ and the partial sums $\{s_n\}$.

$$
% caption: The partial sums $s_n$ of $\sum 1/2^n$ (dots) climb toward the sum
% $s = 1$ (dashed line) while the terms $a_n$ (below) shrink to zero.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black, ->] (0,0) -- (8.4,0) node[anchor=north east] {$n$};
\draw[black, ->] (0,0) -- (0,3.6) node[anchor=north east] {};
\draw[acc, dashed] (0,3) -- (8,3) node[anchor=south east, black] {$s = 1$};
% partial sums s_n = 1 - 1/2^n, scaled by 3
\foreach \n/\y in {1/1.5, 2/2.25, 3/2.625, 4/2.8125, 5/2.906, 6/2.953, 7/2.977, 8/2.988}
  \fill (\n,\y) circle (2.4pt);
\node[anchor=south] at (5,2.906) {$s_n$};
% terms a_n = 1/2^n, scaled by 3
\foreach \n/\y in {1/1.5, 2/0.75, 3/0.375, 4/0.1875, 5/0.094, 6/0.047, 7/0.023}
  \fill[black] (\n,\y) circle (1.8pt);
\node[black, anchor=west] at (3.1,0.375) {$a_n$};
\end{tikzpicture}
$$

## The geometric series

The one series whose partial sum has a clean closed form is the **geometric
series**, in which each term is a fixed multiple of the one before:

$$
\sum_{n=1}^{\infty} a r^{n-1} = a + ar + ar^2 + ar^3 + \cdots, \qquad a \ne 0.
$$

The number $r$ is the **common ratio**. To find $s_n$, write the sum and $r$
times the sum and subtract:

$$
s_n = a + ar + \cdots + ar^{n-1}, \qquad
r s_n = ar + ar^2 + \cdots + ar^{n}.
$$

Subtracting, $s_n - r s_n = a - ar^n$, so for $r \ne 1$,

$$
s_n = \frac{a(1 - r^n)}{1 - r}.
$$

Whether this converges is decided entirely by $\{r^n\}$. If $|r| < 1$, then
$r^n \to 0$ and $s_n \to a/(1-r)$. If $|r| \ge 1$, then $\{r^n\}$ diverges and so
does the series (for $r = 1$, $s_n = na \to \pm\infty$ directly).

> **Result (Geometric series).** The series $\sum_{n=1}^{\infty} ar^{n-1}$
> converges if $|r| < 1$, with sum
> $$
> \sum_{n=1}^{\infty} ar^{n-1} = \frac{a}{1 - r} = \frac{\text{first term}}{1 - \text{common ratio}},
> $$
> and diverges if $|r| \ge 1$.

$$
% caption: A geometric series with $r = 1/2$: each term tiles half of what
% remains, so the pieces exhaust a single unit square and $\sum 1/2^n = 1$.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black] (0,0) rectangle (4,4);
\fill[acc!22] (0,0) rectangle (2,4);
\draw[acc] (0,0) rectangle (2,4);
\node at (1,2) {$\tfrac{1}{2}$};
\fill[acc!16] (2,0) rectangle (4,2);
\draw[acc] (2,0) rectangle (4,2);
\node at (3,1) {$\tfrac{1}{4}$};
\fill[acc!12] (2,2) rectangle (3,4);
\draw[acc] (2,2) rectangle (3,4);
\node[font=\scriptsize] at (2.5,3) {$\tfrac{1}{8}$};
\fill[acc!8] (3,2) rectangle (4,3);
\draw[acc] (3,2) rectangle (4,3);
\node[font=\scriptsize] at (3.5,2.5) {$\tfrac{1}{16}$};
\draw[acc] (3,3) rectangle (3.5,4);
\draw[acc] (3.5,3) rectangle (4,3.5);
\end{tikzpicture}
$$

Every repeating decimal is a geometric series, hence a rational number.

> **Worked example.** Write $2.3\overline{17} = 2.3171717\ldots$ as a fraction.
>
> Split off the non-repeating part $2.3$ and expand the repeating block $17$ as a
> geometric series with first term $17/10^3$ and ratio $1/10^2$:
>
> $$
> 2.3\overline{17} = 2.3 + \frac{17}{10^3} + \frac{17}{10^5} + \cdots
> = 2.3 + \frac{17/10^3}{1 - 1/10^2}.
> $$
>
> The geometric tail sums to $\dfrac{17/1000}{99/100} = \dfrac{17}{990}$, so
>
> $$
> 2.3\overline{17} = \frac{23}{10} + \frac{17}{990} = \frac{2277 + 17}{990}
> = \frac{2294}{990} = \frac{1147}{495}.
> $$

**A function from a series.** Setting $a = 1$, $r = x$ gives a series that
represents a function on $(-1, 1)$:

$$
\sum_{n=0}^{\infty} x^n = 1 + x + x^2 + x^3 + \cdots = \frac{1}{1 - x}, \qquad |x| < 1.
$$

This single identity generates a large fraction of the
[power series](/calculus/sequences-and-series/power-series) developed later.

## Telescoping series

The other series with a computable partial sum is one whose terms cancel in
pairs. For $\sum 1/[n(n+1)]$, partial fractions give
$\dfrac{1}{i(i+1)} = \dfrac{1}{i} - \dfrac{1}{i+1}$, so

$$
s_n = \sum_{i=1}^{n}\Big(\frac{1}{i} - \frac{1}{i+1}\Big)
= \Big(1 - \tfrac{1}{2}\Big) + \Big(\tfrac{1}{2} - \tfrac{1}{3}\Big) + \cdots
+ \Big(\tfrac{1}{n} - \tfrac{1}{n+1}\Big)
= 1 - \frac{1}{n+1}.
$$

Every interior term cancels its neighbor, collapsing the sum to its two ends.
Then $s_n \to 1$, so $\sum_{n=1}^{\infty} 1/[n(n+1)] = 1$. The technique needs
the general term written as a difference $b_i - b_{i+1}$; the tool for producing
that is
[partial fractions](/calculus/techniques-of-integration/partial-fractions-and-integration-strategy).

## The harmonic series and the Test for Divergence

The **harmonic series** $\sum 1/n$ shows that terms shrinking to zero is not
enough. Group its terms in blocks of length $1, 2, 4, 8, \ldots$ and bound each
block below:

$$
s_{2^k} = 1 + \tfrac{1}{2} + \big(\tfrac{1}{3} + \tfrac{1}{4}\big)
+ \big(\tfrac{1}{5} + \cdots + \tfrac{1}{8}\big) + \cdots
> 1 + \tfrac{1}{2} + \tfrac{1}{2} + \tfrac{1}{2} + \cdots = 1 + \frac{k}{2}.
$$

Each parenthesized block exceeds $\tfrac{1}{2}$ because its smallest term,
repeated, already sums to $\tfrac{1}{2}$. So $s_{2^k} \to \infty$ and the
harmonic series diverges — even though $1/n \to 0$.

There is, however, a necessary condition. If $\sum a_n$ converges with sum $s$,
then $a_n = s_n - s_{n-1} \to s - s = 0$. Contrapositive:

> **Theorem (Test for Divergence).** If $\lim_{n\to\infty} a_n$ does not exist or
> $\lim_{n\to\infty} a_n \ne 0$, then $\sum a_n$ diverges.

The converse is not valid. If $a_n \to 0$, the test is inconclusive: the series
may converge or diverge (the harmonic series has terms tending to $0$ yet
diverges). Only $a_n \not\to 0$ is conclusive. For
$\sum n^2/(5n^2 + 4)$, the terms tend to $1/5 \ne 0$, so the series diverges at a
glance.

## Algebra of convergent series

Convergent series inherit the [Limit Laws](/calculus/sequences-and-series/sequences)
term by term. If $\sum a_n$ and $\sum b_n$ converge and $c$ is constant, then
$\sum c a_n$, $\sum (a_n + b_n)$, and $\sum (a_n - b_n)$ converge, with

$$
\sum c a_n = c \sum a_n, \qquad
\sum (a_n \pm b_n) = \sum a_n \pm \sum b_n.
$$

A finite number of terms never affects convergence, only the sum: changing,
dropping, or adding finitely many terms leaves a divergent series divergent and
a convergent one convergent. This lets us start a series at whatever index is
convenient when only convergence is in question.

> **Worked example.** Find $\displaystyle\sum_{n=1}^{\infty}
> \left(\frac{3}{n(n+1)} + \frac{1}{2^n}\right)$.
>
> Both pieces converge, so the sum splits into two known sums. The first is
> three times the telescoping series computed above:
>
> $$
> \sum_{n=1}^{\infty} \frac{3}{n(n+1)} = 3\sum_{n=1}^{\infty}\frac{1}{n(n+1)}
> = 3 \cdot 1 = 3.
> $$
>
> The second is geometric with first term $\tfrac{1}{2}$ and ratio $\tfrac{1}{2}$:
> $\sum 1/2^n = \tfrac{1/2}{1 - 1/2} = 1$. Adding,
>
> $$
> \sum_{n=1}^{\infty}\left(\frac{3}{n(n+1)} + \frac{1}{2^n}\right) = 3 + 1 = 4.
> $$

## The Integral Test

Most series have no closed-form partial sum. The first general test compares a
series of positive terms to an [improper integral](/calculus/techniques-of-integration/approximate-and-improper-integrals),
using the fact that both are limits of accumulating pieces. Consider $\sum 1/n^2$
alongside the curve $y = 1/x^2$. Erect a rectangle of width $1$ and height
$1/n^2$ on each interval $[n, n+1]$; the rectangles beyond the first lie _under_
the curve, so their total area is less than the area under $y = 1/x^2$ for
$x \ge 1$:

$$
\sum_{n=2}^{\infty} \frac{1}{n^2}
< \int_1^{\infty} \frac{1}{x^2}\,\d x = 1.
$$

Hence $s_n < 2$ for all $n$; the partial sums increase and are bounded, so by the
Monotonic Sequence Theorem the series converges. The mirror-image picture, with
rectangles rising _above_ $y = 1/\sqrt{x}$, shows $\sum 1/\sqrt{n}$ exceeds a
divergent integral and so diverges.

$$
% caption: Left: rectangles of height $1/n^2$ sit below $y = 1/x^2$, so the
% series is under a finite integral and converges. Right: rectangles of height
% $1/\sqrt{n}$ rise above $y = 1/\sqrt{x}$, so the series exceeds an infinite
% integral and diverges.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
% --- left: convergent ---
\draw[black, ->] (0,0) -- (4.6,0) node[anchor=north east] {$x$};
\draw[black, ->] (0,0) -- (0,2.6) node[anchor=north east] {};
\foreach \n in {2,3,4} {
  \fill[acc!12] (\n-1,0) rectangle (\n, {4/(\n*\n)});
  \draw[acc] (\n-1,0) rectangle (\n, {4/(\n*\n)});
}
\draw[black!70, very thick] plot[domain=0.72:4.4, samples=60] (\x, {4/(\x*\x)});
\node[black!70, anchor=west] at (2.2,1.3) {$y = \tfrac{1}{x^2}$};
\node[acc, anchor=north] at (2,-0.05) {converges};
% --- right: divergent ---
\begin{scope}[xshift=6cm]
\draw[black, ->] (0,0) -- (4.6,0) node[anchor=north east] {$x$};
\draw[black, ->] (0,0) -- (0,2.6) node[anchor=north east] {};
\foreach \n in {1,2,3,4} {
  \fill[acc!12] (\n-1,0) rectangle (\n, {2/sqrt(\n)});
  \draw[acc] (\n-1,0) rectangle (\n, {2/sqrt(\n)});
}
\draw[black!70, very thick] plot[domain=0.55:4.4, samples=60] (\x, {2/sqrt(\x)});
\node[black!70, anchor=west] at (2.3,1.5) {$y = \tfrac{1}{\sqrt{x}}$};
\node[acc, anchor=north] at (2,-0.05) {diverges};
\end{scope}
\end{tikzpicture}
$$

The same reasoning proves the general test.

> **Theorem (Integral Test).** Let $f$ be continuous, positive, and decreasing on
> $[1, \infty)$ and set $a_n = f(n)$. Then $\sum_{n=1}^{\infty} a_n$ converges if
> and only if $\int_1^{\infty} f(x)\,\d x$ converges.

Two cautions. The test needs $f$ eventually decreasing, not decreasing from the
start, since finitely many terms are irrelevant. And it decides _whether_ the
series converges, not its value: in general $\sum a_n \ne \int_1^{\infty} f$. For
instance $\sum 1/n^2 = \pi^2/6$, while $\int_1^{\infty} x^{-2}\,\d x = 1$.

## The p-series

Applying the Integral Test to $f(x) = 1/x^p$ settles a whole family at once. From
the improper-integral fact that $\int_1^{\infty} x^{-p}\,\d x$ converges exactly
when $p > 1$:

> **Result ($p$-series).** The series $\displaystyle\sum_{n=1}^{\infty}
> \frac{1}{n^p}$ converges if $p > 1$ and diverges if $p \le 1$.

For $p \le 0$ the terms do not tend to $0$, so the Test for Divergence already
settles it; for $0 < p \le 1$ the Integral Test applies and the integral diverges;
for $p > 1$ the integral converges. The threshold sits exactly at $p = 1$, where
the harmonic series ($p = 1$) diverges but $\sum 1/n^{1.001}$ converges.

$$
% caption: The $p$-series threshold: convergent for every $p > 1$, divergent for
% every $p \le 1$, with the harmonic series sitting on the dividing line at
% $p = 1$.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\definecolor{red}{HTML}{C0392B}
\draw[red!70, line width=2pt] (0,0) -- (5,0);
\draw[acc, line width=2pt] (5,0) -- (10,0);
\foreach \p in {0,1,2,3} \draw[black] (\p*2.5,0.12) -- (\p*2.5,-0.12);
\node[anchor=north] at (0,-0.15) {$0$};
\node[anchor=north] at (2.5,-0.15) {$\tfrac{1}{2}$};
\node[anchor=north] at (5,-0.15) {$1$};
\node[anchor=north] at (7.5,-0.15) {$2$};
\node[anchor=north] at (10,-0.15) {$p$};
\node[red!80, anchor=south] at (2.5,0.2) {diverges ($p \le 1$)};
\node[acc, anchor=south] at (7.5,0.2) {converges ($p > 1$)};
\fill[black] (5,0) circle (2.6pt);
\node[anchor=south, black] at (5,0.55) {harmonic};
\end{tikzpicture}
$$

## Estimating a sum by its remainder

When the Integral Test proves convergence, it also bounds the error in stopping
at $n$ terms. Write the **remainder** $R_n = s - s_n = a_{n+1} + a_{n+2} +
\cdots$. Comparing this tail of rectangles to the area under $f$ on $[n,\infty)$
from both sides gives a two-sided bound.

> **Theorem (Remainder Estimate for the Integral Test).** If $f(k) = a_k$ with
> $f$ continuous, positive, decreasing for $x \ge n$, and $\sum a_n$ converges,
> then
> $$
> \int_{n+1}^{\infty} f(x)\,\d x \ \le\ R_n \ \le\ \int_{n}^{\infty} f(x)\,\d x.
> $$

$$
% caption: The remainder $R_n = a_{n+1} + a_{n+2} + \cdots$ is a tail of
% rectangles; comparing it to the area under $f$ on $[n, \infty)$ from below and
% above brackets it between two improper integrals.
\begin{tikzpicture}[scale=1.0, font=\footnotesize]
\definecolor{acc}{HTML}{4A6FA5}
\draw[black, ->] (0,0) -- (6.4,0) node[anchor=north east] {$x$};
\draw[black, ->] (0,0) -- (0,2.7) node[anchor=north east] {};
\foreach \k in {1,2,3,4} {
  \fill[acc!12] (\k+0.5,0) rectangle (\k+1.5, {3.2/(\k+1)});
  \draw[acc] (\k+0.5,0) rectangle (\k+1.5, {3.2/(\k+1)});
}
\draw[black!70, very thick] plot[domain=1.1:6.0, samples=60] (\x, {3.2/\x});
\node[black!70, anchor=west] at (3.4,1.35) {$y = f(x)$};
\draw[black] (1.5,0.12) -- (1.5,-0.12);
\node[anchor=north east, black!70] at (1.5,-0.05) {$n$};
\node[acc, anchor=north] at (3.5,-0.35) {tail $R_n$};
\end{tikzpicture}
$$

> **Worked example.** Estimate $\sum_{n=1}^{\infty} 1/n^3$ by its tenth partial
> sum, and bound the error.
>
> With $f(x) = x^{-3}$ the tail integral is $\int_n^{\infty} x^{-3}\,\d x =
> 1/(2n^2)$, so the remainder after ten terms satisfies
>
> $$
> R_{10} \le \int_{10}^{\infty} \frac{\d x}{x^3}
> = \frac{1}{2(10)^2} = \frac{1}{200} = 0.005.
> $$
>
> Hence $s_{10} \approx 1.1975$ is within $0.005$ of the true sum. To force
> accuracy within $0.0005$, pick $n$ with $1/(2n^2) < 0.0005$, i.e. $n^2 > 1000$;
> $n = 32$ suffices. Bracketing the sum between $s_n + \int_{n+1}^{\infty} f$ and
> $s_n + \int_{n}^{\infty} f$ tightens the estimate further.

## Summary of tests

| Series form | Test | Verdict |
| --- | --- | --- |
| $\sum ar^{n-1}$ | geometric | converges iff $\lvert r \rvert < 1$, sum $a/(1-r)$ |
| $\sum (b_i - b_{i+1})$ | telescoping | converges iff $b_n$ converges |
| $\sum 1/n^p$ | $p$-series | converges iff $p > 1$ |
| any, with $a_n \not\to 0$ | Test for Divergence | diverges |
| $a_n = f(n)$, $f$ positive decreasing | Integral Test | matches $\int_1^\infty f$ |

Each entry requires either a closed-form partial sum or a tractable
antiderivative. Series offering neither are decided by
[comparison, ratio, and root tests](/calculus/sequences-and-series/the-convergence-tests),
which read convergence off the general term alone.
