Information Technology Reference
In-Depth Information
1
0.8
0.6
0.4
0.2
0
−0.2
−0.4
−0.6
−0.8
−1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Fig. 1.5
The figure shows how f.x/
D
sin.2x/ graphed on the unit interval can be approxi-
D
mated by linear functions over n
10 subintervals
Example 1.3. We return again to the problem studied in the examples above, i.e.,
we want to compute numerical approximations of
Z 1:5
sin.x/ dx:
(1.17)
1
In the composite trapezoidal rule, we set a D 1; b D 1:5 and n D 100.Thisgives
b a
n
0:5
100
h D
D
D 0:005;
and then, by (1.16), we get
Z b
f.x/dx 0:469564;
a
which should be compared with the exact solution given by
Z 1:5
f.x/dx D Œcos.x/ 1:5
1
D .cos.1:5/ cos.1// 0:469565:
1
The relative error is now
0:469565 0:469564
0:469565
100% D 0:0002% :
 
Search WWH ::




Custom Search