MathsCalculus

Improper Integral
calculator.

Check whether an integral with an infinite limit or a blow-up converges.

How it's worked out

An ordinary integral needs a finite range and a bounded function. Break either rule, and the integral is defined as a limit of ordinary integrals. If the limit exists, the integral converges. If it does not, the integral diverges.

∫a∞f(x)dx\displaystyle \int_a^{\infty} f(x)\,dx=limR→∞⁡∫aRf(x)dx\displaystyle {}= \lim_{R \to \infty} \int_a^R f(x)\,dx

When f blows up at the lower limit a, the cut-off moves toward a instead. Here ε stands for a small gap that shrinks to 0.

∫abf(x)dx\displaystyle \int_a^b f(x)\,dx=limε→0+⁡∫a+εbf(x)dx\displaystyle {}= \lim_{\varepsilon \to 0^+} \int_{a+\varepsilon}^b f(x)\,dx

A range with no end on either side gets split, usually at 0, and each half must converge on its own. A blow-up inside the interval works the same way: split there, and both sides must converge.

How the value is found. The tool uses double-exponential quadrature, from Takahasi and Mori. A change of variable stretches the range so that the integrand dies off extremely fast at both ends, which absorbs both infinite limits and blow-ups at an end. The trapezoidal rule then runs on the new variable, halving its spacing until two estimates agree to about 12 digits.

How the verdict is decided. A convergent integral gives estimates that settle, and an integrand that has faded out at the ends of the stretched range. If either test fails, the tool reports that it does not converge. For a slow swing such as sin x over x, it integrates between zeros and speeds up the alternating sum instead.

Worked examples

Ines checks the bell curve constant

Ines wants to know why the normal curve formula holds a π\sqrt{\pi}. The curve e−x2e^{-x^2} has no ordinary antiderivative, so the usual subtraction has nothing to work with.

∫−∞∞e−x2dx\int_{-\infty}^{\infty} e^{-x^2}\,dx

The tool gives 1.772454, and that matches π\sqrt{\pi}. The tails barely matter: from −2 to 2 alone, the area is already 1.7642. The error function is built on this same integral, which is why it tends to 1.

Open this example in the tool

Tom compares two force laws

Tom pictures a force that fades with distance, in units where it starts at 1 at x=1x = 1. The total work to move out forever is the integral of that force from 1 to infinity.

If the force fades as 1x2\frac{1}{x^2}, as gravity does, the total is 1: finite, so escape takes a set amount of work. The table of ordinary integrals climbs 0.5, 0.9091, 0.9901, 0.999, and that is 1−1R1 - \frac{1}{R} closing in on 1.

If it fades as 1x\frac{1}{x}, the table runs 0.69, 2.4, 4.62, 6.91. These are ln⁡R\ln R, and they never stop growing, so no finite amount of work would do. A small change in the power flips the verdict.

Open this example in the tool

Ben meets an infinite spike with a finite area

Ben's graph of 1x\frac{1}{\sqrt{x}} shoots to infinity at 0, yet the area from 0 to 1 is exactly the limit of 2−2ε2 - 2\sqrt{\varepsilon}, which comes to 2. The spike gets so thin, so fast, that it holds very little.

His next problem is 1|x|\frac{1}{\sqrt{|x|}} from −1 to 1, with the spike inside the interval. He enters 0 as the blow-up point, so each side runs on its own. The total is 4, twice the first answer, as symmetry says it should be.

Open this example in the tool

Reading your result

A verdict is not a proof. The tool tests whether numbers settle. That works for typical problems, but an integral that converges very slowly, such as 1 over x to the 1.0001, can look divergent. To prove a verdict, compare your integrand with a p-integral, as the comparison theorem allows for a function between 0 and a known bound.

Here is the benchmark, from the key idea in APEX Calculus/06:_Techniques_of_Integration/6.08:_Improper_Integration). Notice that the two ranges swap: what fades fast enough at infinity blows up too hard at 0.

The p-integrals
p∫1∞1xpdx\int_1^\infty \frac{1}{x^p}\,dx∫011xpdx\int_0^1 \frac{1}{x^p}\,dx
0.5Diverges2
1DivergesDiverges
21Diverges
30.5Diverges

The closed form appears when the value matches a simple form to about 9 digits. It tries whole numbers and fractions, and multiples of π, the square root of π, e and a few others. It is a match on the number, so a match alone does not prove the value.

A gamma integral gives a factorial. The gamma function is an improper integral, and for a whole number n it equals (n−1)!(n - 1)!.

The integral of xn−1e−xx^{n-1}e^{-x} from 0 to ∞
nValueFactorial
110!
211!
322!
463!
5244!

Common mistakes

  • Integrating straight across a blow-up. For 1x2\frac{1}{x^2} from −1 to 1, the subtraction gives −2, a negative answer for a function that is never negative. Split at 0 and each side diverges, which is why the tool reports that it does not converge.
  • Cancelling the two sides. With 1x\frac{1}{x} on −1 to 1, symmetry tempts you to say 0. Neither side converges, so the tool says it diverges. The 0 you have in mind is the Cauchy principal value, which is a different quantity.
  • Using a symmetric limit over all x. The integral of x from −R to R is 0 for every R. But each half diverges, so the whole-line integral does not exist.
  • Trusting a swing to cancel. The integral of sin x from 0 to R swings between 0 and 2 forever, so it diverges. Divide by x and the lobes shrink, and it does converge, to 1.5708.

Questions people ask

The definition requires each side to converge on its own, and each one runs off to infinity. Cancellation only works if you shrink the gap around 0 at the same rate on both sides. A different rate gives a different answer, so there is no single value.

Sources