Riemann Sums: Left, Right And Midpoint Explained

#Calculus
TL;DR
Riemann sums approximate the area under a curve by slicing it into nn thin rectangles and adding their areas: ∑i=1nf(xi∗),Δx\sum_{i=1}^{n} f(x_i^*),\Delta x, where Δx=b−an\Delta x = \frac{b-a}{n}. The left, right, and midpoint versions differ only in where you sample the height of each rectangle, and as n→∞n \to \infty every version converges to the exact definite integral ∫abf(x),dx\int_a^b f(x),dx.
BT
Bhanzu TeamLast updated on October 1, 202611 min read

What Are Riemann Sums?

Riemann sums are a way to approximate the area under a curve by adding up the areas of many thin rectangles. For a function ff on an interval [a,b][a, b], you divide the interval into nn equal pieces, build a rectangle on each piece, and sum their areas.

The general formula is a single sum:

∑i=1nf(xi∗),Δx,Δx=b−an\sum_{i=1}^{n} f(x_i^*),\Delta x, \qquad \Delta x = \frac{b-a}{n}

Here Δx\Delta x is the common width of every rectangle, and $x_i^$ is the sample point in the ii-th piece where you read the height $f(x_i^).Eachterm. Each term f(x_i^*),\Delta x is one rectangle's area (height times width), and the sum stacks them side by side across [a, b].

Geometrically, the sum is an estimate of the shaded region between the graph and the x-axis. The only freedom you have is where to measure each rectangle's height, and that single choice gives the three named sums below.

How Do You Set Up A Riemann Sum?

Every Riemann sum starts from the same three ingredients: the width, the grid of division points, and the sample point.

  • The width. Split [a,b][a, b] into nn equal subintervals, so each has width Δx=b−an\Delta x = \dfrac{b-a}{n}.

  • The grid points. Label the division points x0=ax_0 = a, x1=a+Δxx_1 = a + \Delta x, up to xn=bx_n = b. In general xi=a+i,Δxx_i = a + i,\Delta x.

  • The sample point. On each subinterval [xi−1,xi][x_{i-1}, x_i], pick one point $x_i^anduse and use f(x_i^)$ as the rectangle's height.

Once those are fixed, the estimate of the area is the sum $\sum_{i=1}^{n} f(x_i^),\Delta x$. Reading it as geometry keeps it honest: x is a base, f(x_i^) is a height, and the product is one rectangle.

What Are Left, Right, And Midpoint Riemann Sums?

The three standard Riemann sums differ only in the sample point xi∗x_i^* they use on each subinterval.

  • Left Riemann sum. Sample at the left end of each piece, xi∗=xi−1x_i^* = x_{i-1}. The heights are read at x0,x1,…,xn−1x_0, x_1, \dots, x_{n-1}.

  • Right Riemann sum. Sample at the right end, xi∗=xix_i^* = x_i. The heights are read at x1,x2,…,xnx_1, x_2, \dots, x_n.

  • Midpoint Riemann sum. Sample at the centre, xi∗=xi−1+xi2x_i^* = \dfrac{x_{i-1} + x_i}{2}.

Written as sums, that is:

Ln=∑i=1nf(xi−1),Δx,Rn=∑i=1nf(xi),Δx,Mn=∑i=1nf(xi−1+xi2)ΔxL_n = \sum_{i=1}^{n} f(x_{i-1}),\Delta x, \qquad R_n = \sum_{i=1}^{n} f(x_i),\Delta x, \qquad M_n = \sum_{i=1}^{n} f\left(\tfrac{x_{i-1}+x_i}{2}\right)\Delta x

For a function that is increasing across [a,b][a, b], the left sum reads the smaller heights and so under-estimates the true area, while the right sum reads the larger heights and over-estimates it. For a decreasing function the roles swap. The midpoint sum usually lands closest, because the bit of curve it misses above the rectangle on one side tends to cancel the bit it adds on the other.

How Do You Compute A Riemann Sum?

Take the area under f(x)=x2f(x) = x^2 from 00 to 11, which is the definite integral ∫01x2,dx\int_0^1 x^2,dx. Its exact value is 13≈0.3333\tfrac{1}{3} \approx 0.3333, so the estimates below can be checked against a known target.

Use n=4n = 4 rectangles, so Δx=1−04=0.25\Delta x = \dfrac{1-0}{4} = 0.25 and the grid points are 0, 0.25, 0.5, 0.75, 10,\ 0.25,\ 0.5,\ 0.75,\ 1.

Example 1: Left Riemann sum

Sample at the left ends 0, 0.25, 0.5, 0.750,\ 0.25,\ 0.5,\ 0.75:

L4=0.25(f(0)+f(0.25)+f(0.5)+f(0.75))L_4 = 0.25\big(f(0) + f(0.25) + f(0.5) + f(0.75)\big)

L4=0.25(0+0.0625+0.25+0.5625)=0.25×0.875L_4 = 0.25\big(0 + 0.0625 + 0.25 + 0.5625\big) = 0.25 \times 0.875

Final answer: L4=0.21875L_4 = 0.21875, an under-estimate of 13\tfrac{1}{3} (the function is increasing).

Example 2: Right Riemann sum

Sample at the right ends 0.25, 0.5, 0.75, 10.25,\ 0.5,\ 0.75,\ 1:

R4=0.25(f(0.25)+f(0.5)+f(0.75)+f(1))R_4 = 0.25\big(f(0.25) + f(0.5) + f(0.75) + f(1)\big)

R4=0.25(0.0625+0.25+0.5625+1)=0.25×1.875R_4 = 0.25\big(0.0625 + 0.25 + 0.5625 + 1\big) = 0.25 \times 1.875

Final answer: R4=0.46875R_4 = 0.46875, an over-estimate of 13\tfrac{1}{3}.

Example 3: Midpoint Riemann sum

Sample at the centres 0.125, 0.375, 0.625, 0.8750.125,\ 0.375,\ 0.625,\ 0.875:

M4=0.25(f(0.125)+f(0.375)+f(0.625)+f(0.875))M_4 = 0.25\big(f(0.125) + f(0.375) + f(0.625) + f(0.875)\big)

M4=0.25(0.015625+0.140625+0.390625+0.765625)=0.25×1.3125M_4 = 0.25\big(0.015625 + 0.140625 + 0.390625 + 0.765625\big) = 0.25 \times 1.3125

Final answer: M4=0.328125M_4 = 0.328125, much closer to 13≈0.3333\tfrac{1}{3} \approx 0.3333 than either endpoint sum.

The true area 0.33330.3333 sits between the left under-estimate 0.218750.21875 and the right over-estimate 0.468750.46875, exactly as the geometry predicts, and the midpoint estimate is nearest of the three.

What Are Upper And Lower Sums?

Two special Riemann sums bracket the true area from below and above. On each subinterval, the lower sum uses the smallest value of ff (its infimum) as the height, and the upper sum uses the largest value (its supremum). These are the Darboux sums.

For a function that only increases across [a,b][a, b], the smallest value on each piece is at its left end and the largest is at its right end. So for an increasing ff the lower sum equals the left sum and the upper sum equals the right sum. For x2x^2 on [0,1][0, 1] that means the true area is trapped: 0.21875≤13≤0.468750.21875 \le \tfrac{1}{3} \le 0.46875. Squeezing the upper and lower sums together as nn grows is one rigorous way to define the integral.

How Do Riemann Sums Become The Definite Integral?

As the rectangles get thinner, the estimate stops being an estimate. Taking the number of rectangles to infinity gives the exact area, and that limit is the definition of the definite integral:

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

When the limit exists and gives the same value for every choice of sample point, the function is called integrable on [a,b][a, b], and that shared value is written ∫abf(x),dx\int_a^b f(x),dx. This is where the area picture and the algebra of integration meet.

You can watch it happen in closed form for x2x^2 on [0,1][0, 1]. Use the right sum with general nn, so Δx=1n\Delta x = \tfrac{1}{n} and the right endpoints are xi=inx_i = \tfrac{i}{n}:

Rn=∑i=1n(in)21n=1n3∑i=1ni2R_n = \sum_{i=1}^{n} \left(\frac{i}{n}\right)^2 \frac{1}{n} = \frac{1}{n^3}\sum_{i=1}^{n} i^2

Now use the standard sum of squares, ∑i=1ni2=n(n+1)(2n+1)6\displaystyle\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}:

Rn=1n3⋅n(n+1)(2n+1)6=(n+1)(2n+1)6n2=13+12n+16n2R_n = \frac{1}{n^3}\cdot \frac{n(n+1)(2n+1)}{6} = \frac{(n+1)(2n+1)}{6n^2} = \frac{1}{3} + \frac{1}{2n} + \frac{1}{6n^2}

As n→∞n \to \infty, the two tail terms vanish:

∫01x2,dx=lim⁡n→∞Rn=lim⁡n→∞(13+12n+16n2)=13\int_0^1 x^2,dx = \lim_{n \to \infty} R_n = \lim_{n \to \infty}\left(\frac{1}{3} + \frac{1}{2n} + \frac{1}{6n^2}\right) = \frac{1}{3}

The limit lands exactly 13\tfrac{1}{3}, matching the value the worked estimates were circling. As a check, setting n=4n = 4 in (n+1)(2n+1)6n2\tfrac{(n+1)(2n+1)}{6n^2} gives (5)(9)6⋅16=4596=0.46875\tfrac{(5)(9)}{6\cdot 16} = \tfrac{45}{96} = 0.46875, the same R4R_4 computed by hand above.

Table: Where each Riemann sum reads the height of each rectangle, on a subinterval [xi−1,xi][x_{i-1}, x_i].

Riemann sum

Sample point xi∗x_i^*

On an increasing ff

Reads to

Left

Left end xi−1x_{i-1}

Under-estimate

Lower sum

Right

Right end xix_i

Over-estimate

Upper sum

Midpoint

Centre xi−1+xi2\tfrac{x_{i-1}+x_i}{2}

Usually closest

Between

Lower (Darboux)

Point of smallest ff

Under-estimate

Floor on area

Upper (Darboux)

Point of largest ff

Over-estimate

Ceiling on area

Why Do Riemann Sums Work?

The idea rests on one honest observation: you can find the area of a rectangle exactly, and any region can be filled with rectangles.

  • A rectangle is easy. Base times height is exact, so a stack of rectangles has an area you can always add up, no matter how strange the curve on top.

  • Thin strips hug the curve. A wide rectangle badly misjudges a curved top, but a thin one barely notices the curve bending across its narrow base, so the error per rectangle shrinks as the strips get thinner.

  • The errors are squeezed out. The lower and upper sums trap the true area between them, and for a continuous function the gap between them collapses to zero as nn grows. Whatever value both sums are forced toward is the area.

That is why the limit is exact rather than merely close. The sum is never asked to be clever about the curve, only to add rectangles, and the curve's contribution to the error is driven to nothing by making the rectangles thin.

Who Discovered Riemann Sums?

Adding up thin slices to measure a curved region is one of the oldest ideas in mathematics, far older than the name attached to it.

Two more names sit on either side of that moment:

  • Archimedes of Syracuse (c. 287–212 BCE, Greece) computed areas and volumes by exhaustion, the direct ancestor of the Riemann sum.

  • Jean-Gaston Darboux (1842–1917, France) sharpened Riemann's definition using the upper and lower sums, giving the clean squeeze-the-brackets version taught today.

Where Are Riemann Sums Used In The Real World?

Any quantity that is a height accumulated over a width is a Riemann sum in disguise.

  • Physics and motion: the area under a speed-time graph is the distance travelled, so summing speed×time\text{speed} \times \text{time} over short intervals estimates how far something has gone.

  • Engineering: the work done by a varying force is the area under a force-distance graph, computed as a sum of force×small displacement\text{force} \times \text{small displacement}.

  • Probability and statistics: the chance of a value falling in a range is the area under a probability density curve, which numerical methods estimate with Riemann-style sums.

  • Economics: total cost or total revenue accumulated from a marginal rate is the area under that rate, a running sum of small contributions.

  • Computer numerical integration: when a function has no elementary antiderivative, software falls back on midpoint, trapezoidal, or Simpson's rules, all refinements of the Riemann sum, to get a number.

The same move sits under all of them: replace a hard exact quantity with a sum of easy rectangles, then let the rectangles get thin. The link between a slope-based derivative and an area-based integral is the backbone of calculus.

What Are The Most Common Mistakes With Riemann Sums?

These three errors account for most lost marks on Riemann sums, matching the "frequent student mistakes" surfaced by AP-style review guides and the endpoint-and-Δx\Delta x confusion students ask about most.

Using the wrong sample point

Where it slips in:

The problem asks for a left sum, and the student reads heights at the right endpoints, or uses an endpoint when a midpoint sum was requested.

Don't do this:

Do not grab whichever points are easiest. Left, right, and midpoint each name a specific point in every subinterval.

The correct way:

Fix the rule first. Left uses xi−1x_{i-1}, right uses xix_i, midpoint uses xi−1+xi2\tfrac{x_{i-1}+x_i}{2}. For [0.5,0.75][0.5, 0.75] the midpoint is 0.6250.625, not 0.50.5 or 0.750.75.

Off-by-one on the index range

Where it slips in:

Writing the left sum with the same index range as the right sum, so one endpoint is counted and the opposite endpoint is dropped.

Don't do this:

Do not reuse i=1i = 1 to nn for both. The left and right sums sample different endpoints.

The correct way:

Left sum runs the heights x0x_0 to xn−1x_{n-1}; right sum runs x1x_1 to xnx_n. Writing the sample list out in full before adding catches the slip every time.

Forgetting to multiply by Δx\Delta x

Where it slips in:

The student adds the heights f(xi∗)f(x_i^*) and reports that total as the area, leaving out the common width.

Don't do this:

Do not stop at the sum of heights. A height alone is not an area.

The correct way:

Every term is height times width, f(xi∗),Δxf(x_i^*),\Delta x. Factor the common Δx\Delta x out, add the heights, then multiply once at the end, as in R4=0.25×1.875=0.46875R_4 = 0.25 \times 1.875 = 0.46875.

Practice Problems On Riemann Sums

Work each by hand, then check against the answer. Values are exact.

  1. For ∫02x,dx\int_0^2 x,dx with n=4n = 4, find the right Riemann sum.
    (Answer: Δx=0.5\Delta x = 0.5; heights 0.5,1,1.5,20.5, 1, 1.5, 2; R4=0.5×5=2.5R_4 = 0.5 \times 5 = 2.5. Exact area =2= 2.)

  2. For the same ∫02x,dx\int_0^2 x,dx with n=4n = 4, find the left Riemann sum.
    (Answer: heights 0,0.5,1,1.50, 0.5, 1, 1.5; L4=0.5×3=1.5L_4 = 0.5 \times 3 = 1.5.)

  3. For ∫01x2,dx\int_0^1 x^2,dx with n=2n = 2, find the midpoint sum.
    (Answer: Δx=0.5\Delta x = 0.5; midpoints 0.25,0.750.25, 0.75; M2=0.5(0.0625+0.5625)=0.3125M_2 = 0.5(0.0625 + 0.5625) = 0.3125.)

  4. Find Δx\Delta x for ∫27f(x),dx\int_2^7 f(x),dx using n=10n = 10 rectangles.
    (Answer: Δx=7−210=0.5\Delta x = \frac{7-2}{10} = 0.5.)

  5. For ∫03x2,dx\int_0^3 x^2,dx with n=3n = 3, find the right sum.
    (Answer: Δx=1\Delta x = 1; heights 1,4,91, 4, 9; R3=14R_3 = 14. Exact area =9= 9, so this over-estimates.)

  6. Using the closed form (n+1)(2n+1)6n2\frac{(n+1)(2n+1)}{6n^2}, find lim⁡n→∞Rn\lim_{n \to \infty} R_n for ∫01x2,dx\int_0^1 x^2,dx.
    (Answer: 13\tfrac{1}{3}.)

Where Should You Go Next After Riemann Sums?

Riemann sums are the doorway from areas to integration, and a few natural next steps build straight on them.

  1. Integration. The definite integral that the Riemann sum defines, with the rules and formulas that let you skip the limit and evaluate directly.

  2. Sequences. The sums ∑i2\sum i^2 and their friends come from sequence and series work, the algebra that made the closed-form limit possible.

Riemann sums sit in India's NCERT Class 12 calculus and in the US Common Core and AP Calculus AB course, so the same rectangles turn up on both syllabuses. If your child is meeting them for the first time, a live Bhanzu trainer teaches Riemann sums from the area picture up, in the Bhanzu math program.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is a Riemann sum in simple terms?
A Riemann sum is an estimate of the area under a curve found by adding up the areas of many equal-width rectangles. Each rectangle's height is the function value at a chosen point of its base, and the sum is ∑f(xi∗),Δx\sum f(x_i^*),\Delta x.
What is the difference between left, right, and midpoint Riemann sums?
They use different sample points for the rectangle heights. The left sum reads the function at each subinterval's left end, the right sum at the right end, and the midpoint sum at the centre, which usually gives the closest estimate.
Which Riemann sum is the most accurate?
For most curves the midpoint sum beats the left and right sums at the same nn, because its over- and under-shoots tend to cancel. The trapezoidal and Simpson's rules, both refinements of the same idea, are more accurate still.
How is a Riemann sum related to the definite integral?
The definite integral is the limit of a Riemann sum as the number of rectangles goes to infinity, ∫abf(x),dx=lim⁡n→∞∑f(xi∗),Δx\int_a^b f(x),dx = \lim_{n \to \infty} \sum f(x_i^*),\Delta x. When that limit exists and ignores the sample-point choice, the function is integrable.
What is Δx\Delta x in a Riemann sum?
It is the common width of each rectangle, Δx=b−an\Delta x = \frac{b-a}{n}, found by splitting the interval [a,b][a, b] into nn equal pieces. Every term in the sum is multiplied by this width.
Does using more rectangles always give a better estimate?
For a continuous function, increasing nn shrinks the error and drives the estimate toward the exact area. More rectangles mean thinner strips that hug the curve more closely, which is why the limit is exact.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →