Abstract: This research provides a comprehensive overview of numerical integration using Newton-Cotes formulas, specifically comparing the performance and accuracy of the Trapezoidal, Simpson's 1/3, and Simpson's 3/8 rules. By evaluating these methods against trigonometric and exponential functions in MATLAB R2013a, the study identifies the most effective techniques for solving definite integrals. The results emphasize that Simpson's 1/3 rule consistently offers superior accuracy when the condition of even subdivisions is met.
Introduction
Numerical integration, or quadrature, is a fundamental tool in computational science and engineering. It is essential when an analytical solution to an integral is difficult to obtain or when the integrand is only known at discrete data points. This paper addresses the practical challenge of selecting the most appropriate Newton-Cotes formula by quantitatively comparing the error rates of the Trapezoidal, Simpson’s 1/3, and Simpson’s 3/8 rules as the number of subdivisions ($K$) increases.
Methodology
The core of this analysis involves approximating the area under a curve by replacing the original function with an interpolating polynomial. The three methods studied vary by the degree of this polynomial:
- Trapezoidal Rule: Uses first-degree polynomials (linear approximation) to connect data points.
- Simpson’s 1/3 Rule: Employs second-degree polynomials (parabolas), requiring an even number of subdivisions.
- Simpson’s 3/8 Rule: Utilizes third-degree polynomials (cubic curves), requiring subdivisions in multiples of three.
These algorithms were implemented in MATLAB R2013a. The study evaluated two benchmark functions to measure absolute error against exact analytical solutions:
- Trigonometric: $\int_0^{\pi/2} \sin(x) dx$ (Exact value = 1)
- Exponential: $\int_0^6 e^x dx$ (Exact value $\approx 402.428$)
Comparative Analysis and Insights
A key finding of this study is the "even advantage" of Simpson’s 1/3 rule. While higher-degree polynomials like those in the 3/8 rule theoretically offer better fit, Simpson’s 1/3 rule often yields smaller error values in practice when the subdivision count is even. This suggests that increasing the complexity of the interpolation does not always guarantee higher accuracy for every function type.
Furthermore, the study observed error oscillations. For Simpson’s rules, error rates spike significantly when the number of subdivisions does not align with the method's requirements (e.g., using an odd number of intervals for the 1/3 rule). This underscores the necessity of matching the grid setup to the specific algorithm chosen.
Key Results
The quantitative results highlight a stark difference in precision among the methods:
- Sine Function: At 40 subdivisions, Simpson’s 1/3 rule achieved an error of $1.3 \times 10^{-8}$, whereas the Trapezoidal rule's error was significantly higher at $1.3 \times 10^{-4}$.
- Exponential Function: At $K=40$, Simpson’s 1/3 rule reached an error of $0.00192$, while the Trapezoidal rule lagged with an error of $0.75506$.
Graphical comparisons confirm that the Simpson’s 1/3 rule error curve remains closest to the zero-axis across the widest variety of subdivision counts, establishing it as the most robust method among those tested.
Conclusion
This study concludes that Simpson’s 1/3 rule is the most effective and accurate method for solving definite integrals when the interval is divided into an even number of sub-intervals. While the Trapezoidal rule is simpler to implement and the 3/8 rule uses higher-order polynomials, the 1/3 rule provides the best balance of computational efficiency and precision for smooth functions. Future work may extend this comparison to adaptive quadrature and non-uniform subdivisions to better handle noisy or oscillatory data.
Summary updated