Solved Exercises on Approximation with Riemann Sums

Master Riemann sums: left, right, midpoint, and trapezoidal approximations for definite integrals through these 5 detailed exercises.

Solution: Exercises 1 to 3
1 Left Riemann Sum
Exercise 1
Approximate \(\int_0^4 x^2 dx\) using a left Riemann sum with \(n = 4\) subintervals.
Definition:

Left Riemann Sum: \(L_n = \sum_{i=0}^{n-1} f(x_i) \Delta x\) where \(x_i\) are left endpoints of subintervals.

Left Riemann Sum method:
  1. Divide interval \([a,b]\) into \(n\) equal subintervals of width \(\Delta x = \frac{b-a}{n}\)
  2. Identify left endpoints: \(x_0, x_1, ..., x_{n-1}\)
  3. Evaluate function at left endpoints
  4. Calculate: \(L_n = \Delta x[f(x_0) + f(x_1) + ... + f(x_{n-1})]\)
Interval
\([0,4]\)
Width
\(\Delta x = 1\)
Result
\(L_4 = 14\)
Step 1: Calculate subinterval width

\(\Delta x = \frac{b-a}{n} = \frac{4-0}{4} = 1\)

Step 2: Identify left endpoints

With \(n = 4\), the subintervals are: \([0,1], [1,2], [2,3], [3,4]\)

Left endpoints: \(x_0 = 0, x_1 = 1, x_2 = 2, x_3 = 3\)

Step 3: Evaluate function at left endpoints

For \(f(x) = x^2\):

\(f(x_0) = f(0) = 0^2 = 0\)

\(f(x_1) = f(1) = 1^2 = 1\)

\(f(x_2) = f(2) = 2^2 = 4\)

\(f(x_3) = f(3) = 3^2 = 9\)

Step 4: Calculate the left Riemann sum

\(L_4 = \Delta x[f(x_0) + f(x_1) + f(x_2) + f(x_3)]\)

\(L_4 = 1[0 + 1 + 4 + 9] = 14\)

\(L_4 = 14\)
Final answer:

The left Riemann sum approximation is 14.

(Note: The exact value is \(\frac{64}{3} \approx 21.33\), so this underestimates due to the increasing function.)

Applied rules:

Left endpoint selection: Use \(x_0, x_1, ..., x_{n-1}\) for left sum

Underestimation property: For increasing functions, left sum underestimates the integral

Formula: \(L_n = \sum_{i=0}^{n-1} f(x_i) \Delta x\)

2 Right Riemann Sum
Exercise 2
Approximate \(\int_0^4 x^2 dx\) using a right Riemann sum with \(n = 4\) subintervals.
Definition:

Right Riemann Sum: \(R_n = \sum_{i=1}^{n} f(x_i) \Delta x\) where \(x_i\) are right endpoints of subintervals.

Interval
\([0,4]\)
Width
\(\Delta x = 1\)
Result
\(R_4 = 30\)
Step 1: Use same subinterval width

\(\Delta x = 1\) (same as Exercise 1)

Step 2: Identify right endpoints

Right endpoints: \(x_1 = 1, x_2 = 2, x_3 = 3, x_4 = 4\)

Step 3: Evaluate function at right endpoints

For \(f(x) = x^2\):

\(f(x_1) = f(1) = 1^2 = 1\)

\(f(x_2) = f(2) = 2^2 = 4\)

\(f(x_3) = f(3) = 3^2 = 9\)

\(f(x_4) = f(4) = 4^2 = 16\)

Step 4: Calculate the right Riemann sum

\(R_4 = \Delta x[f(x_1) + f(x_2) + f(x_3) + f(x_4)]\)

\(R_4 = 1[1 + 4 + 9 + 16] = 30\)

\(R_4 = 30\)
Final answer:

The right Riemann sum approximation is 30.

(Note: The exact value is \(\frac{64}{3} \approx 21.33\), so this overestimates due to the increasing function.)

Applied rules:

Right endpoint selection: Use \(x_1, x_2, ..., x_n\) for right sum

Overestimation property: For increasing functions, right sum overestimates the integral

Formula: \(R_n = \sum_{i=1}^{n} f(x_i) \Delta x\)

3 Midpoint Riemann Sum
Exercise 3
Approximate \(\int_0^4 x^2 dx\) using a midpoint Riemann sum with \(n = 4\) subintervals.
Definition:

Midpoint Riemann Sum: \(M_n = \sum_{i=1}^{n} f(\bar{x}_i) \Delta x\) where \(\bar{x}_i\) are midpoints of subintervals.

Interval
\([0,4]\)
Width
\(\Delta x = 1\)
Result
\(M_4 = 21\)
Step 1: Use same subinterval width

\(\Delta x = 1\) (same as previous exercises)

Step 2: Identify midpoints

For intervals \([0,1], [1,2], [2,3], [3,4]\):

\(\bar{x}_1 = 0.5, \bar{x}_2 = 1.5, \bar{x}_3 = 2.5, \bar{x}_4 = 3.5\)

Step 3: Evaluate function at midpoints

For \(f(x) = x^2\):

\(f(\bar{x}_1) = f(0.5) = (0.5)^2 = 0.25\)

\(f(\bar{x}_2) = f(1.5) = (1.5)^2 = 2.25\)

\(f(\bar{x}_3) = f(2.5) = (2.5)^2 = 6.25\)

\(f(\bar{x}_4) = f(3.5) = (3.5)^2 = 12.25\)

Step 4: Calculate the midpoint Riemann sum

\(M_4 = \Delta x[f(\bar{x}_1) + f(\bar{x}_2) + f(\bar{x}_3) + f(\bar{x}_4)]\)

\(M_4 = 1[0.25 + 2.25 + 6.25 + 12.25] = 21\)

\(M_4 = 21\)
Final answer:

The midpoint Riemann sum approximation is 21.

(Note: The exact value is \(\frac{64}{3} \approx 21.33\), so this is very close to the actual value.)

Applied rules:

Midpoint selection: Use \(\bar{x}_i = \frac{x_{i-1} + x_i}{2}\) for midpoint sum

Accuracy property: Midpoint rule is typically more accurate than left/right rules

Formula: \(M_n = \sum_{i=1}^{n} f(\bar{x}_i) \Delta x\)

Summary: Riemann Sums Concepts and Methods
\(R_n = \sum_{i=1}^{n} f(x_i^*) \Delta x\)
General Riemann Sum Formula
Left Sum
\(L_n = \sum_{i=0}^{n-1} f(x_i) \Delta x\)
Uses left endpoints
Right Sum
\(R_n = \sum_{i=1}^{n} f(x_i) \Delta x\)
Uses right endpoints
Midpoint Sum
\(M_n = \sum_{i=1}^{n} f(\bar{x}_i) \Delta x\)
Uses midpoints
Key definitions:

Riemann sum: An approximation of a definite integral using rectangles to estimate the area under a curve

Partition: Division of interval \([a,b]\) into \(n\) subintervals of equal width \(\Delta x = \frac{b-a}{n}\)

Sample point: The point \(x_i^*\) in each subinterval where the function is evaluated

Complete methodology:
  1. Determine partition: Calculate \(\Delta x = \frac{b-a}{n}\) and identify subintervals
  2. Select sample points: Choose left, right, or midpoint of each subinterval
  3. Evaluate function: Calculate \(f(x_i^*)\) for each sample point
  4. Sum rectangles: Multiply each function value by \(\Delta x\) and sum all products
Tip 1: For increasing functions: Left sum < Exact integral < Right sum
Tip 2: Midpoint rule is generally more accurate than left/right rules
Tip 3: As \(n \to \infty\), Riemann sums converge to the exact integral value
Tip 4: More subintervals (larger n) generally provide better approximations
Convergence: \(\lim_{n \to \infty} R_n = \int_a^b f(x)dx\) for continuous functions
Error bounds: Midpoint rule error is typically smaller than left/right rules
Solution: Exercises 4 to 5
4 Trapezoidal Rule
Exercise 4
Approximate \(\int_0^4 x^2 dx\) using the trapezoidal rule with \(n = 4\) subintervals.
Definition:

Trapezoidal Rule: \(T_n = \frac{\Delta x}{2}[f(x_0) + 2f(x_1) + 2f(x_2) + ... + 2f(x_{n-1}) + f(x_n)]\)

Function values
\(f(0)=0, f(1)=1, f(2)=4, f(3)=9, f(4)=16\)
Trapezoidal formula
\(T_4 = \frac{1}{2}[0 + 2(1) + 2(4) + 2(9) + 16]\)
Result
\(T_4 = 22\)
Step 1: Use same subinterval width

\(\Delta x = 1\) (same as previous exercises)

Step 2: Identify all endpoints

All endpoints: \(x_0 = 0, x_1 = 1, x_2 = 2, x_3 = 3, x_4 = 4\)

Step 3: Evaluate function at all endpoints

For \(f(x) = x^2\):

\(f(x_0) = 0, f(x_1) = 1, f(x_2) = 4, f(x_3) = 9, f(x_4) = 16\)

Step 4: Apply trapezoidal rule formula

\(T_n = \frac{\Delta x}{2}[f(x_0) + 2f(x_1) + 2f(x_2) + ... + 2f(x_{n-1}) + f(x_n)]\)

\(T_4 = \frac{1}{2}[f(0) + 2f(1) + 2f(2) + 2f(3) + f(4)]\)

\(T_4 = \frac{1}{2}[0 + 2(1) + 2(4) + 2(9) + 16]\)

\(T_4 = \frac{1}{2}[0 + 2 + 8 + 18 + 16] = \frac{44}{2} = 22\)

\(T_4 = 22\)
Final answer:

The trapezoidal rule approximation is 22.

(Note: The exact value is \(\frac{64}{3} \approx 21.33\), so this is quite close to the actual value.)

Applied rules:

Trapezoidal formula: Average of left and right sums: \(T_n = \frac{L_n + R_n}{2}\)

Endpoint weights: Endpoints get weight 1, interior points get weight 2

Formula: \(T_n = \frac{\Delta x}{2}[f(x_0) + 2\sum_{i=1}^{n-1}f(x_i) + f(x_n)]\)

5 Comparison of Methods
Exercise 5
Compare all four methods for \(\int_0^4 x^2 dx\) with \(n = 4\). Which is most accurate?
Definition:

Exact value: \(\int_0^4 x^2 dx = \left[\frac{x^3}{3}\right]_0^4 = \frac{64}{3} \approx 21.33\)

Left Sum
\(L_4 = 14\)
Right Sum
\(R_4 = 30\)
Midpoint
\(M_4 = 21\)
Trapezoid
\(T_4 = 22\)
Step 1: Calculate errors for each method

Exact value: \(\frac{64}{3} \approx 21.33\)

Left sum error: \(|21.33 - 14| = 7.33\)

Right sum error: \(|21.33 - 30| = 8.67\)

Midpoint error: \(|21.33 - 21| = 0.33\)

Trapezoid error: \(|21.33 - 22| = 0.67\)

Step 2: Analyze results

For the increasing function \(f(x) = x^2\):

• Left sum (14) underestimates (as expected)

• Right sum (30) overestimates (as expected)

• Midpoint rule (21) is very close to exact value

• Trapezoid rule (22) is also quite close

Step 3: Determine most accurate method

The midpoint rule has the smallest error (0.33), followed by the trapezoid rule (0.67).

Both are significantly more accurate than left or right sums.

Step 4: Conclusion

For this function, the midpoint rule provides the most accurate approximation with the same number of function evaluations as the others.

Most accurate: Midpoint Rule (error = 0.33)
Final answer:

The midpoint rule is most accurate among the four methods, with an error of only 0.33 compared to the exact value of 21.33.

Applied rules:

Order of accuracy: Midpoint ≈ Trapezoid > Left/Right (for smooth functions)

Monotonicity property: For increasing functions, left < exact < right

Error analysis: Compare approximations to known exact values

Key Concepts, Laws, Methods, and Formulas
\(\lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*) \Delta x = \int_a^b f(x)dx\)
Limit Definition of Definite Integral
Key definitions:

Riemann sum: An approximation of a definite integral using finite sums of rectangles

Partition norm: The length of the largest subinterval in a partition

Refinement: Adding more points to a partition, making subintervals smaller

Complete methodology:
  1. Problem setup: Identify the integral to approximate and desired number of subintervals
  2. Calculate parameters: Find \(\Delta x = \frac{b-a}{n}\) and subinterval endpoints
  3. Choose method: Select left, right, midpoint, or trapezoidal based on requirements
  4. Compute sum: Apply the appropriate formula systematically
  5. Analyze accuracy: Consider error bounds and convergence properties
Tip 1: For concave up functions, left sums underestimate and right sums overestimate.
Tip 2: The trapezoidal rule can be viewed as averaging left and right sums.
Tip 3: For symmetric functions, midpoint and trapezoidal rules often have similar accuracy.
Tip 4: Increasing the number of subintervals typically improves accuracy (but not always).
Error bounds: For smooth functions, midpoint error ≈ -(trapezoid error)/2.
Computational efficiency: Midpoint and trapezoidal rules offer good accuracy with moderate computational cost.
Formulas to know by heart:

• Left sum: \(L_n = \sum_{i=0}^{n-1} f(x_i) \Delta x\)

• Right sum: \(R_n = \sum_{i=1}^{n} f(x_i) \Delta x\)

• Midpoint: \(M_n = \sum_{i=1}^{n} f(\bar{x}_i) \Delta x\)

• Trapezoid: \(T_n = \frac{\Delta x}{2}[f(x_0) + 2\sum_{i=1}^{n-1}f(x_i) + f(x_n)]\)

• Relationship: \(T_n = \frac{L_n + R_n}{2}\)

Visualization: Different Riemann Sum Methods
Exercise 6: Method Comparison
Compare approximation methods for different functions:
\(f_1(x) = x^2\) (increasing, concave up)
\(f_2(x) = \sqrt{x}\) (increasing, concave down)
\(f_3(x) = x^3\) (increasing, changes concavity)

Analysis: The chart shows how different functions respond to various approximation methods.

  • \(f_1(x) = x^2\): Left underestimates, right overestimates, midpoint most accurate
  • \(f_2(x) = \sqrt{x}\): Concave down behavior affects error patterns differently
  • \(f_3(x) = x^3\): Higher-order polynomial with changing curvature

Questions & Answers

Question: Why does the midpoint rule tend to be more accurate than left or right Riemann sums?

Answer: The midpoint rule is typically more accurate because it balances out errors from concavity:

  • In each subinterval, the rectangle height is determined at the midpoint, which often captures the average behavior of the function in that interval
  • For concave up functions, left sums consistently underestimate and right sums overestimate, but midpoint rule tends to cancel out some of this bias
  • Mathematically, the error in the midpoint rule is proportional to \(h^2\) (where \(h = \Delta x\)), while for left/right sums it's also proportional to \(h\), but with a larger constant factor

The midpoint rule essentially uses the function value that best represents the average height of the function over the subinterval, leading to more accurate approximations.

Question: How do I choose the number of subintervals \(n\) for a desired accuracy?

Answer: Choosing \(n\) depends on the required precision and available computational resources:

  • Rule of thumb: Start with a reasonable \(n\) (like 10 or 20) and increase until the result stabilizes
  • Error estimation: For smooth functions, doubling \(n\) typically reduces error by a factor of 4 (for midpoint/trapezoidal) or 2 (for left/right)
  • Practical approach: Calculate the same integral with \(n\) and \(2n\) subintervals; if results differ by less than your tolerance, you've achieved sufficient accuracy

There are also theoretical error bounds involving derivatives of the function, but the practical approach of comparing results with different \(n\) values is often more reliable.

Question: When would I use Riemann sums instead of finding the exact integral?

Answer: Riemann sums are valuable when:

  • No elementary antiderivative exists: Functions like \(e^{-x^2}\) or \(\sin(x^2)\) cannot be integrated exactly using elementary functions
  • Data-based integration: When you have discrete data points rather than a formula
  • Computational algorithms: Numerical integration is fundamental in computer implementations
  • Understanding concepts: Riemann sums provide intuition for what definite integrals represent
  • Real-time applications: When quick approximations are needed without complex calculations

Even when exact integration is possible, Riemann sums help verify results and understand the geometric interpretation of integrals.

Question: What happens to Riemann sums as the number of subintervals approaches infinity?

Answer: This is the foundation of definite integrals! As \(n \to \infty\):

  • Subinterval width approaches zero: \(\Delta x = \frac{b-a}{n} \to 0\)
  • Riemann sums converge: \(R_n \to \int_a^b f(x)dx\) (for continuous functions)
  • Rectangle approximation becomes exact: The sum of infinitely many infinitesimally narrow rectangles equals the exact area

This limit process is precisely how definite integrals are defined:

\(\int_a^b f(x)dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i^*) \Delta x\)

This connection between discrete approximations and continuous integrals is one of the most beautiful concepts in calculus.

Question: How do I decide which Riemann sum method to use in a practical application?

Answer: The choice depends on several factors:

  • Precision needs: For highest accuracy with minimal computation, use midpoint or trapezoidal rules
  • Function behavior: If you know the function is increasing/decreasing, left/right sums give consistent over/underestimates
  • Computational constraints: Left/right sums require fewer function evaluations than midpoint or trapezoidal
  • Physical interpretation: Sometimes a particular method aligns better with the real-world scenario (e.g., using right sums when measuring current values)

In practice, many applications use higher-order methods like Simpson's rule, but Riemann sums provide the conceptual foundation and work well for many situations.

A common approach is to try multiple methods and compare results to assess accuracy.