Visual Comparison of Simpson's Rule and Trapezium Rule

Visual Comparison of Simpson's Rule and Trapezium Rule
Loading the math board and drawing, please wait…
2018-06-22 17:34
This example visually demonstrates the approximation differences between Simpson's Rule and the Trapezium Rule in numerical integration. Key math concepts include numerical integration, error analysis, and function approximation. GeoGebra commands/objects used in construction include Sequence, Element, FitPoly, Integral, Sum, LaTeX, TrapezoidalSum, TableText, and Textfield. Suitable for high school and above mathematics learners to understand the accuracy and applicability of different integration approximation methods.

GeoGebra Commands & Parameters

  1. Sequence(p, p, a, b, (b - a) / ((2 * n))) → L_1
  2. Sequence((Element[L_1, i], f(Element[L_1, i])), i, 1, (2 * n) + 1) → L_2
  3. Sequence(FitPoly[Take[L_2, i, i + 2], 2], i, 1, (2 * n), 2) → L_3
  4. Element(L_1, A1) → B1
  5. Element(L_1, A2) → B2
  6. Element(L_1, A3) → B3
  7. Element(L_1, A4) → B4
  8. Element(L_1, A5) → B5
  9. Element(L_1, A6) → B6
  10. Element(L_1, A7) → B7
  11. Element(L_1, A8) → B8
  12. Element(L_1, A9) → B9
  13. Element(L_1, A10) → B10
  14. Element(L_1, A11) → B11
  15. Element(L_1, A12) → B12
  16. Element(L_1, A13) → B13
  17. Element(L_1, A14) → B14
  18. Element(L_1, A15) → B15
  19. Element(L_1, A16) → B16
  20. Element(L_1, A17) → B17
  21. Element(L_1, A18) → B18
  22. Element(L_1, A19) → B19
  23. Element(L_1, A20) → B20
  24. Element(L_1, A21) → B21
  25. Element(L_1, A22) → B22
  26. Element(L_1, A23) → B23
  27. Element(L_2, A1) → C1
  28. Element(L_2, A2) → C2
  29. Element(L_2, A3) → C3
  30. Element(L_2, A4) → C4
  31. Element(L_2, A5) → C5
  32. Element(L_2, A6) → C6
  33. Element(L_2, A7) → C7
  34. Element(L_2, A8) → C8
  35. Element(L_2, A9) → C9
  36. Element(L_2, A10) → C10
  37. Element(L_2, A11) → C11
  38. Element(L_2, A12) → C12
  39. Element(L_2, A13) → C13
  40. Element(L_2, A14) → C14
  41. Element(L_2, A15) → C15
  42. Element(L_2, A16) → C16
  43. Element(L_2, A17) → C17
  44. Element(L_2, A18) → C18
  45. Element(L_2, A19) → C19
  46. Element(L_2, A20) → C20
  47. Element(L_2, A21) → C21
  48. Element(L_2, A22) → C22
  49. Element(L_2, A23) → C23
  50. FitPoly({C1, C2, C3}, 2) → D1
  51. FitPoly({C3, C4, C5}, 2) → D3
  52. FitPoly({C5, C6, C7}, 2) → D5
  53. FitPoly({C7, C8, C9}, 2) → D7
  54. FitPoly({C9, C10, C11}, 2) → D9
  55. FitPoly({C11, C12, C13}, 2) → D11
  56. FitPoly({C13, C14, C15}, 2) → D13
  57. FitPoly({C15, C16, C17}, 2) → D15
  58. FitPoly({C17, C18, C19}, 2) → D17
  59. FitPoly({C19, C20, C21}, 2) → D19
  60. FitPoly({C21, C22, C23}, 2) → D21
  61. Integral(D1, x(C1), x(C3)) → F1
  62. Integral(D3, x(C3), x(C5)) → F3
  63. Integral(D5, x(C5), x(C7)) → F5
  64. Integral(D7, x(C7), x(C9)) → F7
  65. Integral(D9, x(C9), x(C11)) → F9
  66. Integral(D11, x(C11), x(C13)) → F11
  67. Integral(D13, x(C13), x(C15)) → F13
  68. Integral(D15, x(C15), x(C17)) → F15
  69. Integral(D17, x(C17), x(C19)) → F17
  70. Integral(D19, x(C19), x(C21)) → F19
  71. Integral(D21, x(C21), x(C23)) → F21
  72. Element(L_1, A24) → B24
  73. Element(L_2, A24) → C24
  74. Element(L_1, A25) → B25
  75. Element(L_2, A25) → C25
  76. Element(L_1, A26) → B26
  77. Element(L_2, A26) → C26
  78. Element(L_1, A27) → B27
  79. Element(L_2, A27) → C27
  80. Element(L_1, A28) → B28
  81. Element(L_2, A28) → C28
  82. Element(L_1, A29) → B29
  83. Element(L_2, A29) → C29
  84. Element(L_1, A30) → B30
  85. Element(L_2, A30) → C30
  86. Element(L_1, A31) → B31
  87. Element(L_2, A31) → C31
  88. Element(L_1, A32) → B32
  89. Element(L_2, A32) → C32
  90. Element(L_1, A33) → B33
  91. Element(L_2, A33) → C33
  92. Element(L_1, A34) → B34
  93. Element(L_2, A34) → C34
  94. Element(L_1, A35) → B35
  95. Element(L_2, A35) → C35
  96. Element(L_1, A36) → B36
  97. Element(L_2, A36) → C36
  98. Element(L_1, A37) → B37
  99. Element(L_2, A37) → C37
  100. Element(L_1, A38) → B38
  101. Element(L_2, A38) → C38
  102. Element(L_1, A39) → B39
  103. Element(L_2, A39) → C39
  104. Element(L_1, A40) → B40
  105. Element(L_2, A40) → C40
  106. Element(L_1, A41) → B41
  107. Element(L_2, A41) → C41
  108. FitPoly({C23, C24, C25}, 2) → D23
  109. FitPoly({C25, C26, C27}, 2) → D25
  110. FitPoly({C27, C28, C29}, 2) → D27
  111. FitPoly({C29, C30, C31}, 2) → D29
  112. FitPoly({C31, C32, C33}, 2) → D31
  113. FitPoly({C33, C34, C35}, 2) → D33
  114. FitPoly({C35, C36, C37}, 2) → D35
  115. FitPoly({C37, C38, C39}, 2) → D37
  116. FitPoly({C39, C40, C41}, 2) → D39
  117. Integral(D23, x(C23), x(C25)) → F23
  118. Integral(D25, x(C25), x(C27)) → F25
  119. Integral(D27, x(C27), x(C29)) → F27
  120. Integral(D29, x(C29), x(C31)) → F29
  121. Integral(D31, x(C31), x(C33)) → F31
  122. Integral(D33, x(C33), x(C35)) → F33
  123. Integral(D35, x(C35), x(C37)) → F35
  124. Integral(D37, x(C37), x(C39)) → F37
  125. Integral(D39, x(C39), x(C41)) → F39
  126. Sum(Sequence[Element[L_4, (2 * i) - 1], i, 1, n]) → simpson
  127. LaTeX($1) → exact
  128. LaTeX($2) → approx
  129. LaTeX("\text{Exact value = }" + exact + " ≈ " + approx) → text2
  130. LaTeX("\text{GeoGebra's approximation} = " + (LaTeX[$3])) → text4
  131. TrapezoidalSum(f, a, b, n) → trapezium
  132. LaTeX("\text{Calculation from Trapezium Rule} = " + trapezium) → text5
  133. Sequence(p, p, a, b, (b - a) / n) → L_6
  134. Sequence(f(Element[L_6, i]), i, 1, n + 1) → L_7
  135. TableText({L_6, L_7}, "c_|h") → text6
  136. TableText({L_1, Append["", First[L_4, (2 * n)]]}, "c_|h") → text3
  137. Textfield(a) → InputBox1
  138. Textfield(b) → InputBox2
  139. Textfield(f) → InputBox3