Direct comparison test

In mathematics, the comparison test, sometimes called the direct comparison test to distinguish it from similar related tests (especially the limit comparison test), provides a way of deducing the convergence or divergence of an infinite series or an improper integral. In both cases, the test works by comparing the given series or integral to one whose convergence properties are known.

For series
In calculus, the comparison test for series typically consists of a pair of statements about infinite series with non-negative (real-valued) terms: Note that the series having larger terms is sometimes said to dominate (or eventually dominate) the series with smaller terms.
 * If the infinite series $$\sum b_n$$ converges and $$0 \le a_n \le b_n$$ for all sufficiently large n (that is, for all $$n>N$$ for some fixed value N), then the infinite series $$\sum a_n$$ also converges.
 * If the infinite series $$\sum b_n$$ diverges and $$0 \le b_n \le a_n$$ for all sufficiently large n, then the infinite series $$\sum a_n$$ also diverges.

Alternatively, the test may be stated in terms of absolute convergence, in which case it also applies to series with complex terms: Note that in this last statement, the series $$\sum a_n$$ could still be conditionally convergent; for real-valued series, this could happen if the an are not all nonnegative.
 * If the infinite series $$\sum b_n$$ is absolutely convergent and $$|a_n| \le |b_n|$$ for all sufficiently large n, then the infinite series $$\sum a_n$$ is also absolutely convergent.
 * If the infinite series $$\sum b_n$$ is not absolutely convergent and $$|b_n| \le |a_n|$$ for all sufficiently large n, then the infinite series $$\sum a_n$$ is also not absolutely convergent.

The second pair of statements are equivalent to the first in the case of real-valued series because $$\sum c_n$$ converges absolutely if and only if $$\sum |c_n|$$, a series with nonnegative terms, converges.

Proof
The proofs of all the statements given above are similar. Here is a proof of the third statement.

Let $$\sum a_n$$ and $$\sum b_n$$ be infinite series such that $$\sum b_n$$ converges absolutely (thus $$\sum |b_n|$$ converges), and without loss of generality assume that $$|a_n| \le |b_n|$$ for all positive integers n. Consider the partial sums
 * $$S_n = |a_1| + |a_2| + \ldots + |a_n|,\ T_n = |b_1| + |b_2| + \ldots + |b_n|. $$

Since $$\sum b_n$$ converges absolutely, $$\lim_{n\to\infty} T_n = T$$ for some real number T. For all n,
 * $$ 0 \le S_n = |a_1| + |a_2| + \ldots + |a_n| \le |a_1| + \ldots + |a_n| + |b_{n+1}| + \ldots = S_n + (T-T_n) \le T.$$

$$S_n$$ is a nondecreasing sequence and $$S_n + (T - T_n)$$ is nonincreasing. Given $$m,n > N$$ then both $$S_n, S_m$$ belong to the interval $$[S_N, S_N + (T - T_N)]$$, whose length $$T - T_N$$ decreases to zero as $$N$$ goes to infinity. This shows that $$(S_n)_{n=1,2,\ldots}$$ is a Cauchy sequence, and so must converge to a limit. Therefore, $$\sum a_n$$ is absolutely convergent.

For integrals
The comparison test for integrals may be stated as follows, assuming continuous real-valued functions f and g on $$[a,b)$$ with b either $$+\infty$$ or a real number at which f and g each have a vertical asymptote:
 * If the improper integral $$\int_a^b g(x)\,dx$$ converges and $$0 \le f(x) \le g(x)$$ for $$a \le x < b$$, then the improper integral $$\int_a^b f(x)\,dx$$ also converges with $$\int_a^b f(x)\,dx \le \int_a^b g(x)\,dx.$$
 * If the improper integral $$\int_a^b g(x)\,dx$$ diverges and $$0 \le g(x) \le f(x)$$ for $$a \le x < b$$, then the improper integral $$\int_a^b f(x)\,dx$$ also diverges.

Ratio comparison test
Another test for convergence of real-valued series, similar to both the direct comparison test above and the ratio test, is called the ratio comparison test:
 * If the infinite series $$\sum b_n$$ converges and $$a_n>0$$, $$b_n>0$$, and $$\frac{a_{n+1}}{a_n} \le \frac{b_{n+1}}{b_n}$$ for all sufficiently large n, then the infinite series $$\sum a_n$$ also converges.
 * If the infinite series $$\sum b_n$$ diverges and $$a_n>0$$, $$b_n>0$$, and $$\frac{a_{n+1}}{a_n} \ge \frac{b_{n+1}}{b_n}$$ for all sufficiently large n, then the infinite series $$\sum a_n$$ also diverges.