Numerical Integration
Numerical Integration
Numerical integration is the method to calculate the approximate value of the integral
by using numerical techniques
Newton-Cotes Formulas
1. Trapezoidal Rule
the trapezoidal rule is equivalent to approximating the area of the trapezoid under the
straight line connecting f(a) and f(b)
One way to improve the accuracy of the trapezoidal rule is to divide the integration
interval from a to b into a number of segments and apply the method to each segment;
and the areas of individual segments can then be added to yield the integral for the
entire interval
Substituting the trapezoidal rule for each integral
Error Analysis:
Simplifying by estimating the mean or average value of the second derivative for the
entire interval as
Approximation error:
Example 1: Find the approximate integral of the curve and the x – axis on the interval
[1,4] using composite trapezoidal rule for n = 4.
2. Simpson’s Rule – uses the concept of Trapezoidal Rule in the refinement of the approximation
of the area of the curve y = f(x)
a. Simpson’s 1∕3 Rule – an extension of trapezoidal rule where the integrand is
approximated by a second order polynomial.
Consider :
where a = x0, b = x2, and x1 = the point midway between a and b, which is given
by (a + b)∕2
Truncation Error:
b. Composite Simpson’s 1∕3 Rule - dividing the integration interval into a number of
segments of equal width
- the method can be employed only if the number of segments is even.
Error Estimate:
where h = (b − a)∕3
Thus, the two interior points are given weights of three-eighths, whereas the
end points are weighted with one-eighth
Truncation Error:
Simpson’s 1∕3 rule is usually the method of preference because it attains third-order
accuracy with three points rather than the four points required for the 3∕8 version.
However, the 3∕8 rule has utility when the number of segments is odd.
An alternative would be to apply Simpson’s 1∕3 rule to the first two segments and Simpson’s
3∕8 rule to the remaining segments.
Example 1: Evaluate the integral numerically and then by a.) single application of
Simpson’s 1∕3 rule, b.) composite Simpson’s 1∕3 rule with n = 4, c.) Simpson’s 3∕8 rule, and d.) composite
Simpson’s rule, with n = 5. For each of the numerical estimates (a) through (d), determine the true
percent relative error based on analytical value.