BYTETOOLS

Riemann Sum Calculator

Compute left, right, midpoint and trapezoidal Riemann sums with a full per-rectangle table and a drawing of the rectangles under your curve.

0.21875
Left sum
0.46875
Right sum
0.328125
Midpoint sum
0.34375
Trapezoid sum

Accuracy against a fine grid

  • Δx = (b − a)/n = 0.25
  • reference (midpoint, n = 20,000) = 0.3333333331
  • left sum − reference = -0.1145833331

This rule underestimates the area here.

Per-rectangle table — left rule

Sample point, function value and area for each subinterval
ix*f(x*)area = height × Δx
1000
20.250.06250.015625
30.50.250.0625
40.750.56250.140625

Rectangles and curve

What is the Riemann Sum Calculator?

The ByteTools Riemann Sum Calculator works out all four standard sums at once — left endpoint, right endpoint, midpoint and trapezoidal — for any function on the interval you choose with the number of subintervals you set.

  • Left, right, midpoint and trapezoidal sums computed together
  • Per-rectangle table with sample point, height and area
  • Rectangles drawn against the curve on a canvas
  • Says outright whether your chosen rule over- or under-estimates
  • Compares against a 20,000-interval reference value
  • Everything computed locally in your browser

How to use the Riemann Sum Calculator

  1. 1

    Type the function in the f(x) box, such as x^2 or sin(x).

  2. 2

    Set the lower limit a, the upper limit b and the number of subintervals n.

  3. 3

    Choose which rule the per-rectangle table and drawing should show.

  4. 4

    Compare all four sums in the stat row and read the comparison against the fine-grid reference.

  5. 5

    Click Copy sums to save all four totals.

About the Riemann Sum Calculator

The ByteTools Riemann Sum Calculator works out all four standard sums at once — left endpoint, right endpoint, midpoint and trapezoidal — for any function on the interval you choose with the number of subintervals you set. Each is the familiar Σ f(xᵢ*)·Δx, and all four appear side by side so the differences between the rules are obvious.

A per-rectangle table lists the sample point, the height and the area of every rectangle for whichever rule you select, and the rectangles are drawn against the curve so you can see where each rule overshoots or undershoots. Every sum is also compared against a fine-grid reference so over- and under-estimation is stated explicitly rather than left for you to infer.

It is built for learning what a Riemann sum actually does before the integral takes over. Everything is computed in your browser and nothing is uploaded.

Frequently asked questions

What is a Riemann sum?

It approximates the area under a curve by slicing the interval into rectangles and adding their areas. Each rectangle's height comes from the function value at a sample point — the left edge, right edge or midpoint. As the rectangles get thinner the sum approaches the definite integral.

Which Riemann sum is most accurate?

The midpoint rule is usually the most accurate of the three sampling rules, and the trapezoidal rule is generally better than left or right endpoints. This calculator shows all four against a fine-grid reference so you can see the difference for your own function.

When does a left Riemann sum overestimate?

A left sum overestimates when the function is decreasing across the interval, because each rectangle takes its height from the higher left edge. For an increasing function it underestimates instead. The tool states which is happening for your input.

What is the difference between a Riemann sum and a definite integral?

A Riemann sum is a finite approximation using a set number of rectangles. The definite integral is the exact value that those sums approach as the number of rectangles goes to infinity and their width goes to zero.

How many subintervals should I use?

For homework, 4 to 10 keeps the table readable and shows the method clearly. Larger values converge closer to the true integral. This tool accepts up to 2,000 subintervals and hides the rectangles above 400, where they would be thinner than a pixel.

Related tools