師大
Numerical Integration
Tsung-Ming Huang
Department of Mathematics National Taiwan Normal University, Taiwan
June 7, 2009
T.M. Huang (Nat. Taiwan Normal Univ.) Numerical Integration June 7, 2009 1 / 7
師大
If we choose x0= a, x1= 12(a + b), x2 = b, h = (b − a)/2, and the second order Lagrange polynomial to interpolate f (x), then
Z b a
f (x)dx = Z x2
x0
(x − x1)(x − x2)
(x0− x1)(x0− x2)f (x0) + (x − x0)(x − x2) (x1− x0)(x1− x2)f (x1) + (x − x0)(x − x1)
(x2− x0)(x2− x1)f (x2)
dx +
Z x2
x0
(x − x0)(x − x1)(x − x2)
6 f(3)(ζ(x))dx.
師大
It holds that Z b
a
f (x)dx = h 1
3f (x0) +4
3f (x1) +1 3f (x2)
+ Z x2
x0
(x − x0)(x − x1)(x − x2)
6 f(3)(ζ(x))dx.
It can show that there exists ξ ∈ (a, b) such that Z b
a
f (x) dx = h
3 [f (x0) + 4f (x1) + f (x2)] − f(4)(ξ) 90 h5. This gives theSimpson’s rule formulation.
T.M. Huang (Nat. Taiwan Normal Univ.) Numerical Integration June 7, 2009 3 / 7
師大
To illustrate the procedure, we choose an even integer n and partition the interval [a, b] into n subintervals by nodes a = x0< x1 < · · · < xn= b, and apply Simpson’s rule on each consecutive pair of subintervals. With
h = b − a
n and xj = a + jh, j = 0, 1, . . . , n, we have on each interval [x2j−2, x2j],
Z x2j
x2j−2
f (x) dx = h
3 [f (x2j−2) + 4f (x2j−1) + f (x2j)] − h5
90f(4)(ξj), for some ξj ∈ (x2j−2, x2j), provided that f ∈ C4[a, b].
師大
The composite rule is obtained by summing up over the entire interval, that is,
Z b a
f (x) dx =
n/2
X
j=1
Z x2j
x2j−2
f (x) dx
=
n/2
X
j=1
h
3(f (x2j−2) + 4f (x2j−1) + f (x2j)) − h5
90f(4)(ξj)
= h
3[f (x0) + 4f (x1) + f (x2) +f (x2) + 4f (x3) + f (x4) +f (x4) + 4f (x5) + f (x6)
...
+f (xn−2) + 4f (xn−1) + f (xn)] − h5 90
n/2
X
j=1
f(4)(ξj)
T.M. Huang (Nat. Taiwan Normal Univ.) Numerical Integration June 7, 2009 5 / 7
師大
Hence Z b
a
f (x) dx = h
3[f (x0) + 4f (x1) + 2f (x2) + 4f (x3) + 2f (x4) + 4f (x5) + · · · + 2f (xn−2) + 4f (xn−1) + f (xn)] − h5
90
n/2
X
j=1
f(4)(ξj)
= h
3
f (x0) + 4
n/2
X
j=1
f (x2j−1) + 2
(n/2)−1
X
j=1
f (x2j) + f (xn)
−b − a
180 f(4)(µ)h4, for some µ ∈ (a, b).
師大
Composite Simpson’s Rule
Z b
a
f (x) dx = h 3
f (a) + 4
n/2
X
j=1
f (x2j−1) + 2
(n/2)−1
X
j=1
f (x2j) + f (b)
−b − a
180 f(4)(µ)h4,
where n is an even integer, h = (b − a)/n, xj = a + jh, for j = 0, 1, . . . , n, and some µ ∈ (a, b).
T.M. Huang (Nat. Taiwan Normal Univ.) Numerical Integration June 7, 2009 7 / 7