Module for the Trapezoidal Rule for Numerical Integration
Check out the new Numerical Analysis Projects page.
Theorem (Trapezoidal
Rule) Consider
over
,
where
.
The trapezoidal rule is
.
This is an numerical
approximation to the integral of
over
and we write
.
Composite Trapezoidal Rule
An intuitive
method of finding the area under a curve y = f(x) is by
approximating that area with a series of trapezoids that lie above
the intervals
. When
several trapezoids are used, we call it the composite
trapezoidal rule.
Theorem (Composite
Trapezoidal Rule) Consider
over
. Suppose
that the interval
is subdivided
into m subintervals
of
equal width
by
using the equally spaced nodes
for
. The
composite
trapezoidal rule for m subintervals
is
.
This is an numerical
approximation to the integral of
over
and we write
.
Animations (Trapezoidal
Rule Trapezoidal
Rule). Internet
hyperlinks to animations.
Algorithm Composite Trapezoidal
Rule. To approximate the
integral
![]()
![]()
,
by sampling
at the
equally spaced points
for
, where
. Notice
that
and
.
Mathematica Subroutine (Trapezoidal Rule).
![[Graphics:Images/TrapezoidalRuleMod_gr_60.gif]](Images/TrapezoidalRuleMod_gr_60.gif)
Or you can use the traditional program.
Mathematica Subroutine (Trapezoidal Rule).
![[Graphics:Images/TrapezoidalRuleMod_gr_61.gif]](Images/TrapezoidalRuleMod_gr_61.gif)
Example
1. Numerically approximate the integral
by using the trapezoidal rule with m = 1, 2, 4, 8, and
16 subintervals.
Example
2. Numerically approximate the integral
by using the trapezoidal rule with m = 50, 100, 200,
400 and 800 subintervals.
Example 3. Find the
analytic value of the integral
(i.e.
find the "true value").
Example 4. Use the "true value" in example 3 and find the error for the trapezoidal rule approximations in example 2.
Remainder
term for the Composite Trapezoidal Rule
Corollary (Trapezoidal
Rule: Remainder term) Suppose
that
is subdivided
into m subintervals
of
width
. The
composite
trapezoidal rule
is an numerical approximation to
the integral, and
.
Furthermore, if
, then
there exists a value c with a < c
< b so that the remainder term
has
the form
.
This is expressed using the "big
"
notation
.
Recursive Integration Rules
Theorem
(Successive Trapezoidal Rules) Suppose
that
and
the points
subdivide
into
subintervals
equal width
. The
trapezoidal rules
obey the relationship
![]()
.
Definition
(Sequence of Trapezoidal Rules) Define
, which
is the trapezoidal rule with step size
. Then
for each
define
is
the trapezoidal rule with step size
.
Corollary
(Recursive Trapezoidal Rule) Start
with
. Then
a sequence of trapezoidal rules
is
generated by the recursive formula
for
.
where
.
The recursive trapezoidal rule is used for the Romberg integration
algorithm.
Research Experience for Undergraduates
Trapezoidal Rule for Numerical Integration Trapezoidal Rule for Numerical Integration Internet hyperlinks to web sites and a bibliography of articles.
Downloads (Trapezoidal Rule Trapezoidal Rule). Download this Mathematica notebook.
(c) John H. Mathews 2003