Numerical Integration (Trapezoid, Simpson's, Maclaurin)

Numerical Integration (Trapezoid, Simpson's, Maclaurin)
Loading the math board and drawing, please wait…
2012-11-27 06:13
This example demonstrates numerical integration using the trapezoidal method, Simpson's method, and Maclaurin series, showing the errors of different methods. It covers core concepts in calculus such as integration and error analysis. Using GeoGebra commands like Point, TrapezoidalSum, and Integral, the construction process of these methods can be visually understood. Suitable for university mathematics and engineering courses.

GeoGebra Commands & Parameters

  1. Point(xAxis) → B
  2. Point(xAxis) → A
  3. LowerSum(f_1, a, b, n) → c
  4. LowerSum(g, a, b, n) → d
  5. Segment(A, (a, f_1(a))) → LA
  6. Segment(B, (b, f_1(b))) → LB
  7. Sequence(f_1(a + ((i - 1 + p) * (b - a) / n)), i, 1, n) → L
  8. Integral(f_1, a, b) → actualarea
  9. TrapezoidalSum(f_1, a, b, n) → trapezoidsum
  10. Sequence(a + (i * Δx), i, 0, n) → X
  11. Sequence(Determinant[{{Element[X, (2 * i) - 1]^(2), Element[X, (2 * i) - 1], 1}, {Element[X, (2 * i)]^(2), Element[X, (2 * i)], 1}, {Element[X, (2 * i) + 1]^(2), Element[X, (2 * i) + 1], 1}}], i, 1, n / 2, 1) → S
  12. Sequence(Determinant[{{Element[X, (2 * i) - 1], f_1(Element[X, (2 * i) - 1]), 1}, {Element[X, (2 * i)], f_1(Element[X, (2 * i)]), 1}, {Element[X, (2 * i) + 1], f_1(Element[X, (2 * i) + 1]), 1}}], i, 1, n / 2, 1) → P
  13. Sequence(Determinant[{{Element[X, (2 * i) - 1]^(2), f_1(Element[X, (2 * i) - 1]), 1}, {Element[X, (2 * i)]^(2), f_1(Element[X, (2 * i)]), 1}, {Element[X, (2 * i) + 1]^(2), f_1(Element[X, (2 * i) + 1]), 1}}], i, 1, n / 2, 1) → Q
  14. Sequence(Determinant[{{Element[X, (2 * i) - 1]^(2), Element[X, (2 * i) - 1], f_1(Element[X, (2 * i) - 1])}, {Element[X, (2 * i)]^(2), Element[X, (2 * i)], f_1(Element[X, (2 * i)])}, {Element[X, (2 * i) + 1]^(2), Element[X, (2 * i) + 1], f_1(Element[X, (2 * i) + 1])}}], i, 1, n / 2, 1) → R
  15. Sequence(If[Element[X, (2 * i) - 1] ≤ x ≤ Element[X, (2 * i) + 1], (-1 / Element[S, i] * ((Element[P, i] * x^(2)) - (Element[Q, i] * x) - Element[R, i]))], i, 1, n / 2) → simp
  16. Sequence(Integral[Element[simp, i], Element[X, (2 * i) - 1], Element[X, (2 * i) + 1]], i, 1, n / 2) → simpsonpieces
  17. If(Mod[n, 2] ≟ 0, Sum[simpsonpieces], "undefined") → simparea
  18. Integral(Element[simp, 1], Element[X, 1], Element[X, 3]) → simpsonpiece1
  19. Integral(Element[simp, 2], Element[X, 3], Element[X, 5]) → simpsonpiece2
  20. Integral(Element[simp, 3], Element[X, 5], Element[X, 7]) → simpsonpiece3
  21. Integral(Element[simp, 4], Element[X, 7], Element[X, 9]) → simpsonpiece4
  22. Integral(Element[simp, 5], Element[X, 9], Element[X, 11]) → simpsonpiece5
  23. Integral(Element[simp, 6], Element[X, 11], Element[X, 13]) → simpsonpiece6
  24. Integral(Element[simp, 7], Element[X, 13], Element[X, 15]) → simpsonpiece7
  25. Integral(Element[simp, 8], Element[X, 15], Element[X, 17]) → simpsonpiece8
  26. Integral(Element[simp, 9], Element[X, 17], Element[X, 19]) → simpsonpiece9
  27. Integral(Element[simp, 10], Element[X, 19], Element[X, 21]) → simpsonpiece10
  28. Textfield(f_1) → inputBox1
  29. TaylorSeries(f_1, 0, order) → h
  30. Integral(h, x(A), x(B)) → f

AI Drawing Prompt Reference

Draw the graph of a function f(x) and perform numerical integration using the trapezoidal method, Simpson's method, and Maclaurin series. First, create two points A and B on the x-axis, then use the trapezoidal method and Simpson's method to calculate the integral of f(x) between A and B, and display the actual area, trapezoidal area, and Simpson's area. Finally, use the Maclaurin series to calculate the Taylor series of f(x) at x=0, and compute the integral of this series between A and B.
The prompt above was compiled from the original drawing commands and is for reference only.