Definite Integral Calculator
Evaluate a definite integral numerically with adaptive Simpson, printing the value, the tolerance and the number of intervals used.
Definite Integral Calculator
Evaluate a definite integral numerically with adaptive Simpson, printing the value, the tolerance and the number of intervals used.
How this page computes
The page samples the integrand and applies adaptive Simpson recursion until the local error estimate is under the stated tolerance or the depth limit is reached. It is a numeric answer and is labelled as one.
The calculation runs entirely in this browser tab; nothing is uploaded.
The page evaluates a definite integral with adaptive Simpson and prints the estimate, the tolerance and the number of intervals the recursion used. Worked example: the integral of sin(x) from 0 to pi is 2.
Adaptive Simpson refines only where the integrand bends, so a smooth function needs few intervals and a peaked one gets more. The answer is numeric by design; the page does not claim a closed form.
How to use the Definite Integral Calculator
Enter the integrand in x, then set the lower bound a, the upper bound b and the tolerance. Press Run to get the value and the interval count.
A tighter tolerance asks for more refinement and therefore more intervals. If the integrand is not finite at a sample point, the page refuses the interval and names the problem instead of returning a misleading number.
How adaptive Simpson works
Simpson's rule fits a parabola through three points on each subinterval. The adaptive version compares the estimate on an interval with the sum of its two halves and refines while the difference exceeds the tolerance.
The printed interval count is the number of subintervals actually evaluated, so the cost of the tolerance is visible. The recursion depth is capped at 20 to keep a pathological integrand from freezing the tab.
What to Expect
Best for
- A numeric integral where no elementary antiderivative exists
- Checking a hand-computed area
- Comparing a tolerance with the interval count
Not ideal for
- A symbolic antiderivative, which has its own page
- Improper integrals with an infinite bound
- Complex-valued integrands
What this tool keeps
- The integrand, both bounds, the tolerance and the interval count
What may need cleanup
- The value is a numeric estimate; round it to the precision the tolerance supports
Common errors
- A non-finite sample point is refused with its x value
- A non-positive tolerance is refused
Example use cases
- Integrate sin(x) from 0 to pi
- Integrate exp(-x^2) from 0 to 1
Sample input
sin(x)
Sample output
∫ from 0 to 3.14159265359 of sin(x) dx = 2 adaptive Simpson, tolerance 1e-8, 119 intervals
Who this is for
- Students checking a definite integral
- Readers estimating an area numerically
Frequently asked questions
Is the answer exact?
No. It is a numeric estimate with the stated tolerance, and the page labels it that way. For the supported symbolic forms the integral page gives an exact antiderivative instead.
Why does the interval count change?
Adaptive Simpson adds intervals only where the function bends enough to exceed the error estimate. A line needs one interval; a sharp peak needs many, and the count reports what was actually done.
Can the bounds be reversed?
Yes. The signed integral changes sign when the bounds are swapped, and the recursion works with the interval it is given. Equal bounds return zero without sampling.
Is anything uploaded?
Nothing is uploaded. The integrand is evaluated in this browser tab and the recursion runs in JavaScript, so reloading the page discards the input and the estimate.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.