Improper Integral Calculator
An improper integral has a finite value only when its limit exists, and 1/x^2 from 1 to infinity gives 1. The same tail of 1/x grows without bound because the p-test tips at p = 1. Set the integrand and limits below to get the verdict and a Simpson estimate.
Pick the integrand, set the limits, and choose how many slices Simpson's rule should use. The verdict comes from the convergence rules; the number comes from the slices.
| Verdict | |
| Why | |
| Simpson estimate | |
| Closed form | |
| Estimate minus closed form | |
| Interval | |
| Slices used | |
| What the number means |
All calculations run in your browser, and nothing you type is uploaded or stored.
Set the integrand and the limits, including infinity, and see whether the integral converges, what it equals, and a Simpson estimate on a bounded copy of the interval.
Key takeaways
- The p-test on a tail: 1/x^p from 1 to infinity converges only when p is above 1, and the value is 1/(p-1), so p = 2 gives 1 and p = 3 gives 0.5
- The p-test at a spike: 1/x^p from 0 to 1 converges only when p is below 1, and p = 0.5 gives 2
- At p = 1 the antiderivative is the log, so 1/x from 1 to R only reaches 13.8155 at R = 1,000,000
- Integration by parts gives 1 for x e^(-x) on 0 to infinity, and the substitution x = u squared gives 2 for 1/sqrt(x) on 0 to 1
- A fixed slice count can undershoot a slow tail, so double n once and compare before trusting the estimate
On this page
Two ways an integral turns improper
A definite integral is proper when the interval is finite and the function stays finite across it. Two things can break that. The interval can run to infinity, or the function can blow up at a point inside the interval or at one of its ends. Either way the integral is improper, and it earns a value only through a limit.
For an infinite upper limit the definition is a limit of ordinary integrals: the integral from a to infinity of f(x) dx equals the limit, as R goes to infinity, of the integral from a to R. If that limit is a finite number, the integral converges and that number is its value. If the limit is infinite, or does not exist, the integral diverges.
An unbounded integrand works the same way, with the cut moved to the bad point. The integral of 1/sqrt(x) from 0 to 1 is the limit, as t goes to 0 from above, of the integral from t to 1. Near zero the curve is taller than any number you name, but it is also thin, and the limit comes out at 2.
A singularity inside the interval forces a split. The integral of 1/x^2 from -1 to 1 is not zero. It breaks into a left piece from -1 to 0 and a right piece from 0 to 1, and each piece is infinite on its own. Two infinite pieces do not cancel. OpenStax Calculus Volume 2 states this split rule in its section on improper integrals.
One habit makes the whole subject easier. Write the limit on every line, even when the antiderivative is easy. Skipping it is how people end up plugging infinity into a formula and reporting a number that does not exist.
The p-test, and why p = 1 is the hinge
Almost every textbook example reduces to one family, 1/x^p, and two rules cover it. The rules point in opposite directions because the two kinds of improper integral are mirror images of each other.
On a tail that runs to infinity, the integral from 1 to infinity of 1/x^p converges when p is above 1, and then its value is 1/(p-1). On a spike at zero, the integral from 0 to 1 of 1/x^p converges when p is below 1, and then its value is 1/(1-p). The number 1 is the hinge in both cases, and it fails on both sides.
| p | Tail, 1 to infinity | Spike, 0 to 1 |
|---|---|---|
| 0.5 | diverges | 2 |
| 1 | diverges | diverges |
| 1.5 | 2 | diverges |
| 2 | 1 | diverges |
| 3 | 0.5 | diverges |
The hinge is the logarithm. At p = 1 the antiderivative is ln(x) rather than a power, and ln(R) has no ceiling: it climbs by about 0.6931 every time R doubles. That is why p = 1 diverges at both ends while p = 0.99 converges at the spike and p = 1.01 converges on the tail, both of them slowly.
The test doubles as a comparison tool. Because 1/(x^2+1) is smaller than 1/x^2 for every x at or above 1, and the second one converges, the first one converges too. The other direction is just as useful: if a smaller function diverges, a larger one diverges with it. MIT OpenCourseWare session 91 of 18.01SC builds the p-test in that order, first for the infinite interval and then for the spike at zero.
Bounding a hard integrand with an easy one
The p-test covers powers, and comparison carries the same verdict to everything else without an antiderivative. The rule runs in two directions, and the direction is the whole trick. An integrand below a convergent one converges. An integrand above a divergent one diverges. Nothing follows from being below a divergent integral or above a convergent one.
Take 1/(x^2+3) on 1 to infinity. For every x at or above 1 the denominator x^2+3 is larger than x^2, so 1/(x^2+3) sits below 1/x^2, and that tail converges to 1. Convergence is settled before any antiderivative appears. The exact value comes from the arctangent: the antiderivative is arctan(x/sqrt(3)) divided by sqrt(3), and the definite value is pi divided by 3 sqrt(3), which is 0.6046, under the 1 the bound promised.
The opposite direction needs a lower bound. The integrand (x+1)/x^2 splits into 1/x + 1/x^2, which is above 1/x, and the tail of 1/x diverges. So this one diverges, even though both of its pieces look tame on a graph. Its partial value from 1 to R is ln(R) + 1 - 1/R, which is 7.9068 at R = 1,000 and keeps climbing.
Five cases show how the two directions sort out. The middle column names the simple integral each comparison rests on, and the last column gives the verdict.
| Integrand on 1 to infinity | Compare with | Bound | Verdict |
|---|---|---|---|
| 1/(x^2+3) | 1/x^2, area 1 | below a convergent tail | converges, value 0.6046 |
| (x+1)/x^2 | 1/x, divergent | above a divergent tail | diverges |
| 1/(x^3+5x) | 1/x^3, area 0.5 | below a convergent tail | converges, value under 0.5 |
| e^(-x)/x | e^(-x), area 0.3679 | below a convergent tail | converges |
| 1/(2x) | 1/x, divergent | half of a divergent tail | diverges |
One common mistake is worth naming, because it produces a confident wrong verdict. A reader shows that 1/(x+1) sits below 1/x, notes that 1/x diverges, and concludes that 1/(x+1) diverges too. The comparison says nothing at that point, since a function under a divergent tail can do anything. The p-test settles it instead: 1/(x+1) behaves like 1/x far out, and the integral from 1 to R is ln(R+1) minus ln(2), which is 6.2156 at R = 1,000 and has no ceiling.
Bounds have to respect the endpoint as well. On 0 to 1, 1/sqrt(x) converges to 2, so anything below it converges there too, and 1/(sqrt(x)+1) is below it with a value under 2. The same move fails at a spike when the direction is wrong: 1/(2 sqrt(x)) is half of a convergent spike and comes to 1, while 1/(x sqrt(x)) is above 1/x close to zero, and that one diverges. Choosing which side to bound is the skill, not the algebra.
Worked example: 1/x^2 from 1 to infinity
Take the tail of 1/x^2. The antiderivative of x^-2 is -1/x, so the integral from 1 to R is -1/R + 1, which is 1 - 1/R.
At R = 10 the value is 1 - 1/10 = 0.9. At R = 100 it is 1 - 1/100 = 0.99. At R = 1000 it is 1 - 1/1000 = 0.999. The gap to 1 is exactly the tail that was left out, and that gap equals 1/R.
| Cutoff R | Partial value | Gap to the limit |
|---|---|---|
| 10 | 0.9 | 0.1 |
| 100 | 0.99 | 0.01 |
| 1,000 | 0.999 | 0.001 |
| 10,000 | 0.9999 | 0.0001 |
No row of that table reaches 1, and yet the limit is 1, because 1/R can be made smaller than any number you pick by taking R large enough. That is the shape of every convergent tail: the partial values creep toward a ceiling they never touch.
The calculator reaches the same answer without a special case. It squeezes the infinite interval onto u from 0 to 1 with a substitution, and for this tail the choice x = 1/(1-u) turns the integrand times the stretch factor into exactly 1. Simpson's rule then returns 1 at any slice count, and the closed form row agrees.
The harmonic case and other slow tails
The case p = 1 is the one people misjudge, because the picture looks harmless. The integral from 1 to R of 1/x is ln(R), so the partial values are ln(10) = 2.3026, ln(1000) = 6.9078 and ln(1000000) = 13.8155.
Growth is steady and slow. Every doubling of R adds ln(2) = 0.6931, no matter how far out you already are. To push the total to 20 you need ln(R) = 20, which means R = e^20, about 485 million. For a total of 30 the cutoff moves to about 1.07e13. No finite cutoff finishes the job, and that is what divergence means for a positive function.
Slow convergence is a different trap from divergence. The tail of 1/x^1.01 does converge, because 1.01 sits above 1, and its value is 1/(1.01-1) = 100. After a cutoff of 1,000 the partial value is only 6.674. A tool that stops at a fixed cutoff and reports what it found would call that integral 6.674 and be off by a factor of 15.
The spike at zero behaves the same way in mirror image. The integral of ln(x) from 0 to 1 is improper because ln(x) dives toward minus infinity at zero, yet the area is finite: the antiderivative is x ln(x) - x, and at b = 1 that gives 0 - 1 = -1. A negative value is normal here, since the curve sits below the axis over the whole interval.
Both traps point to the same lesson. A single number from a numeric method tells you where the partial sums are, not where they stop. The rule tells you whether they stop at all.
Parts and substitution, with the limit kept in view
Integration by parts works on an improper integral as long as the limit travels with it. For x e^(-x) on 0 to infinity, take u = x and dv = e^(-x) dx. Then du = dx, v = -e^(-x), and the boundary term -(x+1)e^(-x) is zero at infinity and minus one at zero, so the value is 1. At R = 10 that boundary term is 11 times e to the minus 10, about 0.0005, which is why the tail beyond 10 barely matters.
Substitution does two jobs. It can remove a spike: on 0 to 1, set x = u^2, so dx = 2u du and 1/sqrt(x) becomes 1/u. The two u factors cancel, the integrand turns into the constant 2, and the answer is 2 with no limit left to take.
It can also turn a tail into a spike, which is how the p-test is proved. Set x = 1/t in the integral from 1 to infinity of x^-p. Then dx = -dt/t^2 and the integral becomes the integral from 0 to 1 of t^(p-2) dt. That converges exactly when p - 2 is above -1, which is p above 1. The substitution moves the trouble from infinity to zero and leaves the answer in place.
e^(-x^2) has no elementary antiderivative. Its integral over the whole line is sqrt(pi) = 1.7725, a result that comes from squaring the integral and switching to polar coordinates. Over 0 to infinity the value is half of that, 0.8862, which is what this calculator prints for a = 0.
One caution about paired limits. The integral of 1/x from -1 to 1 is not zero, even though the two halves look equal and opposite. Each half diverges, so the two-sided limit does not exist. The symmetric version, called the Cauchy principal value, is defined in section 1.4 of the NIST Digital Library of Mathematical Functions as the limit of the integral from -1 to -t plus the integral from t to 1, and that version does equal zero. It is a different object. This page reports the strict verdict, which is diverges.
Reading the number the calculator gives you
Simpson's rule fits a parabola through each pair of slices and adds the areas. With an even number of slices n, the weights run 1, 4, 2, 4, 2 and so on to 4, 1, and the weighted sum is multiplied by h/3, where h is the width of one slice.
A finite check first. The integral of 4/(1+x^2) from 0 to 1 is pi, and four slices already show it. With h = 0.25 the values at the five points are 4, 3.7647, 3.2, 2.56 and 2. The weighted sum is 4 + 15.0588 + 6.4 + 10.24 + 2 = 37.6988, and 37.6988 x 0.25 / 3 = 3.1416. Eight slices give 3.141593, and pi is 3.141593.
The verdict and the number come from different places on purpose. The verdict comes from the rules above: the family, the limits, and whether a pole sits inside the interval. The number comes from Simpson's rule after the interval has been squeezed onto a bounded one. A numeric estimate can never prove divergence, because a slowly diverging integral looks like a large finite number at every cutoff. The rule supplies the proof.
For a divergent case the tool prints the area over a fixed window and says so in the label. For 1/x from 1 to 101 that value is 4.6151. From 1 to 1001 it is 6.9088. The window grew tenfold and the value rose by 2.2937, which is the signature of a logarithmic divergence.
Slice count matters most when the integrand has a sharp peak. Doubling n and watching the estimate move is the honest test. If the two runs agree to the third digit, the number is settled for practical work. If they disagree in the first digit, the peak is being under-resolved and n needs to go up.
Frequently asked questions
What makes an integral improper?
One of two things: the interval is unbounded, or the integrand is unbounded somewhere on the interval. A finite interval with a continuous integrand is proper. Anything else has to be written as a limit of proper integrals before it can be given a value.
Does the integral of 1/x^2 from 1 to infinity converge?
Yes, and its value is 1. Because p = 2 is above 1, the p-test gives 1/(2-1) = 1. The partial value after a cutoff R is 1 - 1/R, so the area reaches 0.999 at R = 1000 and keeps closing the last 0.001 gap as R grows.
Why does 1/x diverge when 1/x^2 converges?
The extra power changes the antiderivative. For 1/x^2 the antiderivative is -1/x, which goes to zero as x grows, so the partial values settle at 1. For 1/x the antiderivative is ln(x), which goes to infinity, only slowly: ln(1000000) = 13.8155.
What is the p-test for an integral that starts at zero?
The integral of 1/x^p from 0 to 1 converges when p is below 1, and its value is 1/(1-p). So p = 0.5 gives 1/(1-0.5) = 2, while p = 1 and anything above it diverges. The two versions of the test are mirror images.
How big a cutoff does 1/x need to reach a total of 10?
About 22,026. You need ln(R) = 10, so R = e^10, which is 22,026.5. Reaching 20 takes a cutoff near 485 million, and each further doubling of the total only adds 0.6931 to ln(R).
Does 1/x^1.01 converge?
Yes, because 1.01 is above 1, but the value is large and slow to appear. The exact value is 1/(1.01-1) = 100, while the area out to a cutoff of 1,000 is only 6.674. Convergence says the total has a ceiling, not that a small cutoff will find it.
What is the integral of e^(-x) from 0 to infinity?
It is 1/k for any positive decay rate k. With k = 2 the value is 1/2 = 0.5, and with k = 1 it is 1. A negative or zero k makes the integrand stop decaying, and then the integral diverges.
Can I use integration by parts on an improper integral?
Yes. Carry the limit through the parts formula and evaluate the boundary term as a limit. For x e^(-x) on 0 to infinity the boundary term -(x+1)e^(-x) is 0 at infinity and -1 at 0, so the value is 1.
What is the Cauchy principal value?
It is the symmetric limit, taken with the same distance on both sides of the bad point. For 1/x from -1 to 1 the principal value is 0, but the strict improper integral diverges, because each half has infinite area on its own. The two answers describe different questions.
Why does the calculator say diverges when the curve looks small?
Height is not area. 1/x is below 0.001 once x passes 1,000, yet the area keeps growing as ln(R). The graph looks flat because the axis is compressed, and the total still has no ceiling.
How many slices should I use in Simpson's rule?
Start at 1,000 and double it once to check. Four slices on 4/(1+x^2) from 0 to 1 give 3.1416 where pi is 3.141593, so the method is quick when the curve is smooth. A sharp peak near an endpoint needs far more slices than a flat curve.
Is the number on screen exact?
The closed form row is exact up to floating point, and the Simpson row is an estimate. They agree to about six digits for the functions here. For e^(-x^2) there is no elementary closed form, so the page reports the estimate alone.
Why can the value of an integral be negative?
Area below the axis counts as negative. The integral of ln(x) from 0 to 1 is -1, because ln(x) is negative on the whole interval and the antiderivative x ln(x) - x lands on -1 at x = 1.
Spotted a wrong number or a broken result?
More Math tools
Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.