Integral Calculator
Definite integrals by composite Simpson's rule, with an error estimate, a convergence table and the area drawn. Numerical — it does not produce an antiderivative.
Integral Calculator: with the default inputs, definite integral is 9.
Use ^ for powers. sin, cos, exp, log (natural), sqrt and the rest of the library are available.
- Estimated error
- 0|S(n) − S(n/2)| ÷ 15 — how far the answer is expected to be from the true value.
- Average value of f
- 3The integral divided by the width of the interval.
- Trapezoid rule, same n
- 9.00006866
- Midpoint rule, same n
- 8.99996567
- Subintervals used
- 256
- Method
- Composite Simpson's rule, 256 subintervals — a numerical estimate, not an antiderivative
Assumptions
- The result is a numerical approximation by composite Simpson's rule with 256 subintervals, not a symbolic antiderivative.
- The function is sampled at 513 equally spaced points; anything happening between samples — a narrow spike, a rapid oscillation — can be missed.
- The error estimate is Runge's: |S(n) − S(n/2)| ÷ 15. It assumes the function has four continuous derivatives on the interval.
- Limits must be finite. Reversed limits are handled by negating the result.
- Area below the axis counts as negative, which is what a definite integral means.
| Rule | Estimate | Error vs the answer above |
|---|---|---|
| Left Riemann sum | 7.3828125 | -1.6171875 |
| Right Riemann sum | 10.7578125 | 1.7578125 |
| Midpoint rule | 8.96484375 | -0.03515625 |
| Trapezoid rule | 9.0703125 | 0.0703125 |
| Simpson's rule | 9 | 0 |
Left and right sums lean one way; the midpoint and trapezoid rules err in opposite directions and are twice as accurate; Simpson's rule is the weighted blend of the last two and is exact for any cubic.
| Subintervals | Simpson estimate | Change from the row above |
|---|---|---|
| 2 | 9 | — |
| 4 | 9 | 0 |
| 8 | 9 | 0 |
| 16 | 9 | 0 |
| 32 | 9 | 0 |
| 64 | 9 | 0 |
| 128 | 9 | 0 |
| 256 | 9 | 0 |
Each doubling should cut the change by about sixteen. When it stops changing in the digits you care about, those digits are settled.
How this is worked out
The formula
Composite Simpson's rule with n even strips of width h = (b − a) ÷ n: ∫ₐᵇ f(x) dx ≈ (h ÷ 3) · [ f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + … + 4f(xₙ₋₁) + f(xₙ) ] Error: −(b − a)·h⁴·f⁗(ξ) ÷ 180 for some ξ in [a, b] → quartering h cuts it 256-fold Error estimate: |S(n) − S(n/2)| ÷ 15 Average value: (1 ÷ (b − a)) · ∫ₐᵇ f(x) dx Reversed limits: ∫ᵇₐ f = −∫ₐᵇ f
Open How it’s calculated above to see this worked through with your own numbers.
What you enter
- Function f(x)
- Use ^ for powers. sin, cos, exp, log (natural), sqrt and the rest of the library are available.up to 120 characters · defaults to "x^2"
- From (lower limit a)
- A number.defaults to 0
- To (upper limit b)
- A number.defaults to 3
- Variable of integration(under More options)
- Free text.up to 1 characters · defaults to "x"
What you get back
- Definite integralmain answer
- Estimated error
- |S(n) − S(n/2)| ÷ 15 — how far the answer is expected to be from the true value.
- Average value of f
- The integral divided by the width of the interval.
- Trapezoid rule, same n
- Midpoint rule, same n
- Subintervals used
- Method
What this assumes
- The result is a numerical approximation by composite Simpson's rule with 256 subintervals, not a symbolic antiderivative.
- The function is sampled at 513 equally spaced points; anything happening between samples — a narrow spike, a rapid oscillation — can be missed.
- The error estimate is Runge's: |S(n) − S(n/2)| ÷ 15. It assumes the function has four continuous derivatives on the interval.
- Limits must be finite. Reversed limits are handled by negating the result.
- Area below the axis counts as negative, which is what a definite integral means.
About this calculator
This works out the definite integral — the signed area between a curve and the x-axis between two limits — to about twelve significant figures, and shows how it got there.
It is numerical, and that is the honest answer
This calculator does not find an antiderivative. It does not return "x³/3 + C". It slices the interval into 256 strips, evaluates the function at every boundary, and combines those values with Simpson's rule, which is the standard way scientific software computes an integral.
That is not a compromise so much as an acknowledgement of what integration is. Differentiation is mechanical: every function built from the standard library has a derivative you can find by applying a fixed list of rules. Integration has no such list. Plenty of perfectly ordinary functions — e^(−x²), sin(x)/x, √(1 + x³), 1/ln x — have no elementary antiderivative at all, a result proved by Liouville in the 1830s. Any tool that answers those symbolically is either quoting a special function you did not ask for or making something up. A number with a stated error bound is the real answer.
If you need the antiderivative symbolically for a textbook exercise, integrate by hand and then use this to check: if your F(b) − F(a) matches the figure here to eight or nine digits, your antiderivative is right.
How to use it
Type the function with ^ for powers, set the two limits, and read the result. sin, cos, tan, exp, log (natural), log10, sqrt, abs and the rest of the standard library are available, and implicit multiplication works, so 3x means 3 × x.
Reading the results
Estimated error compares the 256-strip answer with the 128-strip one. Simpson's rule is fourth order, so halving the strip width should cut the error sixteenfold, and the gap between the two estimates is about fifteen times the error in the better one. When that estimate reads 1 × 10⁻¹² the answer is good to twelve digits; when it is large, something in the interval is fighting the method.
The convergence table shows the estimate as the strip count doubles. For a smooth function the changes collapse to nothing within a few rows — that is what "converged" looks like, and it is more informative than any single error figure.
The rules compared table runs all five classical rules at only eight strips, where the differences are visible. The left and right Riemann sums lean in opposite directions; the midpoint and trapezoid rules straddle the answer from opposite sides with half the error; Simpson's rule is (2·midpoint + trapezoid)/3, and that particular blend cancels the leading error term, which is why it is exact for every cubic.
Where it struggles, and what to do
- A singularity inside the limits —
1/xacross 0, ortan(x)across π/2. The calculator refuses rather than adding up an infinity, and names the point. - An endpoint singularity —
1/sqrt(x)from 0. The integral converges but f(0) does not exist. Move the limit a hair, to 0.000001, and watch the convergence table. - A kink or a spike — Simpson's error bound assumes four continuous derivatives, so
abs(x)across 0 converges slowly. Split the integral at the kink and add the two pieces. - Infinite limits — not supported. Substitute to a finite interval first, or integrate to a large finite value and check that it has settled.
- Sign changes — the result is net signed area; the part below the axis counts as negative. For total area, integrate each side of the crossing separately and add the absolute values.
Frequently asked questions
▸Does this give me the antiderivative?
No. It computes the definite integral numerically with Simpson's rule and reports an error estimate. It never returns an expression plus C, because most functions people type have no elementary antiderivative.
▸How accurate is the answer?
For a smooth function, typically ten to twelve significant figures. The estimated error compares the 256-strip result with the 128-strip one; the convergence table shows the digits settling.
▸Why is Simpson's rule better than the trapezoid rule?
The trapezoid rule joins the samples with straight lines; Simpson's rule fits a parabola through every three. Its error shrinks as h⁴ rather than h², so doubling the strips cuts the error sixteenfold instead of fourfold, and it is exact for any cubic.
▸Can I integrate to infinity?
Not directly. Substitute to a finite interval, or integrate to a large finite limit and watch the convergence table to see whether the value has settled.
▸Why did it refuse my integral?
Almost always because the function is undefined or infinite somewhere on the interval — a division by zero, a square root of a negative, or a log of a non-positive number. The message names the point. Split the integral there, or nudge an endpoint.
Put this calculator on your own site
A working integral, free for any site, with no ads and no sign-up. It resizes to fit wherever you paste it and updates itself as this page improves.
Paste this anywhere. It works on any site, carries no ads, never expires, and always shows the current version.
Integral Calculator by CalculateItNow
The page's own title. The clearest description of what the link leads to.
The credit line sits outside the widget on purpose, so it is a real link on your page rather than one buried in a frame. Please keep it — it is what pays for CalculateItNow staying free and ad-free. The script only resizes the widget to fit its contents; drop it and the widget still works.
Browse every calculator widget·How to add it to WordPress, Squarespace or Wix
Related calculators
The questions people ask next to a integral.
Differentiate a function and see which rule does the work at every term — power, product, quotient and chain — plus the value, tangent line and second derivative.
Solve any linear or quadratic equation in one variable with the rearrangement shown line by line — discriminant, exact roots, vertex, factored form and a check.
Mean, median, mode, range, quartiles, IQR, outliers and skewness from any list of numbers — with sample and population standard deviation shown side by side.
Type a whole expression and get an exact answer: brackets, powers, roots, logs, trigonometry in degrees or radians, and the order of operations applied properly.
Area of a rectangle, square, triangle, circle, trapezoid, parallelogram or ellipse in any unit, with the formula for each shape worked out step by step.
Slope, y-intercept and the equation of the line through two points, plus distance, midpoint, angle and the perpendicular slope — with rise-over-run shown.