Improper Integrals

Published on 2026-11-04·v1.0

Learning Objectives

  • Define an improper integral over an unbounded interval, and over an interval where the integrand blows up, as a limit of ordinary integrals, and say when it converges or diverges.
  • Classify ∫1∞x−p dx\int_1^\infty x^{-p}\,dx and ∫01x−p dx\int_0^1 x^{-p}\,dx for every real pp (the pp-test) and compute their values when they converge.
  • Apply the comparison theorem with all of its hypotheses to decide convergence without finding an antiderivative.
  • Recognize the two classic traps: using the Fundamental Theorem of Calculus across a singularity, and letting a symmetric limit hide a divergence.
  • Explain why "a density has total area 1" is an improper integral over the whole line, and why a density can integrate to 1 while its mean does not exist.

Context & Motivation

The definite integral you built from Riemann sums (the-definite-integral-and-riemann-sums) and evaluated with antiderivatives (the-fundamental-theorem-of-calculus) was defined for a function on a closed, bounded interval [a,b][a, b], and the Fundamental Theorem needs the function to be continuous on all of it. Two situations break those assumptions and both are everywhere in practice: an interval that never ends, such as the tail of a distribution, and an integrand that shoots off to infinity at an endpoint. The area in question may still be a perfectly good finite number, so the work is to say precisely when, and how to compute it.

The lesson continuous-random-variables-and-pdfs introduced a probability density as a non-negative curve with total area 1, and checked that condition with rectangles and triangles over a bounded interval. Densities that matter in practice, the exponential and the normal among them, have curved shapes and tails that stay positive forever, so the "total area" is the area under an infinite tail. That area is a limit, and it is exactly what this lesson makes precise. The same machinery decides whether a mean or a variance exists, which is a real question for heavy-tailed quantities.

Core Theory

Type I: an unbounded interval

If ff is continuous on [a,∞)[a, \infty), define

∫a∞f(x) dx=lim⁡b→∞∫abf(x) dx\int_a^\infty f(x)\,dx = \lim_{b\to\infty} \int_a^b f(x)\,dx

The integral converges if this limit exists and is a finite number, and diverges otherwise (the limit is ±∞\pm\infty, or does not exist). The case (−∞,b](-\infty, b] is the mirror image. For the whole line, pick any cc and require both halves to converge on their own:

∫−∞∞f(x) dx=∫−∞cf(x) dx+∫c∞f(x) dx\int_{-\infty}^{\infty} f(x)\,dx = \int_{-\infty}^{c} f(x)\,dx + \int_{c}^{\infty} f(x)\,dx

If either half diverges, the whole integral diverges. The choice of cc does not change the answer.

Type II: an integrand that blows up

If ff is continuous on (a,b](a, b] but unbounded near aa, define

∫abf(x) dx=lim⁡t→a+∫tbf(x) dx\int_a^b f(x)\,dx = \lim_{t\to a^+} \int_t^b f(x)\,dx

and treat a blow-up at the right end the same way. If the bad point cc lies strictly inside (a,b)(a, b), split at cc and require both pieces to converge separately. A function that merely has a removable gap, such as sin⁡x/x\sin x / x at 00, does not make the integral improper, because the function extends to a continuous one.

The pp-test

For p≠1p \neq 1 the antiderivative of x−px^{-p} is x1−p/(1−p)x^{1-p}/(1-p), so ∫1bx−p dx=(b1−p−1)/(1−p)\int_1^b x^{-p}\,dx = (b^{1-p} - 1)/(1-p). As b→∞b \to \infty the power b1−pb^{1-p} tends to 00 when p>1p > 1 and to ∞\infty when p<1p < 1. For p=1p = 1 the integral is ln⁡b→∞\ln b \to \infty. On the other end, ∫t1x−p dx\int_t^1 x^{-p}\,dx is handled the same way with t→0+t \to 0^+. The results:

  • ∫1∞x−p dx\int_1^\infty x^{-p}\,dx converges exactly when p>1p > 1, and then equals 1p−1\dfrac{1}{p-1}.
  • ∫01x−p dx\int_0^1 x^{-p}\,dx converges exactly when p<1p < 1, and then equals 11−p\dfrac{1}{1-p}.

The borderline p=1p = 1 diverges in both cases. The tail wants a fast decay (large pp), the singularity wants a mild blow-up (small pp).

The comparison theorem

Suppose ff and gg are continuous on [a,∞)[a, \infty) and 0≤f(x)≤g(x)0 \le f(x) \le g(x) for every x≥ax \ge a. Then:

  • if ∫a∞g\int_a^\infty g converges, so does ∫a∞f\int_a^\infty f, and ∫a∞f≤∫a∞g\int_a^\infty f \le \int_a^\infty g;
  • if ∫a∞f\int_a^\infty f diverges, so does ∫a∞g\int_a^\infty g.

The reason is short. Because f≥0f \ge 0, the function b↦∫abfb \mapsto \int_a^b f never decreases, and because f≤gf \le g it is capped by ∫a∞g\int_a^\infty g. A non-decreasing quantity with an upper bound has a limit (the sequence version of this fact is the subject of sequences-and-convergence). The theorem says nothing when the smaller integral converges or the larger one diverges. It also fails without the hypothesis f≥0f \ge 0: with f(x)=−1f(x) = -1 and g(x)=1/x2g(x) = 1/x^2 we have f≤gf \le g and ∫1∞g=1\int_1^\infty g = 1, yet ∫1bf=−(b−1)→−∞\int_1^b f = -(b-1) \to -\infty.

Densities, normalization, and moments

A density ff on the line must satisfy f≥0f \ge 0 and ∫−∞∞f=1\int_{-\infty}^{\infty} f = 1, now read as a pair of improper integrals. The normal density from the-normal-distribution is stated there without derivation, and its constant is exactly what this integral requires: ∫−∞∞e−x2/2 dx=2π\int_{-\infty}^{\infty} e^{-x^2/2}\,dx = \sqrt{2\pi}, so dividing by 2π\sqrt{2\pi} (and rescaling by σ\sigma) gives total area 1. There is no elementary antiderivative of e−x2/2e^{-x^2/2}, so this value comes from a different argument, while convergence alone follows from comparison: for x≥1x \ge 1, x2/2≥x/2x^2/2 \ge x/2, so 0<e−x2/2≤e−x/20 < e^{-x^2/2} \le e^{-x/2}, and ∫1∞e−x/2 dx=2e−1/2\int_1^\infty e^{-x/2}\,dx = 2e^{-1/2} is finite (Example 3 does the same for e−x2e^{-x^2}).

The mean of a continuous random variable is ∫xf(x) dx\int x f(x)\,dx, another improper integral. Normalization does not guarantee that it converges, and Example 4 shows densities where it fails.

Worked Examples

Example 1: the pp-integrals with numbers

Compute ∫1bx−2 dx=1−1/b\int_1^b x^{-2}\,dx = 1 - 1/b and ∫1bx−1 dx=ln⁡b\int_1^b x^{-1}\,dx = \ln b for growing bb:

text
b int_1^b x^-2 int_1^b x^-1 int_1^b x^(-1/2) 10 0.9 2.3026 4.3246 100 0.99 4.6052 18.0 1000 0.999 6.9078 61.2456 1000000 0.999999 13.8155 1998.0

The first column settles at 11, so ∫1∞x−2 dx=1\int_1^\infty x^{-2}\,dx = 1. The other two keep growing without bound, so ∫1∞x−1 dx\int_1^\infty x^{-1}\,dx and ∫1∞x−1/2 dx\int_1^\infty x^{-1/2}\,dx diverge. Note how slow ln⁡b\ln b is: it needs b=106b = 10^6 to reach about 13.813.8. A table of values can suggest divergence but the formula is what proves it.

Near zero the roles reverse. ∫t1x−1/2 dx=2−2t\int_t^1 x^{-1/2}\,dx = 2 - 2\sqrt{t}, which tends to 22 as t→0+t \to 0^+, so ∫01x−1/2 dx=2\int_0^1 x^{-1/2}\,dx = 2 even though the integrand is unbounded. But ∫t1x−1 dx=−ln⁡t\int_t^1 x^{-1}\,dx = -\ln t grows without bound, so ∫01x−1 dx\int_0^1 x^{-1}\,dx diverges.

Example 2: two traps

Across a singularity. Consider ∫−11x−2 dx\int_{-1}^{1} x^{-2}\,dx. The antiderivative −1/x-1/x gives (−1/1)−(−1/(−1))=−2(-1/1) - (-1/(-1)) = -2, a negative answer for a positive integrand, which already signals a mistake. The function x−2x^{-2} is not continuous at 00, so the Fundamental Theorem does not apply on [−1,1][-1, 1]. Splitting at 00 gives ∫t1x−2 dx=1/t−1\int_t^1 x^{-2}\,dx = 1/t - 1, which is 9,99,9999, 99, 999 for t=0.1,0.01,0.001t = 0.1, 0.01, 0.001 and tends to ∞\infty. The integral diverges to +∞+\infty.

A symmetric limit. For f(x)=xf(x) = x, the symmetric limit is lim⁡R→∞∫−RRx dx=0\lim_{R\to\infty} \int_{-R}^{R} x\,dx = 0. But ∫0Rx dx=R2/2→∞\int_0^R x\,dx = R^2/2 \to \infty, so ∫−∞∞x dx\int_{-\infty}^{\infty} x\,dx diverges. Cutting the line at −R-R and 2R2R instead gives ∫−R2Rx dx=3R2/2\int_{-R}^{2R} x\,dx = 3R^2/2, a different "answer". When the two halves are not each convergent, the value depends on how the cuts are taken, so no value is assigned.

Example 3: comparison in both directions

Convergence. For x≥1x \ge 1 we have x2≥xx^2 \ge x, hence 0<e−x2≤e−x0 < e^{-x^2} \le e^{-x}. Since ∫1∞e−x dx=e−1≈0.3679\int_1^\infty e^{-x}\,dx = e^{-1} \approx 0.3679 converges, ∫1∞e−x2 dx\int_1^\infty e^{-x^2}\,dx converges and is at most 0.36790.3679. Numerical integration gives 0.13940.1394, consistent with the bound. Together with the part over [0,1][0, 1], which is an ordinary integral, and symmetry, this gives convergence on the whole line.

Divergence. For x≥1x \ge 1, (2+sin⁡x)/x≥1/x>0(2 + \sin x)/x \ge 1/x > 0. Because ∫1∞x−1 dx\int_1^\infty x^{-1}\,dx diverges, so does ∫1∞(2+sin⁡x)/x dx\int_1^\infty (2+\sin x)/x\,dx. The partial integrals confirm it:

text
b int_1^b (2+sin x)/x lower bound ln b 100 9.83 4.61 10000 19.05 9.21 1000000 28.26 13.82

The oscillation of sin⁡x\sin x does not rescue convergence: the bound 2+sin⁡x≥12 + \sin x \ge 1 keeps the integrand above a divergent integral.

Example 4: densities, tails, and missing means

Exponential. For rate λ>0\lambda > 0, f(x)=λe−λxf(x) = \lambda e^{-\lambda x} on x≥0x \ge 0 has ∫0bf=1−e−λb→1\int_0^b f = 1 - e^{-\lambda b} \to 1, so the total area is 11, and P(X>t)=∫t∞f=e−λtP(X > t) = \int_t^\infty f = e^{-\lambda t}. With λ=2\lambda = 2 and t=1.5t = 1.5 this is e−3≈0.0498e^{-3} \approx 0.0498.

Pareto. For α>0\alpha > 0, f(x)=αx−α−1f(x) = \alpha x^{-\alpha-1} on x≥1x \ge 1 integrates to 11 by the pp-test with p=α+1p = \alpha + 1. The mean is ∫1∞x⋅αx−α−1 dx=α∫1∞x−α dx\int_1^\infty x \cdot \alpha x^{-\alpha-1}\,dx = \alpha \int_1^\infty x^{-\alpha}\,dx, which converges only for α>1\alpha > 1, with value α/(α−1)\alpha/(\alpha-1). For α=3\alpha = 3 the mean is 1.51.5 and for α=1.5\alpha = 1.5 it is 33. For α=1\alpha = 1 the density is valid but ∫1bx⋅x−2 dx=ln⁡b\int_1^b x \cdot x^{-2}\,dx = \ln b for b=102,104,106b = 10^2, 10^4, 10^6 is 4.61,9.21,13.824.61, 9.21, 13.82 and never levels off: the mean does not exist.

Cauchy. The density 1/(π(1+x2))1/(\pi(1+x^2)) has ∫−∞∞f=1\int_{-\infty}^{\infty} f = 1, but ∫0bxf dx=ln⁡(1+b2)/(2π)\int_0^b x f\,dx = \ln(1+b^2)/(2\pi) takes the values 0.73,2.20,4.400.73, 2.20, 4.40 at b=10,103,106b = 10, 10^3, 10^6 and diverges. By symmetry the left half diverges to −∞-\infty, so the mean does not exist, even though the symmetric limit would suggest 00 (the trap from Example 2).

Unbounded height. The density 1/(πx(1−x))1/(\pi\sqrt{x(1-x)}) on (0,1)(0, 1) has total area 11 as a Type II integral at both ends, yet f(10−4)≈31.8f(10^{-4}) \approx 31.8 and ff is unbounded. The remark in continuous-random-variables-and-pdfs that a density's height can exceed 11 is therefore not a small effect: there is no upper bound at all.

Common Misconceptions & Pitfalls

  • "If f(x)→0f(x) \to 0 then ∫a∞f\int_a^\infty f converges." The function 1/x1/x tends to 00 and its integral diverges. The rate matters, which is why the pp-test has a threshold at p=1p = 1.
  • "If ∫a∞f\int_a^\infty f converges then f(x)→0f(x) \to 0." True when ff is non-negative and non-increasing, but false in general, even for non-negative continuous ff. Place a triangular spike of height nn and base width 2/n32/n^3 around each integer n≥2n \ge 2. Its area is 12⋅2n3⋅n=1/n2\tfrac12 \cdot \tfrac{2}{n^3} \cdot n = 1/n^2, and the total area is the series ∑n≥21/n2=π2/6−1≈0.645\sum_{n\ge 2} 1/n^2 = \pi^2/6 - 1 \approx 0.645 (series are the topic of infinite-series-and-partial-sums). The integral converges while ff keeps returning to height nn.
  • "Apply the antiderivative anyway, the answer is a number." Across a discontinuity inside the interval the Fundamental Theorem does not apply, and the formal answer can even have the wrong sign (Example 2).
  • "A symmetric interval means the answer is 00 for an odd function." Only when each half converges. Otherwise ∞−∞\infty - \infty is not a number.
  • "Comparison works with any inequality." It needs 0≤f≤g0 \le f \le g on the whole tail, continuity, and the correct direction: a convergent upper bound forces convergence, a divergent lower bound forces divergence, and the other two combinations prove nothing.
  • "A density that integrates to 11 has a mean." Example 4 gives the Pareto density with α=1\alpha = 1 and the Cauchy density, where the mean integral diverges.

Summary

An improper integral replaces an endpoint at infinity, or a point where the integrand blows up, by a limit of ordinary integrals, and it converges only when that limit is finite. For a doubly infinite interval or an interior singularity, each piece must converge separately. The pp-test is the benchmark: ∫1∞x−p dx\int_1^\infty x^{-p}\,dx converges exactly when p>1p > 1 (value 1/(p−1)1/(p-1)), while ∫01x−p dx\int_0^1 x^{-p}\,dx converges exactly when p<1p < 1 (value 1/(1−p)1/(1-p)). The comparison theorem decides convergence for non-negative continuous integrands by trapping them against a pp-integral. These tools turn "the total area under a density is 1" into a checkable statement about a limit, and they show that moments such as the mean can fail to exist even for a valid density. The next lesson, sequences-and-convergence, applies the same limit idea to lists of numbers instead of areas.

Documentation Links