Riemann Sums and Area Approximation

Approximating area under curves using rectangles

📊 Riemann Sums and Area Approximation

The Area Problem

How do we find the area under a curve?

Example: Find the area between f(x)=x2f(x) = x^2 and the x-axis from x=0x = 0 to x=2x = 2.

For simple shapes (rectangles, triangles), we have formulas. But for curves? We need a new approach!

💡 Key Idea: Approximate the area using rectangles, then take the limit as the number of rectangles approaches infinity!


Approximating with Rectangles

The Basic Strategy

Step 1: Divide the interval [a,b][a, b] into nn subintervals

Step 2: On each subinterval, draw a rectangle

Step 3: Add up the areas of all rectangles

Step 4: Take the limit as nn \to \infty


Partitioning the Interval

Regular Partition

Divide [a,b][a, b] into nn equal subintervals:

Width of each rectangle: Δx=ban\Delta x = \frac{b-a}{n}

Partition points: x0=a,x1=a+Δx,x2=a+2Δx,,xn=bx_0 = a, \quad x_1 = a + \Delta x, \quad x_2 = a + 2\Delta x, \quad \ldots, \quad x_n = b

In general: xi=a+iΔxx_i = a + i\Delta x


Types of Riemann Sums

The height of each rectangle depends on where we sample the function!

Left Riemann Sum

Use the left endpoint of each subinterval:

Ln=i=0n1f(xi)Δx=f(x0)Δx+f(x1)Δx++f(xn1)ΔxL_n = \sum_{i=0}^{n-1} f(x_i) \Delta x = f(x_0)\Delta x + f(x_1)\Delta x + \cdots + f(x_{n-1})\Delta x


Right Riemann Sum

Use the right endpoint of each subinterval:

Rn=i=1nf(xi)Δx=f(x1)Δx+f(x2)Δx++f(xn)ΔxR_n = \sum_{i=1}^{n} f(x_i) \Delta x = f(x_1)\Delta x + f(x_2)\Delta x + \cdots + f(x_n)\Delta x


Midpoint Riemann Sum

Use the midpoint of each subinterval:

Mn=i=1nf(xi1+xi2)ΔxM_n = \sum_{i=1}^{n} f\left(\frac{x_{i-1} + x_i}{2}\right) \Delta x


Example 1: Computing a Left Riemann Sum

Approximate the area under f(x)=x2f(x) = x^2 from x=0x = 0 to x=2x = 2 using 4 rectangles (left endpoints).

Step 1: Find Δx\Delta x

Δx=ban=204=12\Delta x = \frac{b-a}{n} = \frac{2-0}{4} = \frac{1}{2}


Step 2: Find partition points

x0=0x_0 = 0

x1=0+12=0.5x_1 = 0 + \frac{1}{2} = 0.5

x2=0.5+12=1x_2 = 0.5 + \frac{1}{2} = 1

x3=1+12=1.5x_3 = 1 + \frac{1}{2} = 1.5

x4=1.5+12=2x_4 = 1.5 + \frac{1}{2} = 2


Step 3: Calculate function values at left endpoints

f(x0)=f(0)=02=0f(x_0) = f(0) = 0^2 = 0

f(x1)=f(0.5)=(0.5)2=0.25f(x_1) = f(0.5) = (0.5)^2 = 0.25

f(x2)=f(1)=12=1f(x_2) = f(1) = 1^2 = 1

f(x3)=f(1.5)=(1.5)2=2.25f(x_3) = f(1.5) = (1.5)^2 = 2.25


Step 4: Calculate Left Riemann Sum

L4=[f(x0)+f(x1)+f(x2)+f(x3)]ΔxL_4 = [f(x_0) + f(x_1) + f(x_2) + f(x_3)] \cdot \Delta x

=[0+0.25+1+2.25]12= [0 + 0.25 + 1 + 2.25] \cdot \frac{1}{2}

=3.50.5=1.75= 3.5 \cdot 0.5 = 1.75

Answer: The left Riemann sum approximation is 1.75 square units.

Note: The actual area is 832.67\frac{8}{3} \approx 2.67, so this is an underestimate (because ff is increasing).


Example 2: Right Riemann Sum

Same function f(x)=x2f(x) = x^2 from x=0x = 0 to x=2x = 2 with 4 rectangles (right endpoints).

Use the same partition, but sample at right endpoints:

f(x1)=f(0.5)=0.25f(x_1) = f(0.5) = 0.25

f(x2)=f(1)=1f(x_2) = f(1) = 1

f(x3)=f(1.5)=2.25f(x_3) = f(1.5) = 2.25

f(x4)=f(2)=4f(x_4) = f(2) = 4


R4=[f(x1)+f(x2)+f(x3)+f(x4)]ΔxR_4 = [f(x_1) + f(x_2) + f(x_3) + f(x_4)] \cdot \Delta x

=[0.25+1+2.25+4]12= [0.25 + 1 + 2.25 + 4] \cdot \frac{1}{2}

=7.50.5=3.75= 7.5 \cdot 0.5 = 3.75

Answer: The right Riemann sum approximation is 3.75 square units.

This is an overestimate (because ff is increasing and we use right endpoints).


Increasing vs Decreasing Functions

For Increasing Functions

  • Left sum underestimates (rectangles below curve)
  • Right sum overestimates (rectangles above curve)
  • Midpoint sum is usually more accurate

For Decreasing Functions

  • Left sum overestimates
  • Right sum underestimates
  • Midpoint sum is usually more accurate

Sigma Notation Review

Summation Symbol

i=1nai=a1+a2+a3++an\sum_{i=1}^{n} a_i = a_1 + a_2 + a_3 + \cdots + a_n

Read as: "The sum from i=1i = 1 to nn of aia_i"


Useful Formulas

i=1nc=cn\sum_{i=1}^{n} c = cn (sum of constants)

i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2} (sum of first nn integers)

i=1ni2=n(n+1)(2n+1)6\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6} (sum of squares)

i=1ni3=[n(n+1)2]2\sum_{i=1}^{n} i^3 = \left[\frac{n(n+1)}{2}\right]^2 (sum of cubes)


Example 3: Using Formulas

Find the right Riemann sum for f(x)=xf(x) = x on [0,1][0, 1] with nn rectangles, then take the limit.

Step 1: Find Δx\Delta x

Δx=10n=1n\Delta x = \frac{1-0}{n} = \frac{1}{n}


Step 2: Partition points

xi=0+iΔx=inx_i = 0 + i\Delta x = \frac{i}{n}


Step 3: Right Riemann sum

Rn=i=1nf(xi)Δx=i=1nf(in)1nR_n = \sum_{i=1}^{n} f(x_i) \Delta x = \sum_{i=1}^{n} f\left(\frac{i}{n}\right) \cdot \frac{1}{n}

=i=1nin1n=i=1nin2= \sum_{i=1}^{n} \frac{i}{n} \cdot \frac{1}{n} = \sum_{i=1}^{n} \frac{i}{n^2}

=1n2i=1ni=1n2n(n+1)2= \frac{1}{n^2} \sum_{i=1}^{n} i = \frac{1}{n^2} \cdot \frac{n(n+1)}{2}

=n+12n=12+12n= \frac{n+1}{2n} = \frac{1}{2} + \frac{1}{2n}


Step 4: Take the limit

limnRn=limn(12+12n)=12\lim_{n \to \infty} R_n = \lim_{n \to \infty} \left(\frac{1}{2} + \frac{1}{2n}\right) = \frac{1}{2}

Answer: The exact area is 12\frac{1}{2} square unit.

Check: Area of triangle with base 1 and height 1 is 12(1)(1)=12\frac{1}{2}(1)(1) = \frac{1}{2}


The Definite Integral (Preview)

As nn \to \infty, the Riemann sum approaches 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

This is the exact area under the curve!


Properties of Riemann Sums

More Rectangles = Better Approximation

As nn increases (more rectangles, thinner width):

  • The approximation gets more accurate
  • Left, right, and midpoint sums all approach the same value

Convergence

For continuous functions on [a,b][a, b]: limnLn=limnRn=limnMn=abf(x)dx\lim_{n \to \infty} L_n = \lim_{n \to \infty} R_n = \lim_{n \to \infty} M_n = \int_a^b f(x)\,dx


Trapezoidal Rule

Instead of rectangles, use trapezoids!

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) + \cdots + 2f(x_{n-1}) + f(x_n)]

Pattern: First and last get coefficient 1, all middle terms get coefficient 2.

Often more accurate than left/right/midpoint sums!


Example 4: Trapezoidal Rule

Approximate 02x2dx\int_0^2 x^2\,dx using 4 trapezoids.

Step 1: Δx=204=0.5\Delta x = \frac{2-0}{4} = 0.5

Points: x0=0,x1=0.5,x2=1,x3=1.5,x4=2x_0=0, x_1=0.5, x_2=1, x_3=1.5, x_4=2

Function values: f(x0)=0,f(x1)=0.25,f(x2)=1,f(x3)=2.25,f(x4)=4f(x_0)=0, f(x_1)=0.25, f(x_2)=1, f(x_3)=2.25, f(x_4)=4


Step 2: Apply formula

T4=0.52[0+2(0.25)+2(1)+2(2.25)+4]T_4 = \frac{0.5}{2}[0 + 2(0.25) + 2(1) + 2(2.25) + 4]

=0.25[0+0.5+2+4.5+4]= 0.25[0 + 0.5 + 2 + 4.5 + 4]

=0.2511=2.75= 0.25 \cdot 11 = 2.75

Actual: 832.667\frac{8}{3} \approx 2.667

Pretty close! Better than left (1.75) or right (3.75) with same number of rectangles.


⚠️ Common Mistakes

Mistake 1: Wrong Number of Terms

For nn rectangles:

  • Left sum uses x0,x1,,xn1x_0, x_1, \ldots, x_{n-1} (nn terms)
  • Right sum uses x1,x2,,xnx_1, x_2, \ldots, x_n (nn terms)

Don't mix them up!


Mistake 2: Forgetting Δx\Delta x

Each rectangle has area = height × width!

Don't forget to multiply by Δx\Delta x.


Mistake 3: Using Wrong Endpoints

Left sum: use left endpoints (x0x_0 through xn1x_{n-1})

Right sum: use right endpoints (x1x_1 through xnx_n)


Mistake 4: Arithmetic Errors

With multiple terms, it's easy to make calculation mistakes.

Check: Does your answer make sense? Is it positive when area should be positive?


Historical Note

Named after Bernhard Riemann (1826-1866), who formalized the concept of integration using these sums.

The idea dates back to Archimedes (~250 BC) who used "method of exhaustion" to find areas!


The Big Picture

Riemann sums are the foundation of the definite integral:

  1. Approximate area with rectangles
  2. More rectangles = better approximation
  3. Take the limit as nn \to \infty
  4. Get exact area = definite integral

Next, we'll learn the Fundamental Theorem of Calculus, which gives us an easier way to compute these areas!


📝 Practice Strategy

  1. Find Δx=ban\Delta x = \frac{b-a}{n} first
  2. List partition points: xi=a+iΔxx_i = a + i\Delta x
  3. Identify which endpoints to use (left, right, or midpoint)
  4. Calculate function values at those points
  5. Sum and multiply by Δx\Delta x
  6. Check: Does the answer make sense given the graph?
  7. For limits: Use summation formulas, then let nn \to \infty

📚 Practice Problems

1Problem 1easy

Question:

Approximate 13(2x+1)dx\int_1^3 (2x+1)\,dx using a left Riemann sum with n=4n=4 rectangles.

💡 Show Solution

Step 1: Find Δx\Delta x

Δx=ban=314=24=0.5\Delta x = \frac{b-a}{n} = \frac{3-1}{4} = \frac{2}{4} = 0.5


Step 2: Find partition points

x0=1x_0 = 1

x1=1+0.5=1.5x_1 = 1 + 0.5 = 1.5

x2=1.5+0.5=2x_2 = 1.5 + 0.5 = 2

x3=2+0.5=2.5x_3 = 2 + 0.5 = 2.5

x4=2.5+0.5=3x_4 = 2.5 + 0.5 = 3


Step 3: Calculate function values at left endpoints

f(x)=2x+1f(x) = 2x + 1

f(x0)=f(1)=2(1)+1=3f(x_0) = f(1) = 2(1) + 1 = 3

f(x1)=f(1.5)=2(1.5)+1=4f(x_1) = f(1.5) = 2(1.5) + 1 = 4

f(x2)=f(2)=2(2)+1=5f(x_2) = f(2) = 2(2) + 1 = 5

f(x3)=f(2.5)=2(2.5)+1=6f(x_3) = f(2.5) = 2(2.5) + 1 = 6


Step 4: Calculate Left Riemann Sum

L4=[f(x0)+f(x1)+f(x2)+f(x3)]ΔxL_4 = [f(x_0) + f(x_1) + f(x_2) + f(x_3)] \cdot \Delta x

=[3+4+5+6]0.5= [3 + 4 + 5 + 6] \cdot 0.5

=180.5=9= 18 \cdot 0.5 = 9

Answer: The left Riemann sum approximation is 9 square units.

2Problem 2medium

Question:

Use the midpoint Riemann sum with n=3n=3 to approximate 03x2dx\int_0^3 x^2\,dx.

💡 Show Solution

Step 1: Find Δx\Delta x

Δx=303=1\Delta x = \frac{3-0}{3} = 1


Step 2: Find partition points

x0=0,x1=1,x2=2,x3=3x_0 = 0, \quad x_1 = 1, \quad x_2 = 2, \quad x_3 = 3


Step 3: Find midpoints

Midpoint of [x0,x1][x_0, x_1]: m1=0+12=0.5m_1 = \frac{0+1}{2} = 0.5

Midpoint of [x1,x2][x_1, x_2]: m2=1+22=1.5m_2 = \frac{1+2}{2} = 1.5

Midpoint of [x2,x3][x_2, x_3]: m3=2+32=2.5m_3 = \frac{2+3}{2} = 2.5


Step 4: Calculate function values at midpoints

f(x)=x2f(x) = x^2

f(m1)=f(0.5)=(0.5)2=0.25f(m_1) = f(0.5) = (0.5)^2 = 0.25

f(m2)=f(1.5)=(1.5)2=2.25f(m_2) = f(1.5) = (1.5)^2 = 2.25

f(m3)=f(2.5)=(2.5)2=6.25f(m_3) = f(2.5) = (2.5)^2 = 6.25


Step 5: Calculate Midpoint Riemann Sum

M3=[f(m1)+f(m2)+f(m3)]ΔxM_3 = [f(m_1) + f(m_2) + f(m_3)] \cdot \Delta x

=[0.25+2.25+6.25]1= [0.25 + 2.25 + 6.25] \cdot 1

=8.75= 8.75

Answer: The midpoint Riemann sum approximation is 8.75 square units.

Note: The actual value is 03x2dx=x3303=9\int_0^3 x^2\,dx = \frac{x^3}{3}\Big|_0^3 = 9, so this is quite accurate!

3Problem 3expert

Question:

Find the exact value of 01x2dx\int_0^1 x^2\,dx by taking the limit of a right Riemann sum as nn \to \infty.

💡 Show Solution

Step 1: Set up the right Riemann sum

Δx=10n=1n\Delta x = \frac{1-0}{n} = \frac{1}{n}

xi=0+i1n=inx_i = 0 + i \cdot \frac{1}{n} = \frac{i}{n}


Step 2: Write the sum

Rn=i=1nf(xi)Δx=i=1nf(in)1nR_n = \sum_{i=1}^{n} f(x_i) \Delta x = \sum_{i=1}^{n} f\left(\frac{i}{n}\right) \cdot \frac{1}{n}

=i=1n(in)21n= \sum_{i=1}^{n} \left(\frac{i}{n}\right)^2 \cdot \frac{1}{n}

=i=1ni2n21n=i=1ni2n3= \sum_{i=1}^{n} \frac{i^2}{n^2} \cdot \frac{1}{n} = \sum_{i=1}^{n} \frac{i^2}{n^3}


Step 3: Factor out constant

=1n3i=1ni2= \frac{1}{n^3} \sum_{i=1}^{n} i^2


Step 4: Use summation formula

i=1ni2=n(n+1)(2n+1)6\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}

Rn=1n3n(n+1)(2n+1)6R_n = \frac{1}{n^3} \cdot \frac{n(n+1)(2n+1)}{6}

=n(n+1)(2n+1)6n3= \frac{n(n+1)(2n+1)}{6n^3}


Step 5: Simplify

=(n+1)(2n+1)6n2=2n2+3n+16n2= \frac{(n+1)(2n+1)}{6n^2} = \frac{2n^2 + 3n + 1}{6n^2}

=2n26n2+3n6n2+16n2= \frac{2n^2}{6n^2} + \frac{3n}{6n^2} + \frac{1}{6n^2}

=13+12n+16n2= \frac{1}{3} + \frac{1}{2n} + \frac{1}{6n^2}


Step 6: Take the limit

limnRn=limn(13+12n+16n2)\lim_{n \to \infty} R_n = \lim_{n \to \infty} \left(\frac{1}{3} + \frac{1}{2n} + \frac{1}{6n^2}\right)

=13+0+0=13= \frac{1}{3} + 0 + 0 = \frac{1}{3}

Answer: 01x2dx=13\int_0^1 x^2\,dx = \frac{1}{3}