Comparing Numerical Integration: Upper/Lower Riemann Sums and Trapezoids

Comparing Numerical Integration: Upper/Lower Riemann Sums and Trapezoids
Loading the math board and drawing, please wait…
2021-01-07 01:44
This GeoGebra example visualizes numerical integration by comparing geometric area approximations of a function over [A,B]. It demonstrates how the upper and lower Riemann sums, as well as the trapezoidal sum, approximate the definite integral and how the approximation improves as the number of subintervals increases. The key math concepts include the definite integral, UpperSum and LowerSum (upper/lower Riemann sums), TrapezoidalSum, partitioning the interval, and the role of discretization in numerical accuracy. Construction highlights: Points and RectangleSum are used to build the rectangle-based area visualization; If and Sequence help generate piecewise parameters and summation terms; UpperSum, LowerSum, and TrapezoidalSum produce Upsum, Lowsum, and Trapsum; Sum and Integral enable a direct comparison between the numerical approximations and the exact definite integral. Textfield labels and annotations (e.g., for interval endpoints and mid/left/right information) support clear interpretation. Suitable for high school and early calculus courses, as well as learners studying the geometric meaning of integrals and basic numerical integration methods.

GeoGebra Commands & Parameters

  1. Point(xAxis) → A
  2. Point(xAxis) → B
  3. RectangleSum(f, x(A), x(B), n, d) → LRsum
  4. If(d ≟ 0, lefttext, If[d ≟ 0.5, midtext, If[d ≟ 1, righttext]]) → text1
  5. UpperSum(f, x(A), x(B), n) → Upsum
  6. LowerSum(f, x(A), x(B), n) → Lowsum
  7. TrapezoidalSum(f, x(A), x(B), n) → Trapsum
  8. Sequence(x(A) + ((x(B) - x(A)) / n * ii), ii, 0, n) → l1
  9. Zip((aa, bb), aa, l1, bb, l2) → l3
  10. Last(l1, n - 1) → l6
  11. Sequence(Sequence[Element[l3, ii], ii, jj, jj + 2], jj, 1, n - 1, 2) → l7
  12. Zip(FitPoly[ll, 2], ll, l7) → l4
  13. Sequence(Element[l3, ii], ii, 1, n + 1, 2) → odds
  14. Sequence(Element[l3, ii], ii, 2, n + 1, 2) → evens
  15. Last(odds, Length[odds] - 1) → l8
  16. Zip(If[aa ≤ x ≤ bb, gg(x)], gg, l4, aa, x(odds), bb, x(l8)) → l5
  17. Zip(Integral[gg, aa, bb], gg, l4, aa, x(odds), bb, x(l8)) → l9
  18. Zip((aa, 0), aa, l1) → l10
  19. Textfield(f) → InputBox1
  20. Integral(f, x(A), x(B)) → p
  21. Sum(l9) → Simpsum

AI Drawing Prompt Reference

Draw the numerical integration graph of function f over the interval [A, B], including upper, lower Riemann, and trapezoidal approximations. Start by plotting the interval endpoints A and B, then use the RectangleSum function to draw the rectangular area approximation, followed by the UpperSum, LowerSum, and TrapezoidalSum functions to draw the upper, lower Riemann, and trapezoidal approximations, and finally use the Sum function to calculate the difference between the trapezoidal approximation and the exact integral.
The prompt above was compiled from the original drawing commands and is for reference only.