Dr. K. G. TeBeest
- Do Problem 2 in this problem set.
- Modify the Maple code for the trapezoidal rule (see the previous assignment) to turn it into Simpson's1/3 rule.
Then use it to approximate the sample problem (integral of sin x on the interval [0, π]) using 10 subintervals.
(Also see the pseudocode for Simpson's1/3 rule.)
- Now re-run your Simpson's1/3 rule code using 20 subintervals. You should get the results handed out in class.
- Use the Simpson's1/3 rule code to approximate the integral of e–x2 on the interval [0,3] using:
- 10 subintervals Answer: 0.88620 65522 46007 52234
- 20 subintervals Answer: 0.88620 72892 43422 90023
- Use Richardson extrapolation to obtain an improved estimate.
Answer: 0.88620 73383 76583 92542- Without knowing the actual errors, determine how much more accurate result (b) should be than result (a).
- Play around with the code to approximate integrals of other functions f(x) on different intervals [a, b].
- In class I derived the formula for the trapezoidal rule. Now you will derive the composite formula for Simpson's1/3 rule:
- First construct the Newton-Gregory interpolating polynomial P[02](x) containing points [0,1,2]. It approximates function f(x) on Section 1.
- Integrate the polynomial on Section 1: [x0, x2] and simplify the result.
You should obtain I1 = (h/3) · ( f0 + 4 f1 + f2 ).
- Use the formula for I1 on Section 1 as the template to construct the formula for I2 on Section 2, I3 on Section 3, etc.
- Add I1 + I2 + I3 + · · · to obtain the composite Simpson's1/3 rule.