Professional Documents
Culture Documents
Error Bounds
Error Bounds
ERROR FORMULA
0 −2x 00 −2 + 6x2
f (x) = ³ ´2 , f (x) = ³ ´3
1 + x2 1 + x2
From a graph of f 00(x),
¯ ¯
¯ 00 ¯
max ¯f (x)¯ = 2
0≤x≤2
Recall that b − a = 2. Therefore,
h2 (b − a)
EnT (f ) = − f 00 (cn)
12
¯ ¯ h2 (2) h2
¯ T ¯
¯En (f )¯ ≤ ·2=
12 3
T h2 (b − a) 00
En (f ) = − f (cn)
12
¯ ¯ h22 h2
¯ T ¯
¯En (f )¯ ≤ ·2=
12 3
¯ 00 ¯
We bound f (cn)¯ since we do not know cn, and
¯
therefore we must assume the worst possible case, that
which makes the error formula largest. That is what
has been done above.
When do we have
¯ ¯
¯ T ¯
¯En (f )¯ ≤ 5 × 10−6 (1)
To ensure this, we choose h so small that
h2
≤ 5 × 10−6
3
This is equivalent to choosing h and n to satisfy
h ≤ .003873
2
n= ≥ 516.4
h
Thus n ≥ 517 will imply (1).
DERIVING THE ERROR FORMULA
T h3 00 h3 00
En (f ) = − f (γ 1) − · · · − f (γ n)
12 12
This formula can be further simplified, and we will do
so in two ways.
Rewrite this error as
" #
3 00 00
h n f (γ 1) + · · · + f (γ n)
EnT (f ) = −
12 n
Denote the quantity inside the brackets by ζ n. This
number satisfies
f 00(cn) = ζ n
Recall also that hn = b − a. Then
" #
3 00 00
h n f (γ 1) + · · · + f (γ n)
EnT (f ) = −
12 n
h2 (b − a) 00
= − f (cn)
12
This is the error formula given on the first slide.
AN ERROR ESTIMATE
T h2 h 00 00
i
En (f ) = − f (γ 1)h + · · · + f (γ n)h
12
The quantity
T h2 h 00 00
i
En (f ) = − f (γ 1)h + · · · + f (γ n)h
12
we have
T h2 h 0 0
i
e T (f )
En (f ) ≈ − f (b) − f (a) ≡ En
12
This is a computable estimate of the error in the nu-
merical integration. It is called an asymptotic error
estimate.
Example. Consider evaluating
Z π
x eπ + 1 .
I(f ) = e cos x dx = − = −12.070346
0 2
In this case,
f 0(x) = ex [cos x − sin x]
f 00(x) = −2ex sin x
¯ ¯ ¯ ¯
max ¯f 00(x)¯ = ¯f 00 (.75π)¯ = 14. 921
0≤x≤π
Then
h 2 (b − a)
EnT (f ) = − f 00 (cn)
12
¯ ¯ h2π
¯ T ¯
¯En (f )¯ ≤ · 14.921 = 3.906h2
12
Also
h2£ ¤
e T
En (f ) = − 0 0
f (π) − f (0)
12
h2 π .
= [e + 1] = 2.012h2
12
In looking at the table (in a separate file on website)
for evaluating the integral I by the trapezoidal rule,
we see that the error EnT (f ) and the error estimate
Ee T (f ) are quite close. Therefore
n
h2 π
I(f ) − Tn(f ) ≈ [e + 1]
12
h2 π
I(f ) ≈ Tn(f ) + [e + 1]
12
This last formula is called the corrected trapezoidal
rule, and it is illustrated in the second table (on the
separate page). We see it gives a much smaller er-
ror for essentially the same amount of work; and it
converges much more rapidly.
In general,
h2 £ 0 ¤
I(f ) − Tn(f ) ≈ − f (b) − f 0(a)
12
h2 £ 0 ¤
I(f ) ≈ Tn(f ) − f (b) − f 0(a)
12
This is the corrected trapezoidal rule. It is easy to
obtain from the trapezoidal rule, and in most cases,
it converges more rapidly than the trapezoidal rule.
SIMPSON’S RULE ERROR FORMULA
T h2 h 0 0
i
e T (f )
En (f ) ≈ − f (b) − f (a) ≡ En
12
EXAMPLE
Consider evaluating
Z 2
dx
I=
0 1 + x2
using Simpson’s rule Sn(f ). How large should n be
chosen in order to ensure that
¯ ¯
¯ S ¯
¯En (f )¯ ≤ 5 × 10−6
4h4
≤ 5 × 10−6
15
h ≤ .0658
n ≥ 30.39
Therefore, choosing n ≥ 32 will give the desired er-
ror bound. Compare this with the earlier trapezoidal
example in which n ≥ 517 was needed.
000 x2 − 1
f (x) = −24x ³ ´4
1+x 2
h 4 £ ¤
e S
En (f ) ≡ − 000 000
f (2) − f (0)
180
h4 144 4 4
= · = h
180 625 3125
INTEGRATING sqrt(x)
To estimate p, we use
I2n − In
≈ 2p
I4n − I2n
To see this, write
I2n − In (I − In) − (I − I2n)
=
I4n − I2n (I − I2n) − (I − I4n)
Then substitute from the following and simplify:
c
I − In ≈ p
n
c
I − I2n ≈ p p
2 n
c
I − I4n ≈ p p
4 n
Example. Consider the following table of numerical
integrals. What is its order of convergence?
n In In − I 1 n Ratio
2
2 .28451779686
4 .28559254576 1.075E − 3
8 .28570248748 1.099E − 4 9.78
16 .28571317731 1.069E − 5 10.28
32 .28571418363 1.006E − 6 10.62
64 .28571427643 9.280E − 8 10.84
It appears
. .
2p = 10.84, p = log2 10.84 = 3.44
We could now combine this with Richardson’s error
formula to estimate the error:
· ¸
1
I − In ≈ p In − I 1 n
2 −1 2
For example,
1
I − I64 ≈ [9.280E − 8] = 9.43E − 9
9.84
PERIODIC FUNCTIONS