574 Chapter 20Numerical methods
The area of the trapezium betweenx
jandx
j+ 1is(f
j1 + 1 f
j+ 1)h 22 , and the total area is
(20.32)
wheref
j1 = 1 f(a 1 + 1 jh).
For an integrand that is continuous and differentiable in the intervala 1 ≤ 1 x 1 ≤ 1 b, it
can be shown that the error in this formula is
(20.33)
wheref′′(c)is the second derivative of the function at some pointx 1 = 1 cin the interval.
Alternatively, when his small enough, the error can be approximated as (see the
Euler–MacLaurin formula (20.39) below)
(20.34)
wheref
0′andf
n′are the derivatives off(x)at the end points. It follows that halving
h(or doubling the number of subintervals n) reduces the error by a factor of four.
EXAMPLE 20.10Find estimates of the integral by means of the
trapezoidal rule (20.32) and the error formula (20.34) forn 1 = 1 3, 6and 12.
The required values of the integrandf(x) 1 = 1 xe
−x2are listed in the following table.
Table 20.7 Values off(x) 1 = 1 xe
−
x2x 0.0 0.1 0.2 0.3 0.4 0.5 0.6
f(x) 0.000000 0.099005 0.192158 0.274179 0.340858 0.389400 0.418606
x 0.7 0.8 0.9 1.0 1.1 1.2
f(x) 0.428838 0.421834 0.400372 0.367879 0.328017 0.284313
Then, for example, forn 1 = 13 we have
h 1 = 1 0.4, f
01 = 1 0, f
11 = 1 0.340858, f
21 = 1 0.421834, f
31 = 1 0.284313
and
T(h) 1 = 1 0.4[0 1 + 1 0.340858 1 + 1 0.421834 1 +× 1 0.284313] 1 = 1 0.361939
12Ixedx
x=
−Z
012. 2ε≈− ′− ′
1
12
20hf f
nZ
abfxdx Th
ba
() −==−() hf c()
−
ε ′′
12
2Z
abnnfxdx Th h f f f() ≈= +++++() f f
−1
2
1
2
012 1