Graphics Programs Reference
In-Depth Information
Solution
Referring to Fig. 6.4, we see that Simpson's 1/3rule uses three nodes located
at
x
1
=
a
,
x
2
=
(
a
+
b
)
/
2 and
x
3
=
b
. The spacing of the nodes is
h
=
(
b
−
a
)
/
2. The
cardinalfunctionsofLagrange'sthree-point interpolationare (see Art. 3.2)
(
x
−
x
2
)(
x
−
x
3
)
(
x
−
x
1
)(
x
−
x
3
)
1
(
x
)
=
2
(
x
)
=
(
x
1
−
x
2
)(
x
1
−
x
3
)
(
x
2
−
x
1
)(
x
2
−
x
3
)
(
x
−
x
1
)(
x
−
x
2
)
3
(
x
)
=
x
2
)
The integration of these functions iseasierif we introduce the variable
(
x
3
−
x
1
)(
x
3
−
ξ
with origin
at
x
2
. Then the coordinates of the nodes are
ξ
1
=−
h
,
ξ
2
=
0,
ξ
3
=
h
and Eq. (6.2b)
becomes
A
i
=
b
a
=
h
−
i
(
x
)
dx
i
(
ξ
)
d
ξ
. Therefore,
h
h
2
h
2
h
(
ξ
−
0)(
ξ
−
h
)
1
h
3
2
A
1
=
d
ξ
=
(
ξ
−
h
ξ
)
d
ξ
=
(
−
h
)(
−
2
h
)
−
h
−
h
h
h
2
h
−
(
ξ
+
h
)(
ξ
−
h
)
1
4
h
3
2
h
2
)
d
A
2
=
d
ξ
=−
(
ξ
−
ξ
=
(
h
)(
−
h
)
−
h
h
h
2
h
2
h
(
ξ
+
h
)(
ξ
−
0)
1
h
3
2
A
3
=
d
ξ
=
(
ξ
+
h
ξ
)
d
ξ
=
(2
h
)(
h
)
−
h
−
h
Equation (6.2a) thenyields
f
(
a
)
4
f
a
f
(
b
)
h
3
3
+
b
=
=
+
+
I
A
i
f
(
x
i
)
2
i
=
1
which is Simpson's 1
/
3rule.
EXAMPLE 6.2
Evaluate the boundson
0
sin(
x
)
dx
with the composite trapezoidal rule using (1)
eight panels and (2)sixteen panels.
Solution of Part (1)
With 8 panels there are 9nodes spacedat
h
=
π/
8. The abscissas
of the nodes are
x
i
=
(
i
−
1)
π/
8,
i
=
1
,
2
,...,
9. FromEq. (6.5) we get
sin 0
8
sin
i
8
16
=
I
=
+
2
+
sin
π
1
.
97423
i
=
2
The erroris givenbyEq. (6.6):
(
b
−
a
)
h
2
12
(
π
−
0)(
π/
8)
2
3
768
sin
π
f
(
E
=−
ξ
)
=−
(
−
sin
ξ
)
=
ξ
12
where0
<ξ<π
.Since we do not know the valueof
ξ
, wecannot evaluate
E
, but we
can determine its bounds:
3
768
sin(0)
3
π
768
sin
2
=
π
E
min
=
=
0
E
max
=
0
.
040 37
Search WWH ::
Custom Search