Approximate Integration and Simpson`s Rule

advertisement
Approximate Integration and Simpson’s Rule
To approximate
Z b
f (x) dx,
a
b−a
.
n
The subdivision points are x0 = a, x1 = a + h, . . . , x j = a + jh, . . . , xn = b with values y j = f (x j ).
let [a, b] be subdivided into n subintervals each of length hn =
1. Trapezoid Rule
R0,n = Tn = hn
1
1
y0 + y1 + y2 + · · · + yn−1 + yn
2
2
This is obtained by repeating the area of the trapezoid (degree 1 polynomial) approximation hn
successive subintervals. It is an exact approximation for linear f (x) (degree 1 polynomials).
1
1
2 y0 + 2 y1
over
2. Simpson’s Rule
R 1,n = Sn = hn
1
4
2
4
2
4
1
y0 + y1 + y2 + y3 + · · · + yn−2 + yn−1 + yn , where n is even.
3
3
3
3
3
3
3
This is obtained by repeating the area of the quadratic (degree 2 polynomials) approximation hn 13 y0 + 43 y1 + 13 y2
over successive pairs of subintervals. It is an exact approximation for cubics (degree 3 polynomials).
Note
2
1
4
4
2
Sn = hn
y0 + y1 + y2 + · · · − h n
y0 +
y2 + · · ·
3
3
3
3
3
4
1
1
1
= hn
y0 + y1 + y2 + · · · − (2hn )
y0 + y2 + · · ·
3
2
3
2
n
4T
−
T
n
1
4
2
.
= Tn − T 2n =
3
3
3
3. Improvements
R2,n = Bn , Boole’s Rule, is obtained using the area of a quartic (degree 4 polynomial) approximation, is an exact
approximation for quintics (degree 5 polynomials), requires n to be a multiple of 4, and uses the coefficients:
14
,
45
64 24 64
, , ,
45 45 45
28
,
45
64 24 64
, , ,
45 45 45
One can show
R2,n =
28
,
45
16Sn − S 2n
...,
28
,
45
64 24 64
, , ,
45 45 45
14
.
45
.
15
The pattern can be used to define the Richardson’s extrapolates (used in Romberg Integration by taking m → ∞, with
n = 2m ):
4m Rm−1,n − Rm−1, 2n
Rm,n =
.
4m − 1
Page 2 of 2
4. Derivation of Simpson’s Rule via Interpolating Polynomials
f(x)
g(x), an interpolating polynomial
r
q
p
The Lagrange interpolating polynomial which is a polynomial that passes through the same points as f at x = p, x = q
and x = r is
(x − q)(x − r)
(x − p)(x − r)
(x − p)(x − q)
g(x) =
f (p) +
f (q) +
f (r).
(p − q)(p − r)
(q − p)(q − r)
(r − p)(r − q)
Z r
f (x) dx is approximately
p
Z r
g(x) dx =
Z r
(x − q)(x − r)
p
p
(p − q)(p − r)
dx · f (p) +
Z r
(x − p)(x − r)
p
(q − p)(q − r)
dx · f (q) +
Z r
(x − p)(x − q)
p
(r − p)(r − q)
dx · f (r).
In Simpson’s rule we are interested in the case that q − p = r − q = h, that is, q = p + h and r = p + 2h. We show the
x − q 2hu + p − q
x− p x− p
=
so 2hu + p = x. Then 2h du = dx and
=
=
last integral is 1/3. Use substitution u =
r− p
2h
r−q
r−q
2hu − h
= 2u − 1. The last integral becomes
h
1
3
Z 1
Z 1
4
1
u
2 2
−1 = h .
4u − 2u du = h 4 − u = h
u(2u − 1)2h du = h
3
3
3
u=0
u=0
0
By similar computations we could get the other two integrals, but there is an easier way. By symmetry the first one is
also h 31 . The case f (p) = f (q) = f (r) shows the three integrals must add to 2h so the middle one is h 43 .
5. Derivation of Simpson’s Rule by attempting to cancel errors
Consider f (x) = x2 . On the one hand
1
R1 2
x3 1
x
dx
=
0
3 = 3 . On the other hand the Trapezoid approximation is
0
1 12
1 1
1 2
1 1 02 12
1n
n2 1 n2
2
2
=
=
1
+
·
·
·
+
n
−
+
+
·
·
·
+
+
·
·
·
+
−
n
n 2 n2 n2
2 n2
n n2
n2 2 n2
n n2
2
1
n(n
+
1)(2n
+
1)
1
1
sum
− n2
=
n n2
6
2
1
1
1
1
= 2 (n + 1)(2n + 1) − 3n2 = 2 2n2 + 1 = + 2
6n
6n
3 6n
Tn =
2
1
1
1
1
= +4 2.
+
3 6(n/2)2 3
6n
We want to average Tn = 31 + E and T 2n = 31 + 4E to cancel or reduce the term E which appears, where E = 6n12 . Since
4Tn − T 2n = 1 we see 43 Tn − 13 T n2 gives the exact value of 13 for the integral. This expression, which is Sn , is a better
approximation than the Trapezoid rule in this case.
Similarly T 2n =
Download