1. Home
  2. Calculus
  3. Riemann sum calculator

Riemann sum calculator with steps

Approximate the area under a curve with left, right or midpoint rectangles or the trapezoidal rule. See every sample point and compare with the integral.

Your integral

Approximate area—

Step-by-step solution

    Sample points
    ixᵢf(xᵢ)

    Stuck on an integral?

    Calculus AI solves integrals, u-substitution and area problems from a photo, step by step.

    Download on the App Store

    What is a Riemann sum?

    To find the area under f(x) from a to b, split the interval into n equal pieces of width Δx. On each piece, build a rectangle whose height is f at a sample point: the left endpoint, right endpoint or midpoint. The trapezoidal rule uses trapezoids instead of rectangles.

    The formulas

    Δx = (b − a) ÷ nLeft: xᵢ = a + (i − 1)Δx · Right: xᵢ = a + iΔx · Midpoint: xᵢ = a + (i − ½)Δx
    Riemann sum = Δx · [f(x₁) + f(x₂) + … + f(xₙ)]Trapezoidal rule: (Δx ÷ 2)·[f(x₀) + 2f(x₁) + … + 2f(xₙ₋₁) + f(xₙ)]

    Worked example

    Estimate the area under f(x) = x² from 0 to 2 with n = 4. Δx = 0.5. Left endpoints: 0, 0.5, 1, 1.5, so the sum is 0.5 × (0 + 0.25 + 1 + 2.25) = 1.75. Right endpoints give 3.75, midpoints give 2.625 and the trapezoidal rule gives 2.75. The exact area is 8/3 ≈ 2.6667.

    Frequently asked questions

    What is a Riemann sum?

    A Riemann sum estimates the area under a curve by splitting it into n rectangles of width Δx and adding their areas. As n grows, the sum approaches the definite integral.

    Which method is most accurate?

    For smooth functions the midpoint and trapezoidal rules are usually much more accurate than left or right sums with the same n. The midpoint rule is often slightly better than the trapezoidal rule.

    Do left sums overestimate or underestimate?

    For an increasing function, left sums underestimate and right sums overestimate. For a decreasing function it is the reverse.

    Related tools