Facebook Pixel
Mathos AI logo

Riemann Sums and Area Approximation

Riemann Sums and Area Approximation

Finding the exact area under a curve can be tricky. Riemann sums provide a practical way to approximate this area by breaking the region down into simpler geometric shapes, like rectangles or trapezoids.

What is a Riemann Sum?

A Riemann sum approximates the area under a curve y=f(x)y = f(x) on an interval [a,b][a, b] by dividing the interval into nn smaller subintervals and building a shape (usually a rectangle) on each one.

If we divide the interval into nn subintervals of equal width, the width of each subinterval is: Δx=ban\Delta x = \frac{b - a}{n}

Types of Rectangular Approximations

Depending on where you evaluate the function to determine the height of each rectangle, you get different types of sums:

  • Left Riemann Sum: Uses the left endpoint of each subinterval for the height.
  • Right Riemann Sum: Uses the right endpoint of each subinterval for the height.
  • Midpoint Riemann Sum: Uses the exact middle xx-value of each subinterval for the height.

Example: Right Riemann Sum

Problem: Approximate 02x2dx\int_0^2 x^2 \, dx using 44 rectangles with right endpoints.

  1. Find Δx\Delta x: Δx=204=0.5\Delta x = \frac{2 - 0}{4} = 0.5
  2. Identify the subintervals: [0,0.5],[0.5,1],[1,1.5],[1.5,2][0, 0.5], [0.5, 1], [1, 1.5], [1.5, 2]
  3. Find the heights: Evaluate f(x)=x2f(x) = x^2 at the right endpoints (0.5,1,1.5,20.5, 1, 1.5, 2).
  4. Calculate the total area: AreaΔx[f(0.5)+f(1)+f(1.5)+f(2)]\text{Area} \approx \Delta x [f(0.5) + f(1) + f(1.5) + f(2)] Area0.5[0.52+12+1.52+22]\text{Area} \approx 0.5 [0.5^2 + 1^2 + 1.5^2 + 2^2] Area0.5[0.25+1+2.25+4]=0.5[7.5]=3.75\text{Area} \approx 0.5 [0.25 + 1 + 2.25 + 4] = 0.5 [7.5] = 3.75

The Trapezoidal Rule

Instead of flat-topped rectangles, you can use trapezoids to better follow the natural slant of the curve.

The general formula for the Trapezoidal Rule with nn subintervals is: Tn=Δx2[f(x0)+2f(x1)+2f(x2)++2f(xn1)+f(xn)]T_n = \frac{\Delta x}{2} [f(x_0) + 2f(x_1) + 2f(x_2) + \dots + 2f(x_{n-1}) + f(x_n)] Notice that the first and last endpoints are evaluated once, while all the inner endpoints are multiplied by 22.

Example: Trapezoidal Rule

Problem: Estimate 131xdx\int_1^3 \frac{1}{x} \, dx using n=4n = 4.

  1. Find Δx\Delta x: Δx=314=0.5\Delta x = \frac{3 - 1}{4} = 0.5
  2. Identify the endpoints: x0=1,x1=1.5,x2=2,x3=2.5,x4=3x_0=1, x_1=1.5, x_2=2, x_3=2.5, x_4=3
  3. Apply the formula: T4=0.52[f(1)+2f(1.5)+2f(2)+2f(2.5)+f(3)]T_4 = \frac{0.5}{2} \left[ f(1) + 2f(1.5) + 2f(2) + 2f(2.5) + f(3) \right] T4=0.25[1+2(23)+2(12)+2(25)+13]T_4 = 0.25 \left[ 1 + 2\left(\frac{2}{3}\right) + 2\left(\frac{1}{2}\right) + 2\left(\frac{2}{5}\right) + \frac{1}{3} \right] T4=0.25[1+43+1+45+13]T_4 = 0.25 \left[ 1 + \frac{4}{3} + 1 + \frac{4}{5} + \frac{1}{3} \right] T4=0.25[2+53+45]=0.25[30+25+1215]=0.25[6715]=67601.1167T_4 = 0.25 \left[ 2 + \frac{5}{3} + \frac{4}{5} \right] = 0.25 \left[ \frac{30 + 25 + 12}{15} \right] = 0.25 \left[ \frac{67}{15} \right] = \frac{67}{60} \approx 1.1167

Connection to Definite Integrals

Approximations are just the beginning. As you increase the number of rectangles (nn \to \infty), the width of each rectangle (Δx\Delta x) shrinks to zero. The approximation gets closer and closer to the exact area.

This limit is the very definition of the definite integral: limni=1nf(xi)Δx=abf(x)dx\lim_{n \to \infty} \sum_{i=1}^n f(x_i^*) \Delta x = \int_a^b f(x) \, dx