Error analysis for numerical integrations

It is possible to estimate numerical errors for each scheme.

Rectangular rule

The rectangular rule is to approximate ∫at f(x)dx by a rectangle with f(t) as the height and ta (=h) as the base.
The error is then defined as

ϵ(t) = (ta) f(t) −
t

a 
f(x) dx.
(1)
To see how this function behaves, take the derivative as
ϵ′(t)
=
f(t) + (ta) f′(t) −f(t)
(2)
=
f′(t) (ta)
(3)
 ∼ 
f′(ξ) (ta),
(4)
where ξ is some constant value assuming that f′(t) does not fluctuate much between a and t. By integrating eq.(4) with respect to t, one obtains

ϵ(t)
 ∼ 
f′(ξ)

2
(ta)2
(5)
=
f′(ξ)

2
h2,
(6)
where h = (ta).
When adding up eq.(6) over a finite interval of (a,b) for n times, the total error is

ϵtotal
 ∼ 
n h2 f′(ξ)

2
(7)
=
(ba) f′(ξ)

2
h,
(8)
where ba = nh was used in eq.(8). Equation (8) implies that when the rectangular rule is used to approximate

b

a 
f(x) dx,
the error involved is in the order of
ϵtotal  ∼ A h,
(9)
where A is a constant and h is the step size. In other words, to get 10−5 accuracy for ba=1, one would need n = (ba)/h  ∼ 105 partitions over the interval.

Trapezoidal Rule

The error involved in the trapezoidal rule is given

ϵ(t) =
f(t)+f(a)

2

(ta) −
t

a 
f(x) dx.
(10)
Take the derivative of eq.(10) as
ϵ′(t) = f′(t)

2
(ta) + f(t)+f(a)

2
f(t),
(11)
which does not yield much insight. Try taking another derivative of eq.(11) as

ϵ"(t)
=
f"(t)

2
(ta) + f′(t)

2
+ f′(t)

2
f′(t)
(12)
 ∼ 
f"(ξ)

2
(ta).
(13)
Integrating eq.(13) yields

ϵ′(t)  ∼  f"(ξ)

4
(ta)2.
(14)
Integrating eq.(14) again yields

ϵ(t)
 ∼ 
f"(ξ)

12
(ta)3
(15)
=
f"(ξ)

12
h3.
(16)
By adding up eq.(16) over the interval of (a,b), one obtains

ϵtotal
 ∼ 
n h3 f"(ξ)

12
(17)
=
(ba) f"(ξ)

12
h2
(18)
 ∼ 
A h2,
(19)
where A is a constant. This conclusion implies that one needs √{105}  ∼ 220 partitions to obtain 10−5 accuracy.

Simpson's Rule

From the result of error analysis of the trapezoidal rule, it was found that

I  ∼ Tn + A h2,
(20)
where I is the true value, Tn is the approximation by the trapezoidal rule, h is the step size and n is the number of partitions. If one makes the stepsize h one-half, eq.(20) becomes

I  ∼ T2n + A
h

2

2

 
,
(21)
or

I
 ∼ 
Tn + A h2
(22)
4I
 ∼ 
4 T2n + A h2
(23)
from which it follows

I  ∼  4T2nTn

3
+ (higher order terms than h2).
(24)
Actual computation of eq.(24) is
I
 ∼ 
1

3

4 h

4
(f0 +2 f1 + 2 f2 +…+2 f2n−1 + f2n)− h

2
(f0 + 2f2 + 2f4 + …+ f2n)
(25)
=
h

6
(f0 + 4f1 + 2f2 + 4 f3 + 2 f4 + …+2 f2n−2 + 4f2n−1 + f2n).
(26)
Equation(26) is called the Simpson rule as you already figured out.



File translated from TEX by TTH, version 4.03.
On 26 Mar 2024, 12:38.