Lab for Simpson's Quadrature Rule
![]()
Composite Simpson Quadrature
Rule for Numerical Integration. To approximate the
integral
![[Graphics:sq.txtgr1.gif]](sq.txtgr1.gif)
![[Graphics:sq.txtgr2.gif]](sq.txtgr2.gif)
by sampling f(x) at the 2m+1 equally spaced points
.
![]()
Report to be handed in.
Computer project.
![]()
Consider the following function used by chemists
.
Using the Fundamental Theorem of Calculus, we see that the value of
the function ![]()
is the integral of
over the integral 0 <= t <= x.
Use the composite Simpson rule to construct numerical approximations
to
![[Graphics:sq.txtgr9.gif]](sq.txtgr9.gif)
Exercise 1. First define f[t] and be sure to include the definition when t = 0.0
Exercise 2. Plot f[t] for 0 <= t <= 5 . Estimate the area under the curve y = f[t] for 0 <= t <= 5
![]()
![[Graphics:sq.txtgr12.gif]](sq.txtgr12.gif)
Exercise 3. In order to apply Simpson's Rule it is
desirable that f(t) be continuous. We defined f(0) = 0.
Did this make f(t) continuous at t = 0 ? Why ? Find
.
Exercise 4. Use the composite Simpson rule with h = 0.5 and numerically approximate values for g(1), g(2), g(3), g(4) and g(5). Show the details for finding g(1) and g(2).
Use the composite Simpson rule to construct a numerical
approximations to
.
Use the composite Simpson rule to construct a numerical
approximations to
.
Now use the subroutine for the computations and numerically approximate values for g(1), g(2), g(3), g(4) and g(5).
Use the six points (0,g(0)), (1,g(1)), (2,g(2)), (3,g(3)),
(4,g(4)), (5, g(5)) and plot a crude graph
of y=g(x).
![]()
![[Graphics:sq.txtgr23.gif]](sq.txtgr23.gif)
Exercise 5. Use the composite Simpson rule with h = 0.25 and numerically approximate values for g(1), g(2), g(3), g(4) and g(5). Show the details for finding g(1) and g(2).
Use the composite Simpson rule to construct a numerical
approximations to
.
Use the composite Simpson rule to construct a numerical
approximations to
.
Now use the subroutine for the computations and numerically approximate values for g(1), g(2), g(3), g(4) and g(5).
Exercise 6. An accurate answer requires that many
subintervals be used in the composite Simpson Rule.
Use the composite Simpson Rule and find numerically approximations
for
using the step sizes
h = 0.5, 0.25, 0.125, 0.0625, 0.03125
The approximations should improve when more subintervals are
used.
Exercise 7. Assume that
.
Find the absolute errors for the above approximations.
Exercise 8. The remainder term for the composite Simpson
rule is
.
Does the absolute error found in 7. exhibit the pattern expected ?
Why ?
Yes. Because the error decreases by approximately 1/16 when the step size is cut in half.
![]()
![]()
(c) John H. Mathews, 1998