Integral Test

The integral test says that if a_n = f(n), where f is positive, continuous and decreasing for x ≥ 1, then the series \sum_{n=1}^{\infty} a_n and the improper integral \int_1^{\infty} f(x)\,dx either both converge or both diverge. The integral decides convergence, but its value is not the sum.

Before this lesson: Improper Integrals, Infinite Series and Partial Sums and Divergence Test

Why a series behaves like an integral

Draw each term a_n as a rectangle of width 1 and height f(n), standing on the interval from n to n + 1. The total area of the rectangles is the sum of the series.

When f is decreasing, each rectangle starts at the curve and sits above it. So the rectangles cover the area under the curve: the series is at least as big as the integral. Shift the rectangles one unit left and they sit under the curve instead, so the series (minus its first term) is at most the integral.

Graph of the decreasing curve y = 1/x² for x from 1 to 7. Blue rectangles of width 1 stand on the intervals from n to n + 1, with heights 1, 1/4, 1/9, 1/16, 1/25 and 1/36. Each rectangle's top-left corner touches the curve, so the rectangles lie above the curve and their total area is bigger than the area under it.
The rectangles have areas 1/n², so the series is squeezed against the area under y = 1/x²: a finite area means a finite sum.

The series and the integral are trapped close to each other. If the area is finite, the sum is finite too. If the area is infinite, so is the sum.

The integral test

Suppose f is positive, continuous and decreasing on [1, \infty), and a_n = f(n) for every n. Then:

\int_1^{\infty} f(x)\,dx \text{ converges} \quad \Longleftrightarrow \quad \sum_{n=1}^{\infty} a_n \text{ converges}

The conditions only need to hold from some point on. If f is decreasing for x ≥ N, start the integral at N; the first few terms do not change whether a series converges.

Remainder estimate. If the series converges and you stop after N terms, the error R_N = \sum_{n=N+1}^{\infty} a_n is trapped between two integrals:

\int_{N+1}^{\infty} f(x)\,dx \le R_N \le \int_N^{\infty} f(x)\,dx

How to use the integral test

  1. Write a_n = f(n) and check that f(x) is positive, continuous and decreasing for x ≥ 1 (or from some point on). A negative derivative shows f is decreasing.
  2. Evaluate \int_1^{\infty} f(x)\,dx as a limit, \lim_{b \to \infty} \int_1^{b} f(x)\,dx.
  3. If the integral is finite, the series converges. If it is infinite, the series diverges.

Integral test examples

Example 1: The harmonic series

Use the integral test on \sum_{n=1}^{\infty} \dfrac{1}{n}.

f(x) = \dfrac{1}{x}

Replace n with x.

f(x) \gt 0,\ f'(x) = -\dfrac{1}{x^2} \lt 0

For x ≥ 1, f is positive and continuous, and its derivative is negative, so f is decreasing.

\int_1^{\infty} \dfrac{1}{x}\,dx = \lim_{b \to \infty} \int_1^{b} \dfrac{1}{x}\,dx

Write the improper integral as a limit.

\int_1^{b} \dfrac{1}{x}\,dx = \ln b - \ln 1

An antiderivative of 1/x is ln x (see integrals that give natural logarithms).

\ln b - \ln 1 = \ln b

ln 1 = 0.

\lim_{b \to \infty} \ln b = \infty

ln b grows without bound.

Answer: the integral diverges, so the harmonic series diverges, even though its terms go to 0.

Example 2: A series that converges

Use the integral test on \sum_{n=1}^{\infty} \dfrac{1}{n^2 + 1}.

f(x) = \dfrac{1}{x^2 + 1}

Replace n with x. It is positive and continuous for x ≥ 1.

f'(x) = -\dfrac{2x}{(x^2 + 1)^2} \lt 0

Use the chain rule; the derivative is negative for x ≥ 1, so f is decreasing.

\int_1^{b} \dfrac{1}{x^2 + 1}\,dx = \arctan b - \arctan 1

An antiderivative is arctan x (see integrals that give inverse trig functions).

\arctan b - \arctan 1 = \arctan b - \dfrac{\pi}{4}

arctan 1 = π/4.

\lim_{b \to \infty} \left(\arctan b - \dfrac{\pi}{4}\right) = \dfrac{\pi}{2} - \dfrac{\pi}{4} = \dfrac{\pi}{4}

arctan b levels off at π/2.

Answer: the integral equals π/4 ≈ 0.785, a finite number, so the series converges. The sum of the series is about 1.077, not π/4.

Example 3: A u-substitution integral

Use the integral test on \sum_{n=1}^{\infty} ne^{-n^2}.

f(x) = xe^{-x^2}

Replace n with x. It is positive and continuous for x ≥ 1.

f'(x) = e^{-x^2} - 2x^2e^{-x^2}

Use the product rule and the chain rule.

f'(x) = e^{-x^2}\left(1 - 2x^2\right) \lt 0

Factor; 1 − 2x² is negative for x ≥ 1, so f is decreasing.

u = -x^2,\ du = -2x\,dx

Substitute (see u-substitution).

\int xe^{-x^2}\,dx = -\dfrac{1}{2}\int e^{u}\,du = -\dfrac{1}{2}e^{-x^2} + C

Integrate and return to x.

\int_1^{b} xe^{-x^2}\,dx = -\dfrac{1}{2}e^{-b^2} + \dfrac{1}{2}e^{-1}

Evaluate from 1 to b.

\lim_{b \to \infty} \left(-\dfrac{1}{2}e^{-b^2} + \dfrac{1}{2e}\right) = \dfrac{1}{2e}

e to the −b² goes to 0.

Answer: the integral equals 1/(2e) ≈ 0.184, so the series converges.

Example 4: Starting at n = 2

Use the integral test on \sum_{n=2}^{\infty} \dfrac{1}{n\ln n}.

f(x) = \dfrac{1}{x\ln x}

For x ≥ 2, x ln x is positive and increasing, so f is positive, continuous and decreasing.

u = \ln x,\ du = \dfrac{1}{x}\,dx

Substitute.

\int \dfrac{1}{x\ln x}\,dx = \int \dfrac{1}{u}\,du = \ln|\ln x| + C

Integrate and return to x.

\int_2^{b} \dfrac{1}{x\ln x}\,dx = \ln(\ln b) - \ln(\ln 2)

Evaluate from 2 to b; ln x is positive here.

\lim_{b \to \infty} \ln(\ln b) = \infty

ln b grows without bound, so ln(ln b) does too.

Answer: the integral diverges, so the series diverges. It grows extremely slowly: the first million terms add up to only about 3.4.

Example 5: How many terms are enough? (word problem)

A student writes a program to estimate \sum_{n=1}^{\infty} \dfrac{1}{n^3}, a constant that shows up in physics. (a) Use the first 5 terms and the remainder estimate to trap the sum. (b) How many terms make the error less than 0.0005?

S_5 = 1 + \dfrac{1}{8} + \dfrac{1}{27} + \dfrac{1}{64} + \dfrac{1}{125} \approx 1.18566

Add the first 5 terms.

\int_N^{\infty} \dfrac{1}{x^3}\,dx = \lim_{b \to \infty} \left(-\dfrac{1}{2b^2} + \dfrac{1}{2N^2}\right) = \dfrac{1}{2N^2}

An antiderivative of x⁻³ is −x⁻²/2 (see power rule).

\dfrac{1}{2(6)^2} \le R_5 \le \dfrac{1}{2(5)^2}

Use the remainder estimate with N = 5.

0.01389 \le R_5 \le 0.02

1/72 ≈ 0.01389 and 1/50 = 0.02.

1.18566 + 0.01389 \le S \le 1.18566 + 0.02

Add the bounds to S₅.

1.19955 \le S \le 1.20566

Simplify.

\dfrac{1}{2N^2} \lt 0.0005

(b) Make the upper bound on the error small enough.

N^2 \gt 1000

Multiply both sides by 2N² and divide by 0.0005.

N \gt 31.6

Take the positive square root; √1000 ≈ 31.6.

Answer: (a) the sum is between about 1.1996 and 1.2057 (its true value is about 1.2021). (b) 32 terms guarantee an error less than 0.0005.

Common mistakes

MistakeExample of the errorFix
Thinking the integral equals the sum“\int_1^{\infty} \frac{dx}{x^2+1} = \frac{\pi}{4}, so the series sums to π/4”The integral only decides convergence. The sum is about 1.077.
Skipping the decreasing checkUsing the test on \sum \frac{2 + \sin n}{n^2}That f(x) goes up and down, so the test does not apply. Use a comparison test instead.
Using it on terms that change signApplying the test to \sum \frac{(-1)^n}{n}The integral test needs positive terms. Alternating series have their own test.
Forgetting the improper-integral limitWriting \int_1^{\infty} \frac{1}{x}\,dx = \ln \infty - 0 and stoppingWrite the integral as a limit as b → ∞ and evaluate it.
Using the wrong lower limitStarting at 1 for \sum_{n=2}^{\infty} \frac{1}{n\ln n}, where ln 1 = 0Start the integral where the series starts, or anywhere the function is defined and decreasing.
Mixing up the remainder boundsWriting R_N \le \int_{N+1}^{\infty} f(x)\,dxThe upper bound starts at N, and the lower bound starts at N + 1.

Related methods

p-series come next

Applying the integral test to \sum 1/n^p shows that it converges exactly when p is greater than 1. That fact, the p-series test, is the next lesson and gives you a library of series to compare with.

Comparing instead of integrating

When f(x) is hard to integrate, or is not decreasing, compare the series with one you already know. That is the idea behind the direct comparison test and the limit comparison test later in this unit.

Practice problems

  1. Use the integral test on \sum_{n=1}^{\infty} \dfrac{1}{n^2}.
  2. Use the integral test on \sum_{n=1}^{\infty} \dfrac{1}{2n + 3}.
  3. Use the integral test on \sum_{n=1}^{\infty} e^{-n}.
  4. Use the integral test on \sum_{n=1}^{\infty} \dfrac{n}{n^2 + 4}.
  5. Use the integral test on \sum_{n=1}^{\infty} \dfrac{1}{(n + 1)^{3/2}}.
  6. Use the integral test on \sum_{n=3}^{\infty} \dfrac{\ln n}{n}.
  7. Use the integral test on \sum_{n=2}^{\infty} \dfrac{1}{n(\ln n)^2}.
  8. Use the integral test on \sum_{n=1}^{\infty} \dfrac{\arctan n}{1 + n^2}.
  9. Explain why the integral test cannot be used on \sum_{n=1}^{\infty} \dfrac{2 + \sin n}{n^2}.
  10. A calculator adds terms of \sum_{n=1}^{\infty} \dfrac{1}{n^2} one at a time. Use the remainder estimate to find how many terms make the error less than 0.01.
Show answers

1.

f(x) = \dfrac{1}{x^2},\ f'(x) = -\dfrac{2}{x^3} \lt 0

Positive, continuous and decreasing for x ≥ 1.

\int_1^{b} x^{-2}\,dx = -\dfrac{1}{b} + 1

An antiderivative is −1/x.

\lim_{b \to \infty} \left(1 - \dfrac{1}{b}\right) = 1

1/b goes to 0.

Answer: the integral is 1, so the series converges

2.

f(x) = \dfrac{1}{2x + 3}

Positive, continuous and decreasing for x ≥ 1, since the denominator increases.

\int_1^{b} \dfrac{1}{2x + 3}\,dx = \dfrac{1}{2}\ln(2b + 3) - \dfrac{1}{2}\ln 5

Use u = 2x + 3, du = 2 dx.

\lim_{b \to \infty} \dfrac{1}{2}\ln(2b + 3) = \infty

The log grows without bound.

Answer: the integral diverges, so the series diverges

3.

f(x) = e^{-x},\ f'(x) = -e^{-x} \lt 0

Positive, continuous and decreasing.

\int_1^{b} e^{-x}\,dx = -e^{-b} + e^{-1}

An antiderivative is −e⁻ˣ.

\lim_{b \to \infty} \left(-e^{-b} + e^{-1}\right) = \dfrac{1}{e}

e⁻ᵇ goes to 0.

Answer: the integral is 1/e, so the series converges (it is also a geometric series with r = 1/e)

4.

f'(x) = \dfrac{(x^2 + 4) - x(2x)}{(x^2 + 4)^2} = \dfrac{4 - x^2}{(x^2 + 4)^2}

Use the quotient rule.

\dfrac{4 - x^2}{(x^2 + 4)^2} \lt 0 \text{ for } x \gt 2

f is positive and continuous, and decreasing from x = 2 on, so start the integral at 2.

\int_2^{b} \dfrac{x}{x^2 + 4}\,dx = \dfrac{1}{2}\ln(b^2 + 4) - \dfrac{1}{2}\ln 8

Use u = x² + 4, du = 2x dx.

\lim_{b \to \infty} \dfrac{1}{2}\ln(b^2 + 4) = \infty

The log grows without bound.

Answer: the integral diverges, so the series diverges

5.

f(x) = (x + 1)^{-3/2}

Positive, continuous and decreasing for x ≥ 1.

\int_1^{b} (x + 1)^{-3/2}\,dx = -2(b + 1)^{-1/2} + 2(2)^{-1/2}

An antiderivative is −2/√(x + 1).

\lim_{b \to \infty} \left(-\dfrac{2}{\sqrt{b + 1}} + \dfrac{2}{\sqrt{2}}\right) = \sqrt{2}

The first part goes to 0, and 2/√2 = √2.

Answer: the integral is √2, so the series converges

6.

f'(x) = \dfrac{1 - \ln x}{x^2} \lt 0 \text{ for } x \gt e

Use the quotient rule; f is positive, continuous and decreasing for x ≥ 3.

\int_3^{b} \dfrac{\ln x}{x}\,dx = \dfrac{(\ln b)^2}{2} - \dfrac{(\ln 3)^2}{2}

Use u = ln x, du = dx/x.

\lim_{b \to \infty} \dfrac{(\ln b)^2}{2} = \infty

It grows without bound.

Answer: the integral diverges, so the series diverges

7.

f(x) = \dfrac{1}{x(\ln x)^2}

Positive, continuous and decreasing for x ≥ 2.

\int_2^{b} \dfrac{1}{x(\ln x)^2}\,dx = -\dfrac{1}{\ln b} + \dfrac{1}{\ln 2}

Use u = ln x; an antiderivative of u⁻² is −u⁻¹.

\lim_{b \to \infty} \left(-\dfrac{1}{\ln b} + \dfrac{1}{\ln 2}\right) = \dfrac{1}{\ln 2}

1/ln b goes to 0.

Answer: the integral is 1/ln 2 ≈ 1.443, so the series converges

8.

f'(x) = \dfrac{1 - 2x\arctan x}{(1 + x^2)^2} \lt 0 \text{ for } x \ge 1

Use the quotient rule; at x = 1, 2x arctan x = π/2 ≈ 1.57 and it keeps growing, so f is decreasing.

u = \arctan x,\ du = \dfrac{dx}{1 + x^2}

Substitute.

\int_1^{b} \dfrac{\arctan x}{1 + x^2}\,dx = \dfrac{(\arctan b)^2}{2} - \dfrac{(\pi/4)^2}{2}

An antiderivative of u is u²/2.

\lim_{b \to \infty} \left(\dfrac{(\arctan b)^2}{2} - \dfrac{\pi^2}{32}\right) = \dfrac{\pi^2}{8} - \dfrac{\pi^2}{32}

arctan b goes to π/2, and (π/2)²/2 = π²/8.

\dfrac{\pi^2}{8} - \dfrac{\pi^2}{32} = \dfrac{3\pi^2}{32}

Use a common denominator.

Answer: the integral is 3π²/32 ≈ 0.925, so the series converges

9.

f(x) = \dfrac{2 + \sin x}{x^2}

This is positive and continuous.

f(5) \approx 0.0416,\ f(7.8) \approx 0.0493

Check a few values: f goes up between x = 5 and x = 7.8.

Answer: f is not decreasing, because sin x keeps rising and falling, so the integral test does not apply (a comparison with 3/n² shows the series converges)

10.

R_N \le \int_N^{\infty} \dfrac{1}{x^2}\,dx = \dfrac{1}{N}

Use the remainder estimate; the integral is 1/N.

\dfrac{1}{N} \lt 0.01

Make the error bound small enough.

N \gt 100

Take reciprocals of both positive sides; the inequality flips.

Answer: 101 terms guarantee an error less than 0.01

Integral test FAQ

What are the conditions for the integral test?

The function f with f(n) = a_n must be positive, continuous and decreasing for x ≥ 1, or at least from some point on. If any condition fails, the test does not apply.

Does the integral give the sum of the series?

No. The integral and the series converge or diverge together, but their values are usually different. For example, \int_1^{\infty} \frac{dx}{x^2} = 1, while \sum \frac{1}{n^2} = \frac{\pi^2}{6} \approx 1.645.

Why does the harmonic series diverge?

The integral of 1/x from 1 to b is ln b, which grows without bound. By the integral test, the harmonic series diverges too.

When should I use the integral test?

Use it when the terms come from a function you can integrate easily, like \frac{1}{n\ln n} or ne^{-n^2}, and that function is positive and decreasing. For powers of n, the p-series test is quicker.

Summary

  • If f is positive, continuous and decreasing with f(n) = a_n, then \sum a_n and \int_1^{\infty} f(x)\,dx both converge or both diverge.
  • Check the three conditions, then evaluate the improper integral as a limit.
  • The integral’s value is not the sum of the series.
  • The remainder after N terms is between \int_{N+1}^{\infty} f(x)\,dx and \int_N^{\infty} f(x)\,dx.
  • The harmonic series diverges because \int_1^{\infty} \frac{dx}{x} diverges.

Previous lesson: Telescoping Series

Next lesson: p-Series

Back to the Calculus 2 Index