Graphics Programs Reference
In-Depth Information
Trapezoidal Rule
E
f
(
x
)
Figure 6.2.
Trapezoidal rule.
Area =
I
h
x
x = a
x = b
1
2
If
n
=
2 , wehave
=
(
x
−
x
2
)
/
(
x
1
−
x
2
)
=−
(
x
−
b
)
/
h
. Therefore,
1
b
1
h
1
2
h
(
b
h
2
a
)
2
A
1
=−
(
x
−
b
)
dx
=
−
=
a
Also
2
=
(
x
−
x
1
)
/
(
x
2
−
x
1
)
=
(
x
−
a
)
/
h
,sothat
b
1
h
1
2
h
(
b
h
2
a
)
2
A
2
=
(
x
−
a
)
dx
=
−
=
a
SubstitutioninEq. (6.2a) yields
f
(
b
)]
h
2
=
+
I
[
f
(
a
)
(6.3)
which isknownas the
trapezoidal rule
. It represents the area of the trapezoid inFig. 6.2.
The errorinthe trapezoidal rule
b
E
=
f
(
x
)
dx
−
I
a
is the area of the regionbetween
f
(
x
) and the straight-line interpolant, as indicated
in Fig. 6.2. It can beobtainedbyintegrating the interpolation errorinEq. (4.3):
b
)
b
a
1
2!
1
2
f
(
x
2
)
f
(
E
=
(
x
−
x
1
)(
x
−
ξ
)
dx
=
ξ
(
x
−
a
)(
x
−
b
)
dx
a
h
3
12
f
(
1
12
(
b
a
)
3
f
(
=−
−
ξ
)
=−
ξ
)
(6.4)
Composite Trapezoidal Rule
f
(
x
)
I
i
Figure 6.3.
Composite trapezoidal rule.
h
x
x
1
x
2
x
i
x
i
+
1
x
n
-1
x
n
a
b
Search WWH ::
Custom Search