About this tool
The Riemann Sum Calculator is a free, in-browser calculus tool that approximates the area under a curve y = f(x) on an interval [a, b] by dividing it into n equal subintervals of width Δx = (b − a)/n and summing rectangle or trapezoid areas. It computes all four standard rules: the left sum Σf(xᵢ)·Δx over i = 0…n−1, the right sum over i = 1…n, the midpoint sum using the center of each subinterval, and the trapezoid rule (Δx/2)·[f(x₀) + 2·Σf(xᵢ) + f(xₙ)].
Everything is calculated locally in your browser, so nothing you enter is sent anywhere. Choose the interval, the number of subintervals n, and which rule to highlight; the tool draws the corresponding rectangles or trapezoids over the curve on a canvas so you can see how the approximation covers the region. Type the integrand with the usual operators, ^ for powers, parentheses, the constants pi and e, and functions such as sin, cos, exp, ln and sqrt.
To show accuracy, the calculator also computes a high-resolution reference value with composite Simpson's rule and reports the absolute and relative error of your chosen method against it. As you increase n the rectangles hug the curve more tightly and the error shrinks — the midpoint and trapezoid rules converge much faster than the left or right sums. For x² on [0, 2] the exact area is 8/3 ≈ 2.6667, and the midpoint rule with only 10 subintervals is already very close.