Worked examples — Riemann sums — left, right, midpoint; formal definition of definite integral
This is a Deep Dive child of Riemann sums & the formal definite integral. The parent built the machinery (partitions, sample points, the limit). Here we stress-test it against every kind of input the topic can throw at you — positive area, negative area, mixed signs, a degenerate zero-width case, a limit computed from scratch, a word problem with units, and an exam twist. Guess before you read the steps.
The scenario matrix
Before working anything, here is a map of every case class this topic can produce. Each worked example below is tagged with the cell(s) it covers. If you can handle every row, nothing on an exam can surprise you.
| # | Case class | What is special about it | Covered by |
|---|---|---|---|
| A | Positive function, definition limit | , area is genuinely "area under curve" | Ex 1 |
| B | Increasing | Left underestimates, Right overestimates | Ex 2 |
| C | Decreasing | Left overestimates, Right underestimates | Ex 3 |
| D | Negative function | Height ⇒ signed area, integral negative | Ex 4 |
| E | Sign change inside | Positive and negative areas partly cancel | Ex 5 |
| F | Degenerate: (zero width) | Every ; the integral must be | Ex 6 |
| G | Exact-for-linear midpoint | Midpoint has zero error on a straight line | Ex 7 |
| H | Word problem with units | Riemann sum = accumulated real quantity | Ex 8 |
| I | Exam twist: recognise a limit AS an integral | Read a sum backwards into | Ex 9 |
Two ideas recur, so let's nail them first in plain words:

Example 1 — Positive function, from the definition (cell A)
Forecast: the parent got . Stretching to scales , so guess something near . Hold that thought.
- Set up the mesh. , and . Why this step? The right rule samples the right edge ; we need it as a formula in and before we can sum.
- Write the sum. Why this step? Pull every constant (, and ) outside, leaving one clean sum of squares.
- Insert the closed form : Why this step? A finite sum we can't take a limit of; a rational function of we can.
- Take the limit (divide top and bottom by ): Why this step? Making the strips infinitely thin () is the definition of the integral; the terms vanish.
Verify: Fundamental Theorem of Calculus gives . Matches the forecast. ✓
Example 2 — Increasing : Left under, Right over (cell B)
Forecast: rises on , so Left should undershoot, Right overshoot.
- Mesh. ; nodes . Why? Four equal strips; we need the shared edge list for both rules.
- Left samples : Why? Left rule uses the left edge of each strip — the shorter side of a rising curve.
- Right samples : Why? Right rule uses the right edge — the taller side of a rising curve.
Verify: . Exactly the predicted straddle. Also note — the total error gap equals width height-jump, a handy check. ✓
Example 3 — Decreasing : the ordering flips (cell C)
Forecast: falls, so now Left is the tall side (over) and Right the short side (under) — the mirror of Ex 2.
- Mesh. ; nodes ; midpoints . Why? Two strips; we need edges and centres.
- Left (): . Why? Left edges of a falling curve sit above the true height ⇒ overestimate.
- Right (): . Why? Right edges of a falling curve sit below ⇒ underestimate.
- Midpoint (): . Why? Sampling the centre lets the over-hang and under-hang roughly cancel.
Verify: ✓, and is far smaller than either edge error — midpoint wins, as promised. ✓
Example 4 — Negative function ⇒ negative integral (cell D)
Forecast: the curve lies entirely below the axis, so its "area" should come out negative — precisely .
- Reuse Ex 1's skeleton. , , but now . Why? The only change is a global minus sign on every height; widths stay positive.
- Sum. Why? Linearity: pulling the out just negates the Ex 1 result.
- Limit. . Why? Same limit as Ex 1 with the sign carried through.
Verify: signed area of a region wholly below the axis must be negative; magnitude matches Ex 1's positive twin. FTC: . ✓ Look at the figure: the whole shaded region sits under the white axis, so every rectangle carries a minus sign — that is why the total is , not .

Example 5 — Sign change inside the interval (cell E)
Forecast: is negative on and positive on , by mirror-image triangles of equal size. Guess the two signed areas cancel to .
- Identify the two regions. Below-axis triangle on with legs and ; above-axis triangle on with legs and . Why? at ; that root splits positive from negative area.
- Signed area of each. Below piece: . Above piece: . Why? Area of a right triangle is ; the left one carries a minus because there.
- Add. . Why? The integral is the algebraic total of signed pieces, not the total geometric area.
Verify: FTC . ✓ Careful: the total geometric area (if you wanted paint) is — a classic trap. Look at the figure: the red triangle (left, below axis) and the green triangle (right, above axis) are congruent, so their signed contributions and annihilate.

Example 6 — Degenerate zero-width interval (cell F)
Forecast: no width means no rectangles means no area. Guess .
- Look at the mesh. With : for every . Why? The interval has length ; every subinterval collapses to a point.
- Every term dies. regardless of the heights. Why? Height × zero width = zero, no matter how tall is.
- Limit of zeros is zero. . Why? A constant sequence converges to that constant.
Verify: consistent with FTC, for any antiderivative . This degenerate rule is what makes hold even when . ✓
Example 7 — Midpoint is exact for a straight line (cell G)
Forecast: midpoint is exact for lines, so one strip should be enough. Guess the exact answer.
- One strip. ; the single subinterval is ; midpoint . Why? ⇒ whole interval is one strip; its centre is .
- Evaluate. . Why? Riemann term = height at midpoint × width.
Verify: FTC . ✓ Why exact: on a straight line the triangle poking above the midpoint rectangle exactly equals the triangle missing below it — perfect cancellation, for any . See figure.

Example 8 — Word problem with units (cell H)
Forecast: distance = area under a speed-vs-time graph. Speed grows, so a right sum should overshoot the true distance a bit.
- Why an integral at all? Distance = accumulated speed ; each rectangle is , so the sum carries metres. Why? Units audit: height width must equal the quantity we want.
- Right sum. s; right nodes : Why? Right rule samples the right edge of each 1-second strip.
- Exact. Why? Antiderivative of is ; evaluate at the ends.
Verify: — overshoot, as forecast for an increasing speed. Units: metres throughout. ✓ (A midpoint sum here would give the exact since is linear — cell G again.)
Example 9 — Exam twist: read a limit as an integral (cell I)
Forecast: it looks like a right Riemann sum with over an interval of length . Decode it, don't sum it.
- Match the template . Here , so ; take . Why? ; matching forces the interval width to be .
- Read off . The sample point is , and the height is . So on . Why? Replace by the continuous variable ; that is exactly what the limit does.
- Evaluate the integral. Why? Antiderivative of is ; evaluate at the ends.
Verify: numerically ; a coarse numeric sum with large confirms this. ✓ This "backwards" reading is a favourite exam device.
Recall Which rule over/under-estimates? (test yourself)
Increasing : Left ::: underestimate (short left edge) Increasing : Right ::: overestimate (tall right edge) Decreasing : Left ::: overestimate Decreasing : Right ::: underestimate Any linear , midpoint ::: exact for every