Integration · Riemann Sums

Riemann Sums — Building the Definite Integral from Rectangles

Before we can integrate, we need to understand what an integral actually means. Riemann sums make the concept concrete: approximate the area under a curve with rectangles, then take the limit as the rectangles get infinitely thin. That limit is the definite integral.

Share this page

§ 01The Problem of Area

Finding the area of a rectangle is trivial. Finding the area under a curved function is not, at least, not directly. Riemann sums solve this by approximating the curved region with objects we can measure.

Given a function f(x) on an interval [a, b], we want to find the area between the curve and the x-axis. The strategy: divide [a, b] into n subintervals of equal width Δx = (b−a)/n, erect a rectangle over each subinterval, and add up all the rectangle areas. As n → ∞ and Δx → 0, the approximation becomes exact.

Width of Each Subinterval
Δx = (b − a) / n

The partition points are x₀ = a, x₁ = a+Δx, x₂ = a+2Δx, …, xₙ = b.

Prerequisites Comfort with sigma (Σ) notation, limits, and function evaluation. You do not need antiderivatives here — Riemann sums predate them conceptually.

§ 02The Four Approximation Rules

The height of each rectangle depends on which x-value inside the subinterval we choose to evaluate f at. The four standard choices give four approximation methods.

Left Rule
Left Riemann Sum
Lₙ = Δx · Σᵢ₌₀^{n−1} f(xᵢ)

Height = f at the left endpoint of each subinterval. Overestimates for decreasing f; underestimates for increasing f.

Right Rule
Right Riemann Sum
Rₙ = Δx · Σᵢ₌₁^{n} f(xᵢ)

Height = f at the right endpoint. Opposite bias to the left rule. Overestimates for increasing f.

Midpoint Rule
Midpoint Riemann Sum
Mₙ = Δx · Σᵢ₌₁^{n} f((xᵢ₋₁+xᵢ)/2)

Height = f at the midpoint of each subinterval. Usually the most accurate of the three rectangle rules.

Trapezoid Rule
Trapezoidal Sum
Tₙ = (Δx/2)·[f(x₀)+2f(x₁)+…+2f(xₙ₋₁)+f(xₙ)]

Uses trapezoids instead of rectangles. Averages the left and right sums: Tₙ = (Lₙ+Rₙ)/2. Exact for linear functions.

x y a b y = f(x) Left sum
Left Riemann sum with n = 6 rectangles approximating ∫ₐᵇ f(x) dx. As n → ∞, the total rectangle area converges to the exact integral.
Tₙ = (Lₙ + Rₙ) / 2 The trapezoidal sum is exactly the average of the left and right sums. For concave-up functions it underestimates; for concave-down it overestimates. The midpoint rule has the opposite bias — they bracket the true value.

§ 03Sigma Notation and General Formula

A Riemann sum for a general partition point xᵢ* (chosen anywhere in the i-th subinterval) is written:

General Riemann Sum
Sₙ = Σᵢ₌₁ⁿ f(xᵢ*) · Δx

where xᵢ* ∈ [xᵢ₋₁, xᵢ] is any sample point in the i-th subinterval.

Three useful sigma identities are needed when evaluating Riemann sums exactly using formulas:

Sigma Identities
Σᵢ₌₁ⁿ 1 = n Σᵢ₌₁ⁿ i = n(n+1)/2 Σᵢ₌₁ⁿ i² = n(n+1)(2n+1)/6 Σᵢ₌₁ⁿ i³ = [n(n+1)/2]²

From Riemann Sum to Definite Integral

The definite integral is defined as the limit of any Riemann sum as n → ∞ (provided f is integrable on [a, b]):

The Definite Integral — Definition
∫ₐᵇ f(x) dx = lim_{n→∞} Σᵢ₌₁ⁿ f(xᵢ*) · Δx

The choice of sample point (left, right, midpoint, or any other) does not affect the limit for continuous f, they all converge to the same value.

§ 04Worked Examples

Example 1Left sum for f(x) = x² on [0, 2], n = 4
  1. Δx = (2−0)/4 = 0.5. Partition: 0, 0.5, 1, 1.5, 2.
  2. Left endpoints: x₀=0, x₁=0.5, x₂=1, x₃=1.5.
  3. Heights: f(0)=0, f(0.5)=0.25, f(1)=1, f(1.5)=2.25.
  4. L₄ = 0.5·(0 + 0.25 + 1 + 2.25) = 0.5 · 3.5 = 1.75.
L₄ = 1.75  (True value: ∫₀² x² dx = 8/3 ≈ 2.667 — left sum underestimates since f is increasing)
Example 2Right sum for f(x) = x² on [0, 2], n = 4
  1. Same Δx = 0.5. Right endpoints: x₁=0.5, x₂=1, x₃=1.5, x₄=2.
  2. Heights: f(0.5)=0.25, f(1)=1, f(1.5)=2.25, f(2)=4.
  3. R₄ = 0.5·(0.25+1+2.25+4) = 0.5·7.5 = 3.75.
R₄ = 3.75  (Overestimates since f is increasing on [0,2])
Example 3Midpoint sum for f(x) = x² on [0, 2], n = 4
  1. Midpoints: 0.25, 0.75, 1.25, 1.75.
  2. Heights: (0.25)²=0.0625, (0.75)²=0.5625, (1.25)²=1.5625, (1.75)²=3.0625.
  3. M₄ = 0.5·(0.0625+0.5625+1.5625+3.0625) = 0.5·5.25 = 2.625.
M₄ = 2.625  (Much closer to 8/3 ≈ 2.667 — midpoint is most accurate here)
Example 4Trapezoidal rule for f(x) = x² on [0, 2], n = 4
  1. T₄ = (Δx/2)·[f(0) + 2f(0.5) + 2f(1) + 2f(1.5) + f(2)]
  2. = (0.5/2)·[0 + 2(0.25) + 2(1) + 2(2.25) + 4]
  3. = 0.25·[0 + 0.5 + 2 + 4.5 + 4] = 0.25·11 = 2.75.
  4. Check: T₄ = (L₄+R₄)/2 = (1.75+3.75)/2 = 2.75 ✓
T₄ = 2.75  (Very close to 8/3 ≈ 2.667)
Example 5Right sum using sigma formula: ∫₀¹ x² dx via lim Rₙ

Derive the exact integral using the limit definition with right endpoints.

  1. Δx = 1/n. Right endpoint of i-th subinterval: xᵢ = i/n.
  2. Rₙ = Σᵢ₌₁ⁿ f(i/n)·(1/n) = Σᵢ₌₁ⁿ (i/n)²·(1/n) = (1/n³)·Σᵢ₌₁ⁿ i².
  3. Using Σi² = n(n+1)(2n+1)/6: Rₙ = (1/n³)·n(n+1)(2n+1)/6 = (n+1)(2n+1)/(6n²)
  4. Take the limit: lim_{n→∞} (n+1)(2n+1)/(6n²) = lim (2n²+3n+1)/(6n²) = 2/6 = 1/3.
∫₀¹ x² dx = 1/3 — confirmed by the limit of Riemann sums
Example 6Right sum for f(x) = 3x + 1 on [1, 3], n = 5
  1. Δx = (3−1)/5 = 0.4. Right endpoints: 1.4, 1.8, 2.2, 2.6, 3.0.
  2. Heights: 3(1.4)+1=5.2; 3(1.8)+1=6.4; 3(2.2)+1=7.6; 3(2.6)+1=8.8; 3(3)+1=10.
  3. R₅ = 0.4·(5.2+6.4+7.6+8.8+10) = 0.4·38 = 15.2.
  4. Exact: ∫₁³(3x+1)dx = [1.5x²+x]₁³ = (13.5+3)−(1.5+1) = 16.5−2.5 = 14.
R₅ = 15.2  (Error = 1.2; f is linear so Tₙ would be exact for any n)
Example 7Interpreting negative areas: f(x) = sin x on [0, 2π], n = 4

When f takes negative values, the Riemann sum includes negative contributions.

  1. Δx = π/2. Right endpoints: π/2, π, 3π/2, 2π.
  2. Heights: sin(π/2)=1, sin(π)=0, sin(3π/2)=−1, sin(2π)=0.
  3. R₄ = (π/2)·(1+0+(−1)+0) = 0.
R₄ = 0 — matching the exact ∫₀^{2π} sin x dx = 0, since the positive and negative lobes cancel
Example 8Express lim_{n→∞} Σ (i/n)³ · (1/n) as a definite integral

Identify the corresponding integral from the Riemann sum structure.

  1. f(xᵢ*) = (i/n)³ suggests f(x) = x³ with xᵢ* = i/n (right endpoint of [0,1]).
  2. Δx = 1/n, a = 0, b = 1.
  3. Therefore the limit equals ∫₀¹ x³ dx = [x⁴/4]₀¹ = 1/4.
lim_{n→∞} Σᵢ₌₁ⁿ (i/n)³/n = ∫₀¹ x³ dx = 1/4

§ 05Error Bounds and Convergence

How good are these approximations? For smooth functions, the errors can be bounded precisely.

Error Bounds
|E_T| ≤ K₂(b−a)³ / (12n²) |E_M| ≤ K₂(b−a)³ / (24n²)

where K₂ = max|f″(x)| on [a,b]. The midpoint rule is exactly twice as accurate as the trapezoidal rule.

MethodError OrderExact forBest use
Left / RightO(1/n)Constant fTheoretical motivation
MidpointO(1/n²)Linear fBest simple rule
TrapezoidalO(1/n²)Linear fEasy to implement
Simpson's RuleO(1/n⁴)Cubic fHigh accuracy
Left/Right Sums Are Biased For a monotone function, the left and right sums always bracket the true value: if f is increasing, Lₙ < ∫ < Rₙ. They converge, but slowly (O(1/n)). Midpoint and trapezoidal converge much faster at O(1/n²). Always prefer midpoint or trapezoidal for numerical work.

§ 06Common Mistakes

Mistake 1 — Off-by-one in endpoint selectionLeft sum uses x₀ through xₙ₋₁ (omit the last point). Right sum uses x₁ through xₙ (omit the first). A common error is using all n+1 partition points for both.
Mistake 2 — Wrong Δx when limits are not [0,1]Always compute Δx = (b−a)/n. For f on [1,3] with n=4, Δx = 0.5, not 0.25.
Mistake 3 — Forgetting to multiply by ΔxThe Riemann sum is Δx · Σ f(xᵢ*). Students sometimes sum the function values and forget to scale by Δx.
Mistake 4 — Confusing the Riemann sum limit with the antiderivativeThe limit definition proves the integral exists and gives a way to compute it without antiderivatives. But once the FTC is available, use it — computing lim Rₙ via sigma formulas is only needed when explicitly asked.

§ 07Test Yourself — 10-Question Quiz

Score: 0 / 0
Question 1 of 10

For f(x) = x² on [0, 1] with n = 4, what is Δx?

Δx = (b−a)/n = (1−0)/4 = 0.25.

Question 2 of 10

Which rule uses trapezoids and equals (Lₙ + Rₙ)/2?

The Trapezoidal Rule connects consecutive function values with straight lines (trapezoids) and equals the average of the left and right sums.

Question 3 of 10

Compute L₄ for f(x) = x² on [0, 1] with n = 4. Enter exact decimal.

  1. f(0)=0, f(0.25)=0.0625, f(0.5)=0.25, f(0.75)=0.5625.
  2. Sum = 0.875. L₄ = 0.25 × 0.875 = 0.21875.
Question 4 of 10

For a monotone increasing function, which statement is always true?

For increasing f, the left endpoints give the minimum height in each interval (underestimate) and right endpoints give the maximum (overestimate). So Lₙ ≤ exact ≤ Rₙ.

Question 5 of 10

Evaluate R₄ for f(x) = x² on [0, 1], n = 4. Enter exact decimal.

  1. Right endpoints: 0.25, 0.5, 0.75, 1.0.
  2. Heights: 0.0625, 0.25, 0.5625, 1.0. Sum = 1.875.
  3. R₄ = 0.25 × 1.875 = 0.46875.
Question 6 of 10

What is the value of Σᵢ₌₁⁴ i²?

Using Σi² = n(n+1)(2n+1)/6 with n=4: 4·5·9/6 = 180/6 = 30. Verify: 1+4+9+16 = 30 ✓.

Question 7 of 10

The definite integral is defined as lim_{n→∞} Σ f(xᵢ*)·Δx. For continuous f, does the choice of sample point (left, right, midpoint) affect this limit?

For a continuous (or even Riemann-integrable) function, the limit of any Riemann sum is the same regardless of sample point selection. The choice only affects the approximation quality at finite n, not the limit.

Question 8 of 10

Express lim_{n→∞} (1/n) Σᵢ₌₁ⁿ √(i/n) as a definite integral and give its value to 3 decimal places.

  1. Identify: f(x)=√x, Δx=1/n, sample point xᵢ*=i/n, so this is ∫₀¹ √x dx.
  2. = [⅔x^(3/2)]₀¹ = 2/3 ≈ 0.667.
Question 9 of 10

T₄ for f(x) = x² on [0,1] equals (L₄ + R₄)/2. Using L₄ = 0.21875 and R₄ = 0.46875, what is T₄?

T₄ = (0.21875 + 0.46875)/2 = 0.6875/2 = 0.34375. True value = 1/3 ≈ 0.3333. Error ≈ 0.010.

Question 10 of 10

For which type of function is the trapezoidal rule exact (zero error) for any n?

The trapezoidal error bound contains f″. For linear functions f″ = 0, so the error is exactly 0. Each trapezoid fits perfectly under a straight-line segment.

Quiz complete!

Cookie Settings