JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Improper Integrals: Integrating to Infinity

What happens if you let the right edge of an integral run off to infinity, or the curve shoot up to infinity inside the interval? Sometimes the total area is a finite number; sometimes it grows without bound. The honest way to tell them apart is a **limit** — and the answer is sometimes shocking.

When the ordinary rules run out

Every definite integral you have computed so far lived on a tidy finite interval [a, b], with a function that stayed finite the whole way across. The Fundamental Theorem then handed you the answer as F(b) - F(a). But two things can break that tidiness. The interval can stretch to infinity — integral from 1 to infinity of something. Or the function can blow up to infinity somewhere inside the interval — like 1/sqrt(x) right at x = 0. In either case the symbol F(b) - F(a) no longer literally makes sense, because there is no honest endpoint to plug in.

An integral with either of these features is called an [[improper-integral|improper integral]]. The word "improper" is not an insult — it just flags that the definition you learned does not apply directly. So we do the same move that rescued everything else in calculus: we sneak up on the problem with a [[limit-at-infinity|limit]].

The definition: integrate to a wall, then push the wall away

Here is the trick made precise. To integrate from 1 all the way to infinity, you do not magically reach infinity. Instead you integrate up to a movable wall at x = b — that is an ordinary, well-behaved definite integral you already know how to do. Then you ask what happens to that number as you slide the wall b out toward infinity. If the number settles down to a single finite value L, we say the improper integral converges to L. If it grows without bound or never settles, we say it diverges.

integral from a to infinity of f(x) dx  =  lim b->infinity  ( integral from a to b of f(x) dx )

  converges  ->  the limit is a finite number L
  diverges   ->  the limit is infinite, or does not exist
An infinite-interval improper integral is DEFINED as the limit of ordinary integrals up to a moving endpoint b.

The unbounded-function case works exactly the same way, just from the other side. If f blows up at x = a, you start the wall a tiny bit past the trouble — integrate from a + t to b — and then let t -> 0 to creep up on the bad point. Same philosophy: never touch the dangerous spot directly; approach it through a limit and see whether the area stays finite.

The shock: 1/x^2 converges, 1/x diverges

Now for the genuinely surprising part. Picture the curves y = 1/x and y = 1/x^2 to the right of x = 1. Both drop toward zero forever; both trap an infinitely long sliver of area. Your gut probably says: an infinitely long region must hold infinite area. Your gut is half wrong. The two integrals behave completely differently — and the only way to know is to take the limit.

  1. Convergent case: integral from 1 to b of 1/x^2 dx = [-1/x] from 1 to b = -1/b + 1 = 1 - 1/b. As b -> infinity, the term 1/b vanishes, so the limit is 1. The total area under 1/x^2 out to infinity is exactly 1 — finite! It converges.
  2. Divergent case: integral from 1 to b of 1/x dx = [ln x] from 1 to b = ln(b) - ln(1) = ln(b). As b -> infinity, ln(b) keeps climbing forever — slowly, but without any ceiling. The limit is infinite, so the area under 1/x is unbounded. It diverges.

So two curves that look almost identical — both vanishing toward zero — split into opposite fates. The deciding factor is how *fast* the function shrinks. 1/x^2 dies off quickly enough that its tail areas add up to a finite total; 1/x crawls toward zero just a hair too slowly, and its endless tail accumulates without limit. The whole drama of convergence and divergence lives in that razor's edge.

A bridge to summing infinitely many things

Look again at what just happened. You added up an *infinite* amount of stuff — area stretching out forever — and asked whether the running total approaches a finite number. That is precisely the question waiting for you in the next track. Replace the smooth area under a curve with a list of discrete numbers added one after another, and you have an [[infinite-series|infinite series]]: a sum like 1 + 1/4 + 1/9 + 1/16 + ... that never ends.

The logic transfers exactly. A series converges when its partial sums (1, then 1 + 1/4, then 1 + 1/4 + 1/9, ...) approach a finite limit, and diverges otherwise — the very same converge/diverge language, the very same limit idea. There is even a theorem (the integral test) that uses an improper integral of 1/x^2 to prove the sum 1 + 1/4 + 1/9 + ... converges, and the divergence of integral 1/x to prove the famous harmonic sum 1 + 1/2 + 1/3 + ... diverges. The two stories are the same story.

import math

# integrate 1/x^2 up to a moving wall b, watch it settle toward 1
for b in [10, 100, 10000, 10**8]:
    print(b, 1 - 1/b)        # -> 0.9, 0.99, 0.9999, ~1.0   (converges to 1)

# integrate 1/x up to the same walls, watch it climb forever
for b in [10, 100, 10000, 10**8]:
    print(b, math.log(b))    # -> 2.3, 4.6, 9.2, 18.4 ...   (no ceiling -> diverges)
Numerically: 1 - 1/b homes in on 1 (convergent), while ln(b) keeps rising with no limit (divergent).