Definite integral calculator

Enter f(x) and the lower and upper limits. The tool integrates numerically, reports the area, a rough error estimate and the average value of the function, and draws the curve with the area shaded.

Use x, numbers, + - * / ^, parentheses, pi, e and sin, cos, tan, exp, ln, log, sqrt, abs with brackets, for example sin(x).
A number or constant such as 0, -2 or pi/2.
Finite limits only; infinite limits are not supported.
Integral of f(x) from a to b2
Estimated error
2.3e-11
Average value of f on [a, b]
0.6366197724
Function evaluations
473

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Type f(x), for example sin(x) or x^2 * exp(-x).
  2. Enter the limits. Constants such as pi and expressions such as pi/2 are accepted.
  3. Read the integral, the error estimate and the average value.

How it works

On each piece the tool compares Simpson’s estimate with the sum of the estimates on its two halves. If they differ by less than 15 times the local tolerance, the refined value is used, otherwise the piece is split again, up to a fixed depth. The average value is the integral divided by b − a.

Worked example

∫ from 0 to π of sin x dx = [−cos x] = 1 + 1 = 2. The tool returns 2 to ten digits. Likewise ∫ from 0 to 1 of x² dx = 1/3 and ∫ from 1 to e of 1/x dx = 1.

Tips

  • If a function has a spike or a gap, split the range at that point and add the parts.
  • The shaded area counts as negative where the curve is below the axis.

Frequently asked questions

How does adaptive Simpson’s rule work?

Simpson’s rule fits a parabola through three points. The adaptive version compares one parabola over a piece with two parabolas over its halves and keeps splitting where they disagree, so smooth stretches use few points and rough ones many. This tool starts from 16 equal pieces.

Can it integrate to infinity?

No. Both limits must be finite numbers. Functions that blow up inside the range, such as 1/x over an interval containing 0, are reported as an error.

What if the lower limit is larger than the upper?

The integral changes sign, as in ∫ from b to a = −∫ from a to b. The plot always shows the range from the smaller to the larger limit.

How accurate is the estimated error?

It is the sum of the refinement corrections, a rough guide rather than a guaranteed bound. For smooth functions the value is typically accurate to many digits.

More in Math

All tools in this category: Math ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.