Skip to content
Tutorials Center
My learning

Topics

Lesson 21 of 68 ยท Integrals

Improper Integrals and Convergence

Handle improper integrals with infinite limits or singularities: limits, the p-test, comparison test, the Gaussian integral and series convergence tests.

Everything so far assumed a finite interval and a well-behaved function. Real problems break both rules. How much total energy does a decaying signal carry over all future time? What is the area under 1/x**2 from 1 out to infinity? What is the area under 1/sqrt(x) right up to the point where it explodes at 0?

An improper integral extends the integral to these cases by replacing the troublesome endpoint with a variable and taking a limit. Sometimes the result is a finite number (we say it converges). Sometimes it grows without bound (it diverges). Telling the two apart is the central skill of this lesson.

Infinite limits

For an infinite upper limit:

integral from a to infinity of f(x) dx = limit as R -> infinity of (integral from a to R of f(x) dx)

Take f(x) = 1/x**2 from 1: the integral up to R is 1 - 1/R, which tends to 1. So it converges to 1. Now take f(x) = 1/x: the integral up to R is ln(R), which grows forever, so it diverges. Both functions shrink toward zero, yet only one has finite area. Shrinking to zero is not enough; it must shrink fast enough.

Python Watch the limit as R grows

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A result of oo means divergence. Another outcome: the limit may not exist because the integral oscillates, which also counts as divergence.

The p-test

The family 1/x**p is the yardstick for everything else:

  • integral from 1 to infinity of 1/x**p dx converges if p > 1 and diverges if p <= 1.
  • integral from 0 to 1 of 1/x**p dx converges if p < 1 and diverges if p >= 1.

The two statements look opposite for a reason: at infinity you want fast decay, near zero you want mild blow-up.

Integrands that blow up

If f is unbounded at an endpoint, replace that endpoint with a variable. For 1/sqrt(x) on [0, 1] (here p = 1/2 < 1):

integral from t to 1 of x**(-1/2) dx = 2 - 2*sqrt(t), and as t -> 0 this tends to 2. Converges.

If the trouble sits inside the interval, split there and test each piece; both must converge. A classic trap is 1/x**2 on [-1, 1]: naively applying the Fundamental Theorem gives -2, a negative area for a positive function. The integral actually diverges, since each half diverges.

flowchart TD
    A["Improper integral"] --> B{"Where is the problem?"}
    B -->|"infinite limit"| C["Replace with R, take R to infinity"]
    B -->|"singular endpoint"| D["Replace with t, take t to the endpoint"]
    B -->|"singular inside"| E["Split into two integrals"]
    C --> F{"Limit finite?"}
    D --> F
    E --> F
    F -->|"yes"| G["Converges"]
    F -->|"no"| H["Diverges"]

All improper integrals are handled by turning the problem point into a limit.

The comparison test

Often you cannot integrate exactly, but you can compare. For 0 <= f(x) <= g(x) on [a, infinity):

  • if the integral of g converges, then the integral of f converges;
  • if the integral of f diverges, then the integral of g diverges.

Example: e**(-x**2) <= e**(-x) for x >= 1, and the integral of e**(-x) converges, so the Gaussian tail converges. Another: 1/(x + sqrt(x)) >= 1/(2x) for x >= 1, and the integral of 1/(2x) diverges, so the original diverges.

The Gaussian integral

The bell curve integral over the whole real line is the most famous improper integral:

integral from -infinity to infinity of e**(-x**2) dx = sqrt(pi)

There is no elementary antiderivative, yet the total area is exact. This single result underlies the normal distribution in Probability and Random Variables.

Python The Gaussian integral, symbolic and numeric

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Do not trust a numerical answer without checking convergence on paper first. A numerical routine applied to a divergent integral does not announce failure politely; it may print a warning or return a number that means nothing.

Series: the same story in discrete form

An infinite series a1 + a2 + a3 + ... is the discrete cousin of an improper integral. The integral test makes the link: if f is positive, continuous and decreasing with f(n) = a_n, the series and the integral of f from 1 to infinity converge or diverge together. So sum of 1/n**2 converges (p = 2) and the harmonic series sum of 1/n diverges (p = 1), though it grows with painful slowness.

Other standard tests for a series:

  • Divergence test: if a_n does not tend to 0, the series diverges. (The converse is false: 1/n tends to 0 and still diverges.)
  • Comparison test: compare term by term with a known series.
  • Ratio test: compute L = lim |a_{n+1}/a_n|. If L < 1 it converges, if L > 1 it diverges, if L = 1 the test says nothing.
  • Alternating series test: if the terms alternate in sign and shrink to 0, the series converges.
Python Partial sums reveal behaviour

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The harmonic sum keeps climbing (about 7.5 after a thousand terms, 14.4 after a million), while the other two settle at pi**2/6 and ln(2). Evidence from partial sums is a hint, never a proof; a series that creeps up slowly can look as if it has settled. Radius of convergence for power series continues the story in Sequences and Infinite Series.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Does the integral of 1/x from 1 to infinity converge?

    The integral from 1 to R is ln(R), which grows without bound. The p-test agrees: p = 1 is not greater than 1.
  2. 2. For which p does the integral of 1/x**p from 0 to 1 converge?

    Near zero the integrand blows up, and the blow-up is mild enough only when p < 1.
  3. 3. Why is it wrong to apply the Fundamental Theorem to the integral of 1/x**2 over [-1, 1]?

    The theorem needs a continuous integrand on the interval. The singularity at 0 makes the integral improper, and it diverges.
  4. 4. The ratio test gives L = 1. What can you conclude?

    At L = 1 both converging series (1/n**2) and diverging series (1/n) are possible, so another test is needed.

Summary

  • An improper integral replaces an infinite limit or a singular point with a variable limit; it converges if that limit is finite.
  • The p-test: 1/x**p on [1, infinity) converges for p > 1; on (0, 1] it converges for p < 1.
  • The comparison test bounds an unknown integral by a known one; split at interior singularities.
  • The Gaussian integral over the real line equals sqrt(pi).
  • Series have parallel tests (integral, comparison, ratio, alternating); partial sums suggest but never prove convergence.

Next: Applications of Integrals.