Riemann Sum and Numerical Integration Calculator

Approximate a definite integral with left, right, midpoint, trapezoid and Simpson rules and compare the errors.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Step 1: Open Riemann Sum and Numerical Integration Calculator and add your input

    Type your numbers or text, add your file, or pick the options you need. Nothing is uploaded: everything stays in your browser.

  2. 2
    Step 2: What Riemann Sum and Numerical Integration Calculator does

    Approximate a definite integral with left, right, midpoint, trapezoid and Simpson rules and compare the errors.

  3. 3
    Step 3: Read the result and compare

    The result appears at once. Change one value to see how the answer moves, then keep the figure that fits your case.

  4. 4
    Step 4: Copy or save it

    Copy the result or download it. For an important decision, confirm it with the official source or an adviser.

About this tool

Enter f(x), the limits a and b and the number of subintervals N. The calculator computes the left, right, midpoint, trapezoid and Simpson approximations of the integral, and shows how far each one is from a high-accuracy reference value.

Rules

With width h = (b − a) ÷ N: the left and right sums use the function at the ends of each strip, the midpoint rule at the centre, the trapezoid rule averages the two ends, and Simpson's rule fits parabolas (it uses an even number of strips, so N is raised by one if odd).

Error

The reference value is Simpson's rule with 20,000 strips. Left and right sums have error of order h, the midpoint and trapezoid rules of order h², and Simpson's rule of order h⁴. Write the function with x, + − * / ^, parentheses, and sin, cos, tan, asin, acos, atan, exp, ln, log (base 10), sqrt, abs, sinh, cosh, tanh, pi and e. Implicit multiplication such as 2x or 3(x+1) works.

Worked example

The integral of x² from 0 to 3 is exactly 9. With N = 10 the left sum is 7.695, the right sum 10.395, the midpoint 8.9775, the trapezoid 9.045 and Simpson 9.

Tips for best results

Check every box before you rely on a result, because one wrong digit changes the whole answer. Use the exact figures from your payslip, bill, certificate or contract, and keep a note of the date you calculated. Rates, thresholds and rules change from time to time, so for tax, fees and legal matters treat the output as an estimate and confirm with the official source named on this page. You can run as many scenarios as you like; nothing is saved or sent, and refreshing the page clears the boxes.

Quick facts

Embed this calculator on your site

Copy this code to show the calculator on your own page. A link back to shobfree.com is included.

Frequently asked questions

Which rule is most accurate?

Simpson's rule, then the midpoint and trapezoid rules; left and right sums are the crudest.

What functions can I type?

Anything made from x, numbers, + − * / ^, and the common functions listed above.

What is the reference?

A 20,000-strip Simpson's rule value used to measure the error.

Can the function be negative?

Yes; areas below the axis count as negative.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages