Definite Integral Calculator with Error Estimate

Enter a function of x, its lower and upper limits, and the number of intervals. You get the value of the integral and an estimate of how far it may be from the exact answer.

Free Runs in your browser Checked Thursday, November 12, 2026

Write the function in x, for example e^x, sin(x) or x^2 + 1. Use 2x or 2*x for two times x.

Where the area starts.

Where the area ends. It may be smaller than a.

An even number, at least 2. More intervals give a smaller error.

Result

Integral from a to b — Simpson's rule with your number of intervals.
Estimated error — An estimate, not a guaranteed bound.

Working

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Type the function in Function f(x), written in x, for example e^x.
  2. Enter the Lower limit a and the Upper limit b of the range.
  3. Enter the Number of intervals, an even number. Start with 4 and double it to see how the value settles.
  4. Read Integral from a to b and Estimated error, then open Working for each step.

How Simpson's rule works

The integral is the signed area between the graph of f and the horizontal axis, from a to b. Simpson's rule replaces the curve in each pair of intervals by a parabola through three points, and adds up the areas under those parabolas.

The width of each interval is h = (b − a) ÷ n, where n is the number of intervals and must be even. The open text used for the formula is listed in the sources.

∫ from a to b of f(x) dx ≈ (h/3) × [f0 + 4f1 + 2f2 + 4f3 + … + 4f(n−1) + fn]

h   width of each interval = (b − a) ÷ n
fk  the function at the point a + k·h

How the error is estimated

The error of Simpson's rule falls in proportion to h^4: halving the width cuts the error by about 16. The calculator computes the value S(n) with your intervals and S(2n) with twice as many, and uses the difference between them to estimate the error of S(n).

The estimate is only as good as that assumption. Where the function is smooth on the range it is close to the true error; near a jump, a sharp peak or a point where the function is infinite it can be far off.

error of S(n) ≈ (16/15) × |S(n) − S(2n)|

What this calculator does not cover

  • Improper integrals: a limit that is infinite, or a point inside the range where the function is infinite.
  • Integrals of functions of two or more variables.
  • The exact antiderivative. The value is a numerical approximation.
  • Functions with a jump or a very sharp peak, where the error estimate is not reliable.

Worked example: e^x from 0 to 1 with 4 intervals

The width is h = (1 − 0) ÷ 4 = 0.25. Simpson's rule with 4 intervals gives 1.718319, and with 8 intervals it gives 1.718284. The difference is 0.00003469, so the estimated error is 16/15 of that: 0.00003700.

The exact value is e − 1 = 1.718282, because the derivative of e^x is e^x (OpenStax, Table of Derivatives), so the error of the 4-interval value is about 0.00003701, as the estimate predicts.

Result Value
Integral with 4 intervals 1.718319
Estimated error 0.00003700

Frequently asked questions

What is a definite integral?

It is the signed area between a function's graph and the horizontal axis, from the lower limit to the upper limit. Where the graph lies below the axis, that part of the area counts as negative.

Why must the number of intervals be even?

Simpson's rule takes the intervals in pairs and fits a parabola to each pair. An odd count leaves one interval without a partner, so the calculator asks for an even number.

Why does the value change when I add intervals?

Simpson's rule is an approximation. More intervals make each strip narrower, and the error falls quickly, so the value settles. The estimated error shows roughly how much is still left.

What does the estimated error mean?

It estimates how far the shown value may be from the exact integral, found by comparing with twice as many intervals. It is not a guaranteed bound, and it can be wrong where the function jumps or has a sharp peak.

Why do I get no value?

The function is not defined at some point of the range, for example ln(x) at zero, or it is infinite there. Choose limits where the function is defined.

Can I use infinite limits?

No. The limits must be numbers. An integral to infinity needs a different method, and this calculator does not give one.

Does the calculator send my function anywhere?

No. The function is read and integrated in your browser. Nothing you type is stored or sent to us.

Sources

Figures and text last checked on Thursday, November 12, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.