On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Introduction to Calculus · Grade 9-12

Riemann Sums

A Riemann sum approximates the area under a curve (a definite integral) by dividing the interval into n subintervals and summing rectangle areas f(xi∗)Δx.

∫abf(x) dx≈∑i=1nf(xi∗) Δxwhere Δx=b−an
xi∗ is the sample point (left, right, or midpoint) in each subinterval.

Quick Answer

A Riemann sum approximates the area under a curve (a definite integral) by dividing the interval into n subintervals and summing rectangle areas f(xi∗)Δx. Use it when you have values of a function but no convenient antiderivative: a table of speeds from a car's log, readings from a flow meter, or a curve like e−x2. Thinner rectangles give better estimates, and the exact integral is the limit of the sums as n→∞.

Why This Matters

Real data rarely arrives as a formula. A Riemann sum turns a table of speeds into a distance, or a table of flow rates into litres used, by multiplying each reading by its slice of time and adding. It is also the definition behind ∫abf(x) dx, which explains why integrals add up "rate times width" and why a left sum undercounts a rising curve while a right sum overcounts it.

Intuitive Explanation

A car's speed is logged every 10 seconds: 0, 8, 14, 18, 20 m/s. To estimate how far it went, pretend the speed stayed fixed during each 10-second slice. Using the speed at the start of each slice gives 10(0+8+14+18)=400 m; using the speed at the end gives 10(8+14+18+20)=600 m. Each product, speed times 10 s, is the area of a rectangle under the speed graph, and adding those areas is a Riemann sum.

Each rectangle has width Δx=b−an and a height equal to the function's value at a chosen sample point: the left end, the right end or the midpoint of the slice. For a rising curve the left heights sit below the curve and undercount, while the right heights overshoot; for a falling curve it is the reverse. Since this car only sped up, its true distance lies between 400 m and 600 m.

More rectangles shrink the error. For ∫02x2 dx the right sum is 3.75 with n=4 and about 3.19 with n=8, closing in on the exact 83≈2.67. The definite integral is the limit of these sums as n→∞. A finite sum is still only an estimate, though. When the function has an antiderivative you know, as x2 does, the Fundamental Theorem gives the exact value directly; rectangles are for data, for functions with no usable antiderivative, and for defining what an integral means.

Think of it like this. A city skyline built over a hill: every building has a flat roof set to the hill's height at one spot, and the combined area of the building fronts approximates the area under the hill. Narrower buildings hug the slope more closely. Unlike real buildings, a rectangle can hang below the axis when f is negative, and then its area counts as negative.

Core idea. A Riemann sum estimates a definite integral by slicing [a,b] into strips and adding the areas of rectangles whose heights come from the function.


When to Use

Use a Riemann sum when a problem gives a table of values, or asks you to approximate or estimate an integral with left, right or midpoint rectangles and a stated n. It also appears when an integral must be written as a limit of sums. If the function has an antiderivative you know and the question wants the exact value, use the Fundamental Theorem instead. If trapezoids are requested, use the trapezoidal rule, which averages the left and right sums.

Tip. Ask: Am I summing rectangle areas f(xi∗)Δx to estimate area under a curve, rather than evaluating exactly?

How to Recognize It

Check what you know about the function, a formula or only some measured values, and whether the answer must be exact or an estimate.

  1. Is the function given only as a table of values or a graph you read points from?

    Yes means a Riemann sum: with no formula to antidifferentiate, you add height times width. Given a formula with a known antiderivative and asked for the exact value, use the definite integral through the Fundamental Theorem.

  2. Does the question name left, right or midpoint heights and a number of subintervals n?

    Yes means use exactly that rule and that n, with Δx=b−an. If it asks for trapezoids, average each pair of neighbouring heights instead; that is the trapezoidal rule.

  3. Is the function increasing across the whole interval?

    Yes means the left sum underestimates and the right sum overestimates, so the true value is trapped between them. For a decreasing function the roles swap. If the function changes direction, neither sum is guaranteed to be high or low.

  4. Is the question written as a limit of a sum, such as lim⁡n→∞∑i=1n3n(3in)2?

    Yes means turn it back into an integral: the width 3n and the sample points 3in show the interval [0,3] and the function x2, so the limit is ∫03x2 dx=9.

Riemann Sums compared with Definite integral (exact), Trapezoidal rule, and Left vs right vs midpoint

Every row is about the same area under a curve. Ask whether the answer must be exact (definite integral) or an estimate, and for an estimate, whether the tops are flat (Riemann sum) or sloped (trapezoidal rule), and where each height is taken (left, right or midpoint).

Riemann Sums

Meaning
Use this when you need to approximate a definite integral with rectangles, or define the integral as their limit.
Key test
Am I summing rectangle areas f(xi∗)Δx to estimate area under a curve, rather than evaluating exactly?
Formula
∫abf(x) dx≈∑i=1nf(xi∗) Δxwhere Δx=b−an
xi∗ is the sample point (left, right, or midpoint) in each subinterval.
Example
Approximate ∫04x2 dx using a right sum with n=2.

Definite integral (exact)

Meaning
The exact signed area, the limit of Riemann sums as n→∞.
Key test
Use when an antiderivative exists so you can compute exactly via FTC.
Formula
∫abf dx=F(b)−F(a)
Example
Exact ∫02x dx=2 vs an estimate

Trapezoidal rule

Meaning
A refined version using trapezoids instead of flat-top rectangles for better accuracy.
Key test
Use when you want a closer estimate than left/right rectangles.
Formula
Tn=Δx2(f0+2f1+⋯+fn)
Example
Trapezoids hug a sloped curve better

Left vs right vs midpoint

Meaning
Different sample-point choices that over- or under-estimate depending on the curve.
Key test
Choose based on whether you want a lower bound, upper bound, or balanced estimate.
Formula
Ln,Rn,Mn
Example
On an increasing curve, Ln underestimates, Rn overestimates

Formula & Notation

∫abf(x) dx≈∑i=1nf(xi∗) Δxwhere Δx=b−an
xi∗ is the sample point (left, right, or midpoint) in each subinterval.
Let P={x0,x1,…,xn} be a partition of [a,b] with Δxi=xi−xi−1 and xi∗∈[xi−1,xi]. The Riemann sum is S(P,f)=∑i=1nf(xi∗)Δxi. Then ∫abf(x) dx=lim⁡∥P∥→0S(P,f) where ∥P∥=max⁡iΔxi.

How to read it: Ln = left Riemann sum, Rn = right Riemann sum, Mn = midpoint sum, Tn = trapezoidal sum.

Worked Examples

Example 1 — Right Riemann sum

Easy

Approximate ∫04x2 dx using a right sum with n=2.
Show the steps and the answer
  1. Find the width: Δx=4−02=2, so the slices are [0,2] and [2,4].

    Two rectangles share an interval of length 4 equally.

  2. Take heights at the right ends: f(2)=4 and f(4)=16.

    A right sum uses each slice's right endpoint as the sample point.

  3. Add the areas: 2⋅4+2⋅16=8+32=40.

    Each rectangle's area is height times width, f(xi)Δx.

  4. Compare with the exact value 643≈21.3.

    Since x2 rises on [0,4], right-end heights sit above the curve, so 40 is an overestimate, and a large one with only two rectangles.

Answer: 40 (approximation)

Takeaway: Width first, then the sample-point heights; for an increasing function a right sum overestimates.

Example 2 — Exact via FTC

Standard

Compute ∫04x2 dx exactly.
Show the steps and the answer
  1. Note the word "exactly" and that x2 has the antiderivative x33.

    A finite Riemann sum only approximates; with an antiderivative available, the Fundamental Theorem gives the exact area.

  2. Evaluate [x33]04=643−0=643≈21.33.

    F(4)−F(0) is the value the Riemann sums approach as n→∞.

  3. Compare: the right sum is 40 with n=2 and 1⋅(1+4+9+16)=30 with n=4.

    More rectangles move the estimate toward 643, but no finite n reaches it exactly.

Answer: 643

Takeaway: Rectangles estimate. When an antiderivative exists and the question says exact, evaluate F(b)−F(a).

Example 3 — Find the mistake: the width

Application

Estimate ∫03(x+1) dx with a left sum and n=6. Dev writes: "f(0)+f(0.5)+f(1)+f(1.5)+f(2)+f(2.5)=1+1.5+2+2.5+3+3.5=13.5." Find the mistake and correct it.
Show the steps and the answer
  1. Find the real width: Δx=3−06=0.5.

    Six slices share an interval of length 3, so each is half a unit wide, not 1.

  2. Keep Dev's heights: 0,0.5,…,2.5 are the correct left endpoints.

    His sample points are right; only the width is missing.

  3. Multiply the total height by the width: 0.5×13.5=6.75.

    Each rectangle's area is height times Δx; Dev in effect used width 1 and doubled every area.

  4. Check the size: the region fits inside a 3×4 box of area 12, and the exact area is [x22+x]03=7.5.

    Dev's 13.5 is bigger than the whole box, which is impossible; 6.75 sits just below 7.5, as a left sum of a rising function should.

Answer: L6=6.75

Takeaway: Compute Δx=b−an before anything else; a width of 1 is right only when b−a=n.

Where You'll See It

  • Water use from a flow meter

    A meter reads a pipe's flow every 2 hours: 30, 45, 60 and 40 litres per hour. A left sum estimates the 8 hours' use as 2(30+45+60+40)=350 litres. Utilities and engineers use this kind of sum whenever the flow is measured rather than given by a formula.

  • Surveying an irregular field

    A surveyor walks a 250 m baseline across a field and measures its width every 50 m: 0, 120, 180, 150, 60 and 0 m. Treating each 50 m strip as a rectangle gives about 50(120+180+150+60)=25,500 square metres.

  • Total drug exposure in medicine

    Pharmacologists measure a drug's blood concentration every hour, say 4, 6, 5 and 3 mg/L in hours 1 to 4, and add concentration times 1 hour: 4+6+5+3=18 mg·h/L. This "area under the curve" measures how much of the drug the body actually saw.

Common Mistakes

  1. The slip: Forgetting Δx=b−an

    Instead: the rectangle width must come from dividing the interval, not assumed to be 1.

  2. The slip: Using the wrong sample point

    Instead: left, right, and midpoint heights differ; match the height to the rule requested.

  3. The slip: Calling a finite sum the exact area

    Instead: it's an approximation until you take the limit as n→∞.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Estimate ∫03(2x+1) dx with a right Riemann sum using n=3. Compare with the exact value.

    Hint: The width is 3−03=1. Use the right end of each piece for the height.

  2. Estimate ∫15x2 dx with a midpoint sum using n=2.

    Hint: Each piece has width 2. Find the middle of [1,3] and of [3,5].

  3. A cyclist's speed is 0, 6, 10 and 12 m/s at t=0,2,4 and 6 seconds. Estimate the distance travelled with a left sum and with a right sum.

    Hint: Each time step is 2 s. A left sum uses the first three speeds; a right sum uses the last three.

  4. Estimate ∫02x2 dx with left and right sums using n=4. Which one underestimates, and why?

    Hint: The width is 0.5. Is x2 rising or falling on [0,2]?

  5. You need ∫02x3 dx exactly, and you know the antiderivative x44. Riemann sum or exact definite integral?

    Hint: Which method gives an exact value, and which gives an estimate?

  6. To estimate ∫06x dx with a left sum and n=3, a student uses width 1 and gets 0+2+4=6. Correct the work.

    Hint: How wide is each of the 3 pieces of [0,6]?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Why is the midpoint sum usually more accurate than the left or right sum?

On a narrow strip the curve is nearly straight, so the midpoint rectangle is too high on one half of the strip and too low on the other, and the two errors almost cancel. A left or right rectangle on a rising curve errs in the same direction across the whole strip. For smooth functions the midpoint error is typically about half the trapezoid error, and far smaller than the left or right error once nn is large.

Do all the rectangles have to be the same width?

No. The definition of the integral allows any widths, as long as the widest one shrinks to 0 in the limit. Equal widths, Δx=b−an\Delta x=\frac{b-a}{n}, simply make the arithmetic easier. Real data is often unevenly spaced, such as readings at 0, 3, 5 and 10 minutes; then multiply each height by its own width, here 3, 2 and 5 minutes, and add.

How many rectangles are enough?

It depends on how much the function bends and how accurate you need to be. Doubling nn roughly halves the error of a left or right sum, while for a midpoint or trapezoid sum it cuts the error to about a quarter. Computers use thousands of strips, or cleverer methods such as Simpson's rule, to get answers correct to many decimal places.

Learning Path

Riemann Sums

You are here

Next →

Nothing after this yet
You need Integral and Definite Integral: the integral as accumulated area from a to b. Riemann sums show where that area comes from, as rectangles of width Δx=b−an added up and refined as n grows. With them you can estimate integrals from data tables, judge whether an estimate is too high or too low, and go on to the trapezoidal rule and the numerical integration that calculators and software use.

See Also