You are on page 1of 2

2) Simpson’s Integral Rule:

To improve 𝑇1 𝑓 we obtain:


𝑠𝑛 𝑓 = 𝑓 𝑥0 + 4𝑓 𝑥1 + 2𝑓 𝑥2 + ⋯ + 2𝑓 𝑥𝑛−2 + 4𝑓 𝑥𝑛−1 + 𝑓 𝑥𝑛
3
Example :
4 𝑑𝑥
Calculate 𝑠𝑛 𝑓 and the error for different value of n for the integral 𝐼 = 0 1+𝑥 2
; 𝑛 = (2,4,16, 32,64,128)


Solution: 𝑠𝑛 𝑓 = 3 𝑓 𝑥0 + 4𝑓 𝑥1 + 2𝑓 𝑥2 + ⋯ + 2𝑓 𝑥𝑛−2 + 4𝑓 𝑥𝑛−1 + 𝑓 𝑥𝑛

4 𝑑𝑥 4
The true solution: 𝐼 = 0 1+𝑥 2
= tan−1 𝑥
0
= tan−1 (4) − tan−1 (0) = 1.325817664
𝑏−𝑎 4−0
n = 2; ℎ= = = 2; 𝑥𝑖+1 = 𝑥𝑖 + ℎ
𝑛 2

2
𝑠2 𝑓 = 𝑓 𝑥0 + 4𝑓 𝑥1 + 𝑓 𝑥2
3
2
𝑠2 𝑓 = 𝑓 0 + 4𝑓 2 + 𝑓 4
3
2 1 1
𝑆2 𝑓 = 1+4 + = 1.23921569
3 5 17

Actual error = I - 𝑆2 𝑓 = 0.08660197


𝑏−𝑎 4−0
n = 4; ℎ= = =1
𝑛 4

1
𝑆4 𝑓 = 𝑓 𝑥0 + 4𝑓 𝑥1 + 2𝑓 𝑥2 + 4𝑓 𝑥3 + 𝑓 𝑥4
3
1 n Actual error
𝑆4 𝑓 = 𝑓 0 + 4𝑓 1 + 2𝑓 2 + 4𝑓 3 + 𝑓 4
3
2 0.86 ∗ 10−1
1 1 1 1 1 4 0.39 ∗ 10−1
𝑆4 𝑓 = 1 + 4 +2 +4 + = 1.28627451
3 2 5 10 17 16 4.02 ∗ 10−6
Actual error = I - 𝑆2 𝑓 = 0.039543154 32 2.33 ∗ 10−8
64 1.46 ∗ 10−9
128 9.15 ∗ 10−11

You might also like