Does the improper integral converge?
Type the function and the limits; a limit can be inf or -inf. The page says whether the improper integral converges, gives its value exactly and as a decimal, or says it diverges.
- Value
- 1
The integral of 1/x^2 from 1 to inf is 1.
- The integral
- Converges
- Exact value
- 1
Value: 1. The integral of 1/x^2 from 1 to inf is 1.
How to calculate
Evaluates integrals over infinite intervals or with an infinite end, or shows that they diverge, checked numerically.
Example with the default inputs (Function f(x) 1/x^2, Lower limit a 1, Upper limit b inf): The integral of 1/x^2 from 1 to inf is 1.
Method: ∫ from a to ∞ of f = lim (R → ∞) ∫ from a to R of f, and alike at −∞ or at an end where f is infinite. A computer algebra system finds the antiderivative and its limits; each value is checked by numeric integration.
- The variable is x; angles are in radians; ln is the natural logarithm.
- f has no pole strictly between a and b.
- An answer that fails its check is not shown.
Worked examples
Each example is checked against the calculator on every build.
- Function f(x) pi/x^2, Lower limit a 1, Upper limit b inf gives The integral Converges, Value 3.141593, Exact value π.Source: OpenStax, Calculus Volume 2, section 3.7 Improper Integrals, Example 3.48. https://openstax.org/books/calculus-volume-2/pages/3-7-improper-integrals
- Function f(x) 1/(x^2 + 4), Lower limit a -inf, Upper limit b 0 gives The integral Converges, Value 0.785398.
- Function f(x) 1/sqrt(4 - x), Lower limit a 0, Upper limit b 4 gives The integral Converges, Value 4, Exact value 4.
- Function f(x) 1/x, Lower limit a 1, Upper limit b inf gives The integral Diverges.
How it works
The page evaluates ∫ from a to b of f(x) dx, where a may be −∞, b may be ∞, and f may be infinite at a or b. It says Converges with the value, or Diverges.
A computer algebra system (nerdamer, open source) does the algebra, in the background after you start typing. The work is split into pieces:
- Both limits finite: one definite integral from a to b, worked out as on the integral calculator: F(b) − F(a) with a checked antiderivative F. Where f is infinite at an end, the limit of F from inside the interval is used; if |F| keeps growing towards that end, the integral diverges. A removable gap inside (sin(x)/x at 0) changes nothing; a pole inside, or a part of [a, b] where f is not a real number, gives no value.
- b = ∞: split at c = a when a is more than 1 (as you typed it), else c = 1. From a to c (when a is less than c) it is a finite definite integral as above. From c to ∞ the substitution x = 1/t gives ∫ from 0 to 1/c of f(1/t)/t² dt, a definite integral with an improper end at t = 0.
- a = −∞: split at c = b when b is less than −1 (as you typed it), else c = −1. From c to b (when c is less than b) it is a finite definite integral; from −∞ to c the substitution x = −1/t gives ∫ from 0 to −1/c of f(−1/t)/t² dt.
- a = −∞ and b = ∞: three pieces, split at −1 and 1.
For a piece to ±∞ whose substituted integral has no exact form, the page also tries the antiderivative F of f: its limit L at ±∞ less F(c) (the other way round at −∞). This exact form is used when its value agrees with the piece's value to 1 part in 10⁹.
Divergence at ±∞. When the substituted integral of a piece has no answer, the page takes the antiderivative F of f and looks at |F(x)| at x = 8, 8², 8³, …, 8⁸ = 16,777,216 (their negatives at −∞), so a pole of f out to about 10⁶, where |F| grows and then falls, does not pass for divergence. If, from the third point on, each value is too large for a double or both grows from the point before and grows by at least 0.9 times the growth before that, F grows without bound and the integral diverges (1/x from 1 to ∞: F = ln|x| grows by ln 8 each time x grows 8 times). Otherwise the page gives no answer.
The value is the sum of the pieces. The exact value is shown when every piece has one: the pieces are added (with atan(1) written as π/4 and atan(−1) as −π/4) and simplified by the algebra when the simplified sum stays exact; otherwise the sum is shown as it is, unless it holds a rounded number, when only the decimal is shown.
Every piece is checked. Its value F(end) − F(start) must agree with a numeric integral of the function (Gauss-Kronrod quadrature, or tanh-sinh quadrature at an improper end) to 1 part in 10⁷ of the integral of its absolute value; the antiderivative is checked by differentiating it numerically at 20 points. A result that holds a number the algebra could only give rounded (a whole number past 2⁵³; a fraction p/q, p and q being the numbers that multiply its top and its bottom, such as 288557167/(342919925e), when q after removing its factors 2 and 5 is over 1,000,000, or is over 1 while |p| times it is over 10¹²; or a decimal with more than 12 significant digits) is never shown as exact.
What you can type
- A number has at most 15 digits in a row. A computer number keeps only about 16 digits, so a longer one (9007199254740993) would stand for a nearby number (9007199254740992), and the page asks for fewer digits instead. Write very large or very small numbers with a power of ten (1e-20).
- The function f uses the variable x. Numbers can have decimals (2.5) and powers of ten (1e-3).
- Operations: + − * / and ^ for powers. Brackets group. A number or bracket next to a letter multiplies: 2x, 3(x + 1), x sin(x).
- Constants: pi (or π) and e.
- Functions: sqrt, cbrt, ln (and log, the same natural logarithm), log10, exp, abs (or |x|), sin, cos, tan, sec, csc, cot, asin, acos, atan (arcsin, arccos, arctan also work), sinh, cosh, tanh and their inverses. Angles are in radians. sin x without brackets means sin(x); sin x^2 means sin(x²).
- The limits a and b are numbers or constant expressions (0, 1, pi, e), or inf and -inf (also infinity, ∞ and oo). a must be less than b.
What gets no answer
- A pole strictly between a and b (1/x³ from −1 to 1, or 1/(x − 2·10⁶)² from 1 to ∞): split the integral there and enter the two parts. A pole past 8⁸ on an infinite interval can still show as Diverges (then the integral does diverge, as |F| grows without bound towards that pole).
- An integral that oscillates without settling (sin(x) from 0 to ∞), or grows too slowly to tell (1/(x ln²x) from 2 to ∞ converges, but its antiderivative approaches its limit too slowly for the checks).
- A step that fails its check, finds no formula (e^(−x²) from 0 to ∞ needs erf at ∞, which the algebra cannot take), or takes over 3 seconds.
Worked examples by hand
∫ from 1 to ∞ of π/x² dx (OpenStax Calculus Volume 2, section 3.7, Example 3.48: the volume of Gabriel's horn). An antiderivative is −π/x, which tends to 0 as x → ∞. The integral is 0 − (−π/1) = π: it converges.
∫ from −∞ to 0 of 1/(x² + 4) dx (OpenStax Calculus Volume 2, section 3.7, Example 3.50). An antiderivative is atan(x/2)/2, which tends to −π/4 as x → −∞. The integral is 0 − (−π/4) = π/4 = 0.7853981634: it converges. The page writes its exact value as atan(2)/2 − atan(−1/2)/2, which equals π/4 because atan(2) + atan(1/2) = π/2.
∫ from 0 to 4 of 1/√(4 − x) dx (OpenStax Calculus Volume 2, section 3.7, Example 3.52). f is infinite at 4. An antiderivative is −2√(4 − x), which tends to 0 as x → 4. The integral is 0 − (−2√4) = 4: it converges.
∫ from 1 to ∞ of 1/x dx (OpenStax Calculus Volume 2, section 3.7, Example 3.47). An antiderivative is ln|x|, which grows without bound: the integral diverges.
Other questions people ask
What is an improper integral?
A definite integral where an end is infinite, as in ∫ from 1 to ∞ of 1/x² dx, or where the function is infinite at an end, as in ∫ from 0 to 4 of 1/√(4 − x) dx. It is defined as a limit: ∫ from 1 to ∞ of f = lim (t → ∞) ∫ from 1 to t of f.
When does an improper integral converge?
When that limit is a finite number. ∫ from 1 to ∞ of 1/x² dx = lim (1 − 1/t) = 1 converges. ∫ from 1 to ∞ of 1/x dx = lim ln(t) is infinite, so it diverges. The integral of 1/xᵖ from 1 to ∞ converges exactly when p > 1.
How do I type infinity?
Type inf for ∞ and -inf for −∞ (infinity, ∞ and oo also work). For an integral over the whole line, such as that of 1/(1 + x²), use -inf and inf.
What if the function is infinite inside the interval?
Then the integral must be split at that point into two improper integrals, and it converges only if both do. The page takes infinite values at the ends but not inside: for 1/x³ from −1 to 1 it says the function has a pole between a and b. Enter the two halves separately, from −1 to 0 and from 0 to 1.
Why is the exact value sometimes long?
The page adds the exact values of up to three pieces (see How it works) and simplifies the sum when the algebra keeps it exact. When it cannot, the sum stays as it is, such as atan(2)/2 − atan(−1/2)/2 for π/4; the decimal is the same.
How is the answer checked?
Each piece is a definite integral whose value is compared with a numeric integral of the function; an antiderivative is checked by differentiating it numerically at 20 points. If a check fails, the page says "No verified answer".