MathematicsIntegralsClass 12

Riemann sums & the definite integral: interactive simulation

A definite integral is the signed area between a curve and the x-axis. To estimate it, split [a, b] into n strips of width Δx, build a rectangle (or trapezoid) on each and add their areas.

Useful for: AP Calculus AB, AP Calculus BC, IB Math, A-level Maths, JEE Main · India (JEE / NEET / CBSE) and worldwide (AP / SAT / IB / GCSE / A-level)

Embed this simulation

Free for classrooms, school sites and blogs. Keep the attribution link.

Try this

Change the method and n. Left and right sums under- or over-shoot depending on whether the function rises or falls; as n grows every method converges on the exact integral, shown alongside.

  1. 1

    f(x) = x² on [0, 3] with n = 6, left sum.

    What you should see

    Δx = 0.5 and L₆ = 6.875, below the exact value 9 because x² is increasing.

  2. 2

    Switch to the right sum, then midpoint, then trapezoid.

    What you should see

    R₆ = 11.375 (too high), M₆ = 8.9375 and T₆ = 9.125 — midpoint and trapezoid are far closer.

  3. 3

    Raise n to 100 with the left sum.

    What you should see

    The error shrinks to about −0.13: doubling n roughly halves the left-sum error.

  4. 4

    Pick sin x on [−3, 3].

    What you should see

    Blue area above the axis cancels the red area below, so the integral is 0 even though the shaded area is not.

Formulas behind it

Strip width

Δx=b−an\Delta x = \frac{b-a}{n}

Left Riemann sum

Ln=∑i=0n−1f(xi) ΔxL_n = \sum_{i=0}^{n-1} f(x_i)\,\Delta x

Trapezoidal rule

Tn=Ln+Rn2T_n = \frac{L_n + R_n}{2}

Definite integral

∫abf(x) dx=lim⁡n→∞∑i=1nf(xi∗) Δx\int_a^b f(x)\,dx = \lim_{n\to\infty} \sum_{i=1}^{n} f(x_i^*)\,\Delta x

Common mistakes

  • Using n + 1 rectangles: n strips use the n left endpoints x₀…xₙ₋₁ or the n right endpoints x₁…xₙ.
  • Forgetting that area below the x-axis counts as negative in a definite integral.
  • Assuming the left sum is always an underestimate — that is only true for increasing functions.
Stuck on a riemann sums & the definite integral question?Snap it and get a whiteboard video solution.

FAQ

Which Riemann sum is most accurate?

For smooth functions, midpoint and trapezoid sums are much more accurate than left or right sums; their error falls like 1/n² instead of 1/n.

When is the trapezoidal rule an overestimate?

When the function is concave up, every trapezoid sits above the curve, so the trapezoidal rule overestimates. When concave down it underestimates.

How does a Riemann sum become an integral?

As n → ∞ the strips get infinitely thin and the sum approaches a limit. That limit is the definite integral.

Related simulations

All 70 simulations

Want a specific topic or simulation added?

Tell us in our feedback box which chapter or concept you want visualised next.

Send feedback