What a definite integral measures
A definite integral is a signed accumulation. Slice the interval from a to b into thin strips, multiply each strip's width by the height of f there, add up the products, and take the limit as the strips shrink. Where f is above the axis the products are positive; where it is below, they are negative.
That signed convention is the source of most confusion about integrals, and it is deliberate. The integral of x³ from −1 to 1 is exactly zero, not one half, because the region below the axis on the left cancels the region above it on the right. If you wanted the geometric area you would integrate the absolute value, which is why this calculator reports both numbers side by side.
The accumulation reading is more useful than the area reading in most applications. Integrate velocity and you get displacement. Integrate power and you get energy. Integrate a probability density and you get a probability. Integrate a flow rate and you get a volume. In each case the sign is not a nuisance — it is the difference between going forward and going back.
The Fundamental Theorem of Calculus is what makes any of this computable by hand. It says that if you can find a function F whose derivative is f, then the whole accumulation collapses to one subtraction, F(b) − F(a). Finding that F is the job of the antiderivative calculator.
Why this calculator integrates numerically, and how
Most functions have no elementary antiderivative. e^(−x²) is the famous case: it is smooth, well behaved and central to statistics, and no combination of powers, exponentials, logarithms and trigonometric functions differentiates to it. Liouville proved this in the 1830s, so the situation is permanent rather than a failure of ingenuity.
Numerical quadrature sidesteps the problem. Adaptive Simpson fits a parabola through three points of each panel, estimates the panel's integral from it, then splits the panel in half and does the same to each half. If the two halves together agree with the whole to within the tolerance, the panel is accepted; if not, the algorithm recurses into each half. Effort therefore concentrates where the function is hard to fit and stays cheap where it is nearly a parabola already.
The refinement uses Richardson extrapolation: because Simpson's error scales as the fourth power of the panel width, halving the panel divides the error by about sixteen, and the leftover difference divided by fifteen is a good estimate of the remaining error. That correction is added to the result, which is why the values in the convergence table settle so quickly.
The error figure reported alongside the answer comes from a genuinely independent run at a tolerance a thousand times looser. If the two runs agree to twelve digits, the answer is solid; if they disagree in the sixth, quote six digits and no more.
Worked example: ∫ from 0 to 1 of x² dx, by hand and by Simpson
By the Fundamental Theorem. An antiderivative of x² is F(x) = x³/3, since F′(x) = 3x²/3 = x². Then the integral is F(1) − F(0) = 1/3 − 0 = 0.333333…. That is the exact answer.
By Simpson's rule on a single panel. With l = 0, m = 0.5 and r = 1, the values are f(0) = 0, f(0.5) = 0.25 and f(1) = 1. Then (1 − 0)/6 × [0 + 4(0.25) + 1] = (1/6)(2) = 0.333333…. Simpson matches exactly, and it will do so for any cubic or lower polynomial, because a parabola through three points reproduces every quadratic exactly and the cubic error terms cancel by symmetry.
A case where it does not match exactly. Take ∫ from 0 to π of sin x dx, whose exact value is [−cos x] evaluated at the ends, giving −(−1) − (−1) = 2. Composite Simpson with four subintervals gives 2.0045598, off by 0.0045598. Doubling to eight subintervals gives 2.0002692, off by 0.0002692. The ratio of those errors is 16.9, which is the factor of sixteen that fourth-order accuracy predicts, plus the higher-order remainder.
Reading the sign. Integrate x³ from −1 to 1 and you get [x⁴/4] from −1 to 1, which is 0.25 − 0.25 = 0. The unsigned area is 2 × 0.25 = 0.5, because each half contributes a quarter. This calculator reports 0 and 0.5 respectively, and that pair is one of its test vectors.
How to read the four numbers
The integral is signed. Compare it against the unsigned area. When the two agree, f keeps one sign across the whole interval. When the unsigned area is larger, f crosses the axis and cancellation is happening — useful information, and the calculator says so explicitly.
The mean value is the integral divided by the width. It is the constant height that would enclose the same signed area, and the Mean Value Theorem for Integrals guarantees that a continuous f actually attains it somewhere inside the interval. Root-mean-square values in electrical work, average concentrations in chemistry and expected values in probability are all this quantity.
The error estimate is a difference between two runs, not a proof. Adaptive quadrature can be fooled by a function that is flat where it samples and spiky where it does not — a narrow tall bump between the sample points looks like nothing at all. If your integrand has such a feature, split the interval by hand around it and add the pieces.
The convergence table is the diagnostic. On a smooth integrand the change column should shrink by roughly a factor of sixteen from row to row. If it shrinks much more slowly, the integrand is not smooth enough for Simpson's error analysis to apply — a square-root singularity at an endpoint is the usual reason — and the reported digits should be trusted only as far as that column suggests.
Standard integrals you can check this calculator against
| Integral | Antiderivative | Exact value | Decimal |
|---|---|---|---|
∫₀¹ x² dx | x³/3 | 1/3 | 0.3333333333 |
∫₀¹ x³ dx | x⁴/4 | 1/4 | 0.2500000000 |
∫₁ᵉ (1/x) dx | ln x | 1 | 1.0000000000 |
∫₀^π sin x dx | −cos x | 2 | 2.0000000000 |
∫₀^(π/2) cos x dx | sin x | 1 | 1.0000000000 |
∫₀¹ e^x dx | e^x | e − 1 | 1.7182818285 |
∫₀¹ 4/(1+x²) dx | 4·arctan x | π | 3.1415926536 |
∫₀¹ 1/√x dx | 2√x | 2 | 2.0000000000 |
∫₋₁¹ x³ dx | x⁴/4 | 0 | 0.0000000000 |
The 1/√x row is an improper integral: the integrand blows up at the left endpoint yet the area is finite. Adaptive quadrature handles it approximately by stepping just inside the endpoint, so expect the last few digits there to be soft.
Where a definite integral goes wrong
- Integrating across a pole.
∫ from −1 to 1 of 1/x dxdoes not exist; the two halves diverge in opposite directions. A numerical method will happily return a number close to zero by symmetry, and that number is meaningless. - Confusing the signed integral with area. Area is
∫|f|. If your integrand crosses the axis and you wanted the geometric area, read the unsigned figure instead. - Forgetting that reversing the limits flips the sign.
∫ from b to a = −∫ from a to b. This is a convention, but it is the convention that makes the Fundamental Theorem come out right. - Trusting a quadrature rule on a spiky integrand. A narrow tall feature between sample points is invisible to any fixed sampling scheme. Split the interval around it and add.
- Using degrees. Every trigonometric antiderivative assumes radians.
∫₀^π sin x dx = 2only in radians. - Quoting more digits than the convergence table supports. If the change column has stalled at 1e−7, the eighth decimal place is noise.
When to reach for a different method
If you want the formula, not the number, use the indefinite integral calculator. It finds an antiderivative where one exists in elementary terms, which lets you evaluate the same integral at any limits without recomputing.
If you are being asked to apply a specific rule by hand, use the trapezoidal rule or Simpson's rule calculators, which show the node table, the coefficient pattern and the classical error bound rather than adapting behind the scenes. Riemann sums are the definitional version, useful for teaching and poor for accuracy.
If your data is a table of measurements rather than a formula, the trapezoidal rule applied to the data points is usually the right choice, since fitting higher-order polynomials to noisy data amplifies the noise.
If you want the area enclosed between two curves, that is ∫|f − g| split at the intersections, which the area between curves calculator handles including the root finding.
If the region is two-dimensional, move up to iterated double integrals, which apply the same one-dimensional quadrature twice.
