Maths & numbers

Polynomial Riemann sums calculator

Compare left, right and midpoint rectangle sums with an exact polynomial integral and an SVG explanation.

Your numbers

Degree at most 12: for x² enter 1 0 0; for 2x + 3 enter 2 3. Coefficients use the stated bounded integers, decimals or fractions. No function names or symbolic expressions.
Integer or decimal up to 6 places, magnitude ≤1,000,000; fractions such as -2/3 with numerator/denominator ≤1,000,000. No expressions.
Integer or decimal up to 6 places, magnitude ≤1,000,000; fractions such as -2/3 with numerator/denominator ≤1,000,000. No expressions.
1–1,000. The table shows at most 100 intervals; the rectangle SVG is shown only at 100 or fewer.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your numbers and select Calculate.

Try it, understand it

Explore the result

Compare the three rectangle rules on the same polynomial and partition. The exact reference integral is kept separate.

Worked example comparison
ExampleOutputWhat to notice
Four left-endpoint rectanglesRiemann sum (decimal approximation)0.21875For x² on [0,1], the exact sampled sum is 7/32 = 0.21875.
Four midpoint rectanglesRiemann sum (decimal approximation)0.328125The exact sum is 21/64 = 0.328125, versus integral 1/3.
Four right-endpoint rectanglesRiemann sum (decimal approximation)0.46875The exact sampled sum is 15/32 = 0.46875.

Check your understanding

Must a sum of signed rectangle contributions be positive?

No. Negative sample heights contribute negatively, and positive/negative terms can cancel.

Does the table cap change the computed total?

No. The exact sum includes all subintervals; only the displayed rows and diagram are bounded.

Behind the numbers

How this calculation works

Evaluate the chosen sample in every equal subinterval using exact fractions, multiply by the interval width and add signed contributions. Integrate the same polynomial analytically for a separate reference. Compare the finite sampled sum with the signed integral rather than assuming every sum is an upper or lower bound.

THE FORMULASum = Σ f(sampleᵢ) × Δx; Δx = (b−a)/n; polynomial integral = F(b)−F(a)

A worked example

For x² on [0,1], four midpoint rectangles give 21/64 = 0.328125. The exact signed integral is 1/3, so sum minus integral is −1/192. Left and right endpoint choices give different finite sums.

Good to know

Rational-coefficient polynomials of degree ≤12 and strictly increasing rational bounds only. No trigonometric/general-expression parser, improper integral or adaptive method. Exact fractions have a size limit; diagram/decimal positions are approximate. Table cap 100; diagram omitted above 100 intervals. Negative rectangle heights contribute negatively. Plot axes use independent scales.

Separate the polynomial, partition and sample rule

A finite Riemann sum chooses one function value in each subinterval and multiplies it by that interval’s width. This tool uses equal widths: Δx = (b − a)/n. Left endpoints, right endpoints and midpoints are distinct sampling rules even when the function and interval are unchanged.

Enter coefficients from the highest power down through the constant. For x² use 1 0 0; for 2x + 3 use 2 3. A missing zero changes which power a coefficient belongs to. The polynomial arithmetic calculator can work with coefficient lists for other exact polynomial operations.

For x² on [0,1] with four midpoint rectangles, the samples are 1/8, 3/8, 5/8 and 7/8. Their squared heights times width 1/4 sum to 21/64, or 0.328125. The polynomial antiderivative gives the exact signed integral 1/3, so sampled sum minus integral is −1/192.

Polynomial arithmetic calculator uses the same highest-power-first coefficient convention. Polynomial Riemann sums add a partition and sample rule, then compare a finite sum with the exact signed integral.

A rectangle picture needs its sign and scale conventions

Rectangles below the horizontal zero line contribute negatively. Positive and negative contributions can cancel, so a signed sum is not the total geometric area of all shaded pieces. The separate signed integral follows the same orientation convention; it is not silently changed into an unsigned area.

The SVG shows the selected samples and rectangles with independently scaled x and y axes. It also joins 201 evaluated polynomial points as a visual curve approximation. That joined line is not a continuous-curve accuracy guarantee. At more than one hundred subintervals the diagram is omitted and the table is capped, while the reported exact sum still includes every interval up to the one-thousand limit.

More subdivisions often help approximate an integral, but this page does not promise that every arbitrary polynomial and sample rule produces a monotonic error sequence or an upper/lower bound. The worked comparisons use x², where the left/right/midpoint results can be checked directly. A trapezoidal sample rule is another method and is not represented by relabelling one of these rectangle sums.

A few questions, answered

Can it parse sin(x), a singularity or an improper integral?

No. It accepts a bounded rational coefficient list for a polynomial of degree at most twelve. Other function families and improper limits require a different model.

Does the total use only the hundred displayed table rows?

No. Every entered subinterval is included in the total. The caption states how many rows are displayed.

Why can a rectangle sum differ from the exact integral?

The finite sum replaces the varying function within each interval with one sampled height. The antiderivative integrates the polynomial itself.

Find your calculator

Start typing to explore the library.