MATH 132 -- Calculus for Physical and Life Science 2
Approximate Integration in Maple
February 13, 2008
Let's consider the definite integral This is one where we can
find a symbolic indefinite integral to apply the Evaluation Theorem. Here's the
way it's done with Maple (the form is different from, though equivalent to,
what our tables would say).
> |
|
|
(1) |
The definite integral, in exact form (val) and then in a decimal approximation (ExactValue):
> |
|
|
(2) |
> |
|
|
(3) |
Now we compute some approximations using the Left, Right, and Midpoint Riemann
sums, the Trapezoidal rule, and Simpson's Rule, together with the error (the difference
ExactValue - ApproximateValue) for each method:
> |
|
> |
|
|
(4) |
> |
|
|
(5) |
> |
|
|
(6) |
> |
|
|
(7) |
> |
|
|
(8) |
> |
|
|
(9) |
> |
|
|
(10) |
> |
|
|
(11) |
> |
|
|
(12) |
> |
|
|
(13) |
Some questions about what we are seeing here:
Which of the estimates are underestimates? And how can you tell?
2. Which of the estimates are overestimates? How can you tell?
3. Which method is "better" here -- Trapezoidal Rule or Midpoint Riemann Sum?
4. Which is the "best" method overall?
Note that the weighted average
> |
|
|
(14) |
gives the same value as Simpson's Rule (!?) Is this a coincidence?