Numerical integration
To calculate definite integral by the rectangle method, trapezoid method, Simpson method or other NewtonCotes quadrature methods.
This page exists due to the efforts of the following people:
 Author
 Anton  Numerical integration
 Created using the work of
 Anton  Numerical integration with explicit NewtonCotes formula coefficients
 Anton  Numerical integration using NewtonCotes formulas
Numerical methods can be used for definite integral value approximation. Numerical integration is used in case of impossibility to evaluate antiderivative analytically and then calculate definite integral using Newton–Leibniz axiom.
Numerical integration of a single argument function can be represented as the area (or quadrature) calculation of a curvilinear trapezoid bounded by the graph of a given function, the xaxis and vertical lines bounding given limits.
The integrand function is replaced by simpler one (which has antiderivative) approximating the integrand with a given accuracy. Replacing the integrand with Lagrange polynomials evaluated at equally spaced points in given limits yields the NewtonCotes integration formulas, such as:

33650

33640
 33641
Numerical integration using NewtonCotes formulas
Using NewtonCotes formulas, the integration interval is divided by points x_{1},x_{2},x_{3}..x_{n} into equal line segments.
Integrand function is replaced by the Lagrange polynomials of different degree, integration of which yields the numerical integration formulas with different degree of accuracy.
Finally the definite integral approximation is evaluated as the weighted sum of integrand values evaluated for the integration points:
 W_{i}  weights, determined by integration methods
 R_{n}  remainder or error.
 n  number of integration points.
 The formula sum is a quadrature rule.
Handbook NewtonCotes quadrature functions, contains a few commonly mentioned NewtonCotes quadrature rules for integration on equally spaced intervals. Any registered user can add a new quadrature rule in this handbook.
Integration segment limits
Depending on the end points using by an integration method, open or closed rules are distinguished.
Open rules do not use end points. The open integration methods can be used in cases where integrand function is undefined in some points.
E.g. using rectangle method we can approximate ln(x) definite integral value on (0,1) line segment, in spite of ln(0) is undefined.
In opposite, Closed rules, use end points as well as midpoints to evaluate integrand function values.
Halfopened rules (e.g. left rectangle rule or right rectangle rule) can also be used to approximate integral on the line segment opened from the only one side.
NewtonCotes rule approximation error
Commonly by the increasing number of integration points (with increasing polynomial degree), the accuracy is raised as well. But for some functions it is not true.
Karl Runge, german mathematician, analyzed this oddity first.
He noticed, the interpolaton polynomial with equally spaced interval for function ceases to converge in the range 0.726.. ≤ x <1 with raising polynomial degree.
It can be explained by looking on the error equation. The formula includes interval h and factorial n!, both of them increase accuracy if n tends to infinity, but ndegree derivative part value, which decrease accuracy in the error equation, raises faster for particular functions.
In addition, with raising interpolation polynomial degree, we get negative weights, which can increase computational error. The calculator displays intermediate quadrature function results in graphical form. For the methods having only positive W_{i} weights it looks like Riemann sum representation. If negative W_{i} weights exists, the graph has both positive and negative halves which are wider than integration interval. This effect can be seen here: Closed NewtonCotes rule with 11nodes
Taking in account this arguments it is not recommended to use rules with polynomial degree >10.
To increase accuracy, the integration interval can be divided in a few parts, for each of which definite integral can be calculated separately with any integration rule. Final integral value is the sum of integral for each partial intervals.
To evaluate a new integration methods based on eqally spaced intervals you may use the following calculator having an input box for entering weights:
The weights are comma separated real numbers or common fractions. First coefficient in the weight list is a common multiplier, enter 1 there if there is no common multiplier.
>E.g. 3/8,1,3,3,1 weights can be used for Simpson 3/8 rule
Definite integral approximation with NewtonCotes integration rules is far from ideal. For real applications you should use better methods, e,g. GaussKronrod rule. Hopefully we'll illustrate it by the new calculators and articles in nearest future.
Literature:
 N.S. Bakhvalov Numerical methods, 2012
 U.G.Pirumov Numerical methods, 2006
 D. Kahaner, C.Moler, S.Nash Numerical methods and software, 1989
 R.V. Hamming Numerical methods for scientists and engineers, 1972
 M. Abramovitz и I. Stegun Handbook of Mathematical Functions With Formulas, Graphs and Mathematical Tables, 1973
Comments