Mathwords logoMathwords

Riemann Sum

Riemann Sum

An approximation of the definite integral Definite integral notation: integral from a to b of f(x)dx. This is accomplished in a three-step procedure.

 

Three-step Riemann Sum process: partition [a,b], draw rectangles with height f(c_k), sum areas: integral f(x)dx = lim(norm→0)...

Graph of y=f(x) with shaded rectangles approximating area; labels x₀,c₁,x₁,c₂,x₂,c₃,x₃; formula ∫f(x)dx=f(c₁)(x₁-x₀)+f(c₂)(x₂-

 

See also

Partition, norm of a partition, indefinite integral, sigma notation

Key Formula

Sn=i=1nf(xi)ΔxiS_n = \sum_{i=1}^{n} f(x_i^*)\,\Delta x_i
Where:
  • SnS_n = The Riemann sum, which approximates the definite integral
  • nn = The number of subintervals in the partition of [a, b]
  • f(xi)f(x_i^*) = The value of the function at the chosen sample point in the i-th subinterval
  • Δxi\Delta x_i = The width of the i-th subinterval; for equal-width partitions, Δx = (b − a)/n
  • xix_i^* = The sample point chosen in the i-th subinterval (left endpoint, right endpoint, midpoint, or any point)

Worked Example

Problem: Use a right Riemann sum with 4 subintervals to approximate the integral of f(x) = x² on [0, 4].
Step 1: Partition the interval [0, 4] into 4 equal subintervals and find Δx.
Δx=404=1\Delta x = \frac{4 - 0}{4} = 1
Step 2: Identify the subintervals and right endpoints. The subintervals are [0,1], [1,2], [2,3], [3,4], so the right endpoints are x₁* = 1, x₂* = 2, x₃* = 3, x₄* = 4.
Step 3: Evaluate f(x) = x² at each right endpoint.
f(1)=1,f(2)=4,f(3)=9,f(4)=16f(1) = 1,\quad f(2) = 4,\quad f(3) = 9,\quad f(4) = 16
Step 4: Multiply each function value by Δx and sum to form the Riemann sum.
S4=1(1)+4(1)+9(1)+16(1)=30S_4 = 1(1) + 4(1) + 9(1) + 16(1) = 30
Step 5: Compare to the exact integral. The exact value is 64/3 ≈ 21.33, so the right Riemann sum of 30 is an overestimate because f(x) = x² is increasing on [0, 4].
04x2dx=64321.33\int_0^4 x^2\,dx = \frac{64}{3} \approx 21.33
Answer: The right Riemann sum with 4 subintervals gives an approximation of 30.

Another Example

This example uses midpoints instead of right endpoints for the sample points, demonstrating how the choice of sample point significantly affects accuracy. Midpoint sums tend to be more accurate than left or right sums for the same number of subintervals.

Problem: Use a midpoint Riemann sum with 4 subintervals to approximate the integral of f(x) = x² on [0, 4].
Step 1: The partition and Δx are the same as before.
Δx=404=1\Delta x = \frac{4 - 0}{4} = 1
Step 2: Find the midpoint of each subinterval: [0,1], [1,2], [2,3], [3,4].
x1=0.5,x2=1.5,x3=2.5,x4=3.5x_1^* = 0.5,\quad x_2^* = 1.5,\quad x_3^* = 2.5,\quad x_4^* = 3.5
Step 3: Evaluate f(x) = x² at each midpoint.
f(0.5)=0.25,f(1.5)=2.25,f(2.5)=6.25,f(3.5)=12.25f(0.5) = 0.25,\quad f(1.5) = 2.25,\quad f(2.5) = 6.25,\quad f(3.5) = 12.25
Step 4: Form the Riemann sum.
S4=0.25(1)+2.25(1)+6.25(1)+12.25(1)=21S_4 = 0.25(1) + 2.25(1) + 6.25(1) + 12.25(1) = 21
Answer: The midpoint Riemann sum with 4 subintervals gives 21, which is much closer to the exact value of 64/3 ≈ 21.33 than the right Riemann sum of 30.

Frequently Asked Questions

What is the difference between left, right, and midpoint Riemann sums?
They differ only in where the sample point is chosen within each subinterval. A left Riemann sum uses the left endpoint of each subinterval, a right sum uses the right endpoint, and a midpoint sum uses the point halfway between the two endpoints. For an increasing function, the left sum underestimates and the right sum overestimates the integral; the reverse is true for a decreasing function. The midpoint sum generally gives a better approximation than either.
How does increasing the number of subintervals affect a Riemann sum?
Increasing the number of subintervals n makes each rectangle thinner, allowing the rectangles to fit the curve more closely. As n approaches infinity, the Riemann sum converges to the exact value of the definite integral, provided the function is integrable (which all continuous functions are). This limit is, in fact, the formal definition of the definite integral.
When do you use a Riemann sum instead of the Fundamental Theorem of Calculus?
You use a Riemann sum when you cannot find an antiderivative in closed form, when you only have discrete data points rather than a formula, or when a problem specifically asks for an approximation. In practice, numerical methods like the trapezoidal rule and Simpson's rule—which are refinements of Riemann sum ideas—are widely used in science and engineering.

Riemann Sum vs. Definite Integral

Riemann SumDefinite Integral
DefinitionA finite sum of rectangular areas that approximates the area under a curveThe exact net area under a curve over an interval [a, b]
FormulaΣ f(xᵢ*)Δxᵢ for i = 1 to n∫ₐᵇ f(x) dx = limₙ→∞ Σ f(xᵢ*)Δx
ExactnessAn approximation (finite number of rectangles)Exact value (infinite limit of Riemann sums)
When to useNumerical estimation, discrete data, or building conceptual understandingWhen an antiderivative is available or the exact value is needed

Why It Matters

Riemann sums are the conceptual foundation of the definite integral—every integral you compute in calculus is formally defined as a limit of Riemann sums. Understanding them gives you geometric intuition for why integration measures accumulated area (or accumulated change). They also appear directly in AP Calculus exam questions, where you may be given a table of values and asked to approximate an integral using left, right, or midpoint sums.

Common Mistakes

Mistake: Confusing which endpoint to use: using the right endpoint when the problem asks for a left Riemann sum, or vice versa.
Correction: For a left sum on subinterval [xᵢ₋₁, xᵢ], evaluate f at xᵢ₋₁. For a right sum, evaluate f at xᵢ. Carefully list your subintervals and sample points before computing.
Mistake: Forgetting to multiply each function value by the subinterval width Δx.
Correction: Each term in the sum is an area: height × width = f(xᵢ*) × Δx. If you omit Δx, you are summing function values rather than areas, and your answer will have the wrong magnitude.

Related Terms