Professional Documents
Culture Documents
Bmate201 - Module 4
Bmate201 - Module 4
Finite differences, Interpolation using Newton’s forward and backward difference formulae,
Newton’s divided difference formula and Lagrange’s interpolation formula (All formulae
without proof). Problems.
Numerical integration: Trapezoidal, Simpson's (1/3)rd and (3/8)th rules (without proof).
Problems.
Self-study: Bisection method, Lagrange’s inverse interpolation, Weddle’s rule.
𝑓(𝑥) = 𝑥 3 + 𝑥 − 1
𝑓(0) = −1 = −𝑣𝑒, 𝑓(1) = 1 = +𝑣𝑒
A root lies in (0, 1)
𝑓(0.6796) = −0.0065
Conclusion: An approximate root of the given equation is 0.68
𝑓(𝑥) = 𝑥 3 − 3𝑥 + 4
𝑓(−3) = −14 = −𝑣𝑒, 𝑓(−2) = 2 = +𝑣𝑒
A root lies in (−3, −2)
Step 1: 𝑎 = −3 𝑏 = −2
𝑓(𝑎) = −14 𝑓(𝑏) = 2
𝑎𝑓(𝑏)−𝑏𝑓(𝑎) (−3)2−(−2)(−14)
𝑥1 = = = −2.125
𝑓(𝑏)−𝑓(𝑎) 2−(−14)
Step 2: 𝑎 = −3 𝑏 = −2.125
𝑓(𝑎) = −14 𝑓(𝑏) = 0.7792
𝑎𝑓(𝑏)−𝑏𝑓(𝑎) (−3)(0.7792)−(−2.125)(−14)
𝑥2 = = = −2.1711
𝑓(𝑏)−𝑓(𝑎) 0.7792−(−14)
Step 3: 𝑎 = −3 𝑏 = −2.1711
𝑓(𝑎) = −14 𝑓(𝑏) = 0.2794
𝑎𝑓(𝑏)−𝑏𝑓(𝑎) (−3)(0.2794)−(−2.1711)(−14)
𝑥3 = = = −2.1873
𝑓(𝑏)−𝑓(𝑎) 0.2794−(−14)
Step 4:
𝑎 = −3 𝑏 = −2.1873
𝑓(𝑎) = −14 𝑓(𝑏) = 0.0972
𝑎𝑓(𝑏)−𝑏𝑓(𝑎) (−3)(0.0972)−(−2.1873)(−14)
𝑥4 = = = −2.1929
𝑓(𝑏)−𝑓(𝑎) 0.0972−(−14)
𝑓(−2.1929) = 0.0335 .
Conclusion: An approximate root of the given equation is −𝟐. 𝟏𝟗𝟐𝟗
𝑓(𝑥) = 𝑥𝑒 𝑥 − 3
𝑓(1) = −0.2817 = −𝑣𝑒, 𝑓(2) = 11.7781 = +𝑣𝑒
A root lies in (1, 2)
𝑓(1.0460) = −0.0228
Conclusion: An approximate root of the given equation is 𝟏. 𝟎𝟒𝟔𝟎
Step:1 𝑎 = 0, 𝑏 = 1
𝑓(𝑎) = 2, 𝑓(𝑏) = −1.4597
𝑎𝑓(𝑏)−𝑏𝑓(𝑎) 0−2
𝑥1 = = −1.4597−2 = 0.5780
𝑓(𝑏)−𝑓(𝑎)
Step:2 𝑎 = 0.5780, 𝑏 = 1
𝑓(𝑎) = 0.1036, 𝑓(𝑏) = −1.4597
𝑎𝑓(𝑏)−𝑏𝑓(𝑎) (0.5780)(−1.4597)−1(0.1036)
𝑥2 = = = 0.6060
𝑓(𝑏)−𝑓(𝑎) −1.4597−0.1036
Step:3 𝑎 = 0.6060, 𝑏 = 1
𝑓(𝑎) = 0.004 , 𝑓(𝑏) = −1.4597
𝑎𝑓(𝑏)−𝑏𝑓(𝑎) (0.6060)(−1.4597)−(1)(0.004)
𝑥3 = = = 0.6070
𝑓(𝑏)−𝑓(𝑎) −1.4597−0.004
𝑥 4 − 12 = 0, 𝑓(𝑥) = 𝑥 4 − 12
𝑓(1) = −11 = −𝑣𝑒, 𝑓(2) = 4 = +𝑣𝑒.
A root lies in (1, 2)
𝑎𝑓(𝑏)−𝑏𝑓(𝑎) (0.4467)(2.1780)−(1)(−0.2036)
𝑥1 = 𝑓(𝑏)−𝑓(𝑎)
= 2.1780−(−0.2036)
= 0.4940
𝑥 4 − 32 = 0, 𝑓(𝑥) = 𝑥 4 − 32
Step 1
𝑎=2 𝑏=3
𝑓(𝑎) = −16 𝑓(𝑏) = 49
𝑎𝑓(𝑏)−𝑏𝑓(𝑎) (2)(49)−(3)(−16)
𝑥1 = = = 2.2462
𝑓(𝑏)−𝑓(𝑎) 49−(−16)
By diagram,
𝑓(𝑥 )
𝑓 ′ (𝑥𝑖 ) = 𝑥 −𝑥𝑖
𝑖 𝑖+1
On simplification,
𝑓(𝑥 )
𝑥𝑖+1 = 𝑥𝑖 − 𝑓′(𝑥𝑖 )
𝑖
Working rule:
❖ If 𝑓(𝑎) and 𝑓(𝑏) are opposite in sign, then a real root lies in (𝑎, 𝑏).
❖ Choose 𝑥0 = 𝑎 if 𝑓(𝑎) is closer to zero, otherwise choose 𝑥0 = 𝑏.
𝑓(𝑥 )
❖ By Newton’s Raphson method, 𝑥𝑖+1 = 𝑥𝑖 − 𝑓′(𝑥𝑖 )
𝑖
24 −2−10
=2− 4(2)3 −1
= 1.8710
Second iteration:
𝑓(𝑥 )
𝑥2 = 𝑥1 − 𝑓′ (𝑥1 )
1
24 −2−10
= 1.8710 − 4(2)3 −1
= 1.8710 − 0.0749
= 1.8558
Third iteration:
𝑓(𝑥 )
𝑥3 = 𝑥2 − 𝑓′ (𝑥2 )
2
(1.8558)4 −1.8558−10
= 1.8558 − 4(1.8558)3 −1
= 1.8558 − 0
= 1.8558
Conclusion: The real root of the given equation is 1.8558
3𝑥0 −cos 𝑥0 −1
= 𝑥0 − 3+sin 𝑥0
3(1)−cos 1−1
=1− 3+sin 1
= 1 − 0.3800
= 0.6200
Second iteration:
𝑓(𝑥 )
𝑥2 = 𝑥1 − 𝑓′ (𝑥1 )
1
3(0.6200)−cos(0.6200)−1
= 0.6200 − 3+sin(0.6200)
= 0.62 − 0.012
= 0.6071
Third iteration:
𝑓(𝑥 )
𝑥3 = 𝑥2 − 𝑓′ (𝑥2 )
2
3(0.6071)−cos(0.6071)−1
= 0.6071 − 3+sin(0.6071)
= 0.6071 − 0
= 0.6071
Conclusion: The real root of the given equation is 0.6071
1 1
Let 𝑓(𝑥) = 𝑥 log10 𝑥 − 1.2 𝑓 ′ (𝑥) = log 10 (𝑥 𝑥 + log 𝑥)
1
= log 10 (𝑥 log 𝑥) − 1.2 = 0.4343 (1 + log 𝑥)
= 2.5 + 0.2465
= 2.7465
Second iteration:
𝑓(𝑥 )
𝑥2 = 𝑥1 − 𝑓′ (𝑥1 )
1
= 2.7465 − 0.0059
= 2.7406
Third iteration:
𝑓(𝑥 )
𝑥3 = 𝑥2 − 𝑓′ (𝑥2 )
2
= 2.7406 + 0
= 2.7406
Conclusion: The real root of the given equation is 2.7406
First iteration:
𝑓(𝑥 )
𝑥1 = 𝑥0 − 𝑓′ (𝑥0 )
0
𝑥0 𝑒 𝑥0 −2
= 𝑥0 − 𝑥 𝑥 𝑥
0 𝑒 0 +𝑒 0
𝑒−2
=1− 2𝑒
= 0.8679
Second iteration:
𝑓(𝑥 )
𝑥2 = 𝑥1 − 𝑓′ (𝑥1 )
1
0.8679𝑒 0.8679 −2
= 0.8679 −
0.8679𝑒 0.8679 +𝑒 0.8679
= 0.8679 − 0.0151
= 0.8528
Third iteration:
𝑓(𝑥 )
𝑥3 = 𝑥2 − 𝑓′ (𝑥2 )
2
0.8578𝑒 0.8578 −2
= 0.8528 − 0.8578𝑒 0.8578 +𝑒 0.8578
= 0.8528 − 0.0002
= 0.8526
Fourth iteration:
𝑓(𝑥 )
𝑥4 = 𝑥3 − 𝑓′ (𝑥3 )
3
0.8526𝑒 0.8526 −2
= 0.8526 − 0.8578𝑒 0.8526 +𝑒 0.8526
= 0.8526 − 0
= 0.8526
Since 𝑥3 = 𝑥4 , STOP.
Conclusion: The real root of the given equation is 0.8526
𝑥0 tan 𝑥0 +1
= 𝑥0 − 𝑥 2𝑥
𝑜 +𝑥0 tan 0 +tan 𝑥0
𝜋 tan 𝜋+1
=𝜋− 𝜋+𝜋 tan2 𝜋+tan 𝜋
= 𝜋 − 0.3183
= 2.8233
Second iteration:
𝑓(𝑥 )
𝑥2 = 𝑥1 − 𝑓′ (𝑥1 )
1
(2.8233) tan(2.8233)+1
= 2.8233 − 2.8233+(2.8233) tan2(2.8233)+tan(2.8233)
= 2.8233 − 0.0249
= 2.7984
Third iteration:
𝑓(𝑥 )
𝑥3 = 𝑥2 − 𝑓′ (𝑥2 )
2
(2.7984) tan(2.7984)+1
= 2.7984 − 2.7984+(2.7984) tan2(2.7984)+tan(2.7984)
= 2.7984 − 0
= 2.7984
Since 𝑥2 = 𝑥3 , STOP.
Conclusion: The real root of the given equation is 2.7984
First iteration:
𝑓(𝑥 )
𝑥1 = 𝑥0 − 𝑓′ (𝑥0 )
0
𝑥0 sin 𝑥0 +cos 𝑥0
= 𝑥0 − 𝑥𝑜 cos 𝑥0
= 𝜋 − 0.3183
= 2.8233
Second iteration:
𝑓(𝑥 )
𝑥2 = 𝑥1 − 𝑓′ (𝑥1 )
1
2.8233 sin(2.8233)+cos(2.8233)
= 2.8233 − 2.8233 cos(2.8233)
= 2.8233 − 0.0247
= 2.7986
Third iteration:
𝑓(𝑥 )
𝑥3 = 𝑥2 − 𝑓′ (𝑥2 )
2
2.7986 sin(2.7986)+cos(2.7986)
= 2.7986 − 2.7986 cos(2.7986)
= 2.7986 − 0.0002
= 2.7984
Fourth iteration:
𝑓(𝑥 )
𝑥4 = 𝑥3 − 𝑓′ (𝑥3 )
3
2.7984 sin(2.7984)+cos(2.7984)
= 2.7984 − 2.7984 cos(2.7984)
= 2.7984 − 0
= 2.7984
Since 𝑥3 = 𝑥4 , STOP.
Conclusion: The real root of the given equation is 2.7984
Let 𝑥0 = 0.5
𝑓(𝑥 )
By Newton’s Raphson method, 𝑥𝑖+1 = 𝑥𝑖 − 𝑓′(𝑥𝑖 )
𝑖
First iteration:
𝑓(𝑥0 )
𝑥1 = 𝑥0 −
𝑓 ′ (𝑥0 )
cos 𝑥0 − 𝑥0 𝑒 𝑥0
= 𝑥0 −
− sin 𝑥0 − 𝑥0 𝑒 𝑥0 − 𝑒 𝑥0
= 0.5 + 0.0180
= 0.5180
Second iteration:
𝑓(𝑥1 )
𝑥2 = 𝑥1 −
𝑓 ′ (𝑥1 )
= 0.5180 − 0.0002
= 0.5178
Third iteration:
𝑓(𝑥 )
𝑥3 = 𝑥2 − 𝑓′ (𝑥2 )
2
= 0.5178 − 0
= 0.5178
Since 𝑥2 = 𝑥3 , 𝑆𝑇𝑂𝑃.
First iteration:
𝑓(𝑥 )
𝑥1 = 𝑥0 − 𝑓′ (𝑥0 )
0
3
3 − 4(3) − 9
=3−
3(3)2 − 4
= 3 − 0.2609
= 2.7391
Second iteration:
𝑓(𝑥 )
𝑥2 = 𝑥1 − 𝑓′ (𝑥1 )
1
2.73913 − 4(2.7391) − 9
= 2.7391 −
3(2.7391)2 − 4
= 2.7391 − 0.0321
= 2.7070
Third iteration:
𝑓(𝑥 )
𝑥3 = 𝑥2 − 𝑓′ (𝑥2 )
2
2.70703 − 4(2.7070) − 9
= 2.7070 −
3(2.7070)2 − 4
= 2.7070 − 0.0005
= 2.7065
Fourth iteration:
𝑓(𝑥 )
𝑥4 = 𝑥3 − 𝑓′ (𝑥3 )
3
2.70653 − 4(2.7065) − 9
= 2.7065 −
3(2.7065)2 − 4
= 2.7065 − 0
= 2.7065
Conclusion: The real root of the given equation is 2.7065
Difference table:
Difference table:
1.4(1.4−1) 1.4(1.4−1)(1.4−2)
𝑦(52) = 0.7071 + 1.4(0.0589) + (−0.0057) + (−0.0007)
2! 3!
𝒅 80 85 90 95 100
𝑨 5026 5674 6362 7088 7854
Difference table:
Difference table:
0.5(0.5+1) 0.5(0.5+1)(0.5+2)
𝑦(8) = 720 + (0.5)(384) + (168) + (48)
2 6
= 720 + 192 + 63 + 15
= 990
𝒙 𝟎 𝟓 𝟏𝟎 𝟏𝟓 𝟐𝟎 𝟐𝟓
𝒚 𝟕 𝟏𝟏 𝟏𝟒 𝟏𝟖 𝟐𝟒 𝟑𝟐
Step 1
𝑥 = 8 is nearer to the initial value.
𝑥−𝑥0 8−0
Use Newton’s forward interpolation formula. 𝑝 = = = 1.6
ℎ 5
−0.6(−0.6+1) −0.6(−0.6+1)(−0.6+2)(−0.6+3)
𝑦(22) = 32 + (−0.6)(8) + 2
(2) + 0 +
24
(−1)
−0.5(−0.5+1) −0.5(−0.5+1)(−0.5+2)
𝑦(3500) = 116 + (−0.5)(42) + (7) + (2)
2 6
𝑥 (𝐵𝑒𝑙𝑜𝑤) 40 50 60 70 80
𝑦(𝐶𝑢𝑚𝑢𝑙𝑎𝑡𝑖𝑣𝑒) 31 73 124 159 190
𝑦0 𝑦1 𝑦2 𝑦3 𝑦4
𝑥−40 42−40
𝑥 = 42 is in the first half of the given range. 𝑝 = 10 = = 0.2
10
By table, 𝑦0 = 184, Δ𝑦0 = 20, Δ2 𝑦0 = 2, Δ3 𝑦0 = 0
Newton’s forward interpolation formula:
𝑝(𝑝−1) 𝑝(𝑝−1)(𝑝−2)
𝑦(𝑥) = 𝑦0 + 𝑝Δ𝑦0 + Δ2 𝑦0 + Δ3 𝑦0
2! 3!
0.2(0.2−1)
𝑦(8) = 184 + 0.2(20) + (2) + 0
2
Answer: 52.005
9. The following table gives the melting point of an alloy of lead and zinc, where t is the
temperature in Celsius and 𝑝 is the percentage of lead in the alloy:
𝑝 60 70 80 90
𝑡 226 250 276 304
Find the melting point of the alloy containing 84% of lead, using Newton’s
interpolation formula.
Answer: 286.96
10. The following table gives the distances in miles of the visible horizon for the given
heights in feet above the earth’s surface:
𝑥 (Height) 100 150 200 250 300 350 400
𝑦 (𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒) 10.63 13.03 15.04 16.81 18.42 19.90 21.27
Find the values of 𝑦 when (i) 𝑥 = 160 ft, (ii) 𝑥 = 410 ft, using Newton’s interpolation
formula.
10 355
12 1053
6. Using Newton’s divided difference formula, evaluate 𝑓(5.5) from the following data:
𝒙 𝟎 𝟏 𝟒 𝟓 𝟔
𝒇(𝒙) 𝟏 𝟏𝟒 𝟏𝟓 𝟔 𝟑
Answer: 3.09
7. Given 𝑢20 = 24.37, 𝑢22 = 49.28, 𝑢29 = 162.86 and 𝑢32 = 240.5, find 𝑢28 by
Newton’s divided difference formula.
Answer: 141.94
By data,
𝑥0 = 1 𝑥1 = 3 𝑥2 = 4 𝑥3 = 6
𝑦0 = −3 𝑦1 = 9 𝑦2 = 30 𝑦3 = 132
Also 𝑥 = 5.
By Lagrange’s interpolation formula,
(5−3)(5−4)(5−6) (5−1)(5−4)(5−6)
= (1−3)(1−4)(1−6) × (−3) + (3−1)(3−4)(3−6) × 9
(5−1)(5−3)(5−6) (5−1)(5−3)(5−4)
+ × 30 + × 132
(4−1)(4−3)(4−6) (6−1)(6−3)(6−4)
= −0.2 − 6 + 40 + 35.2
= 69
𝒙 𝟎 𝟏` 𝟐 𝟓
𝒚 𝟐 𝟑 𝟏𝟐 𝟏𝟒𝟕
By data, 𝑥0 = 0, 𝑥1 = 1, 𝑥2 = 2, 𝑥3 = 5
and 𝑦0 = 2, 𝑦1 = 3, 𝑦2 = 12, 𝑦3 = 147. Also 𝑥 = 3.
(𝑥−1)(𝑥−2)(𝑥−5) (𝑥−0)(𝑥−2)(𝑥−5)
= (0−1)(0−2)(0−5)
2 + (1−0)(1−2)(1−5) 3
(𝑥−0)(𝑥−1)(𝑥−5) (𝑥−0)(𝑥−1)(𝑥−2)
+ 12 + 147
(2−0)(2−1)(2−5) (5−0)(5−1)(5−2)
𝒙 𝟓 𝟕 𝟏𝟏 𝟏𝟑 17
𝒚 𝟏𝟓𝟎 𝟑𝟗𝟐 𝟏𝟒𝟓𝟐 𝟐𝟑𝟔𝟔 𝟓𝟐𝟎𝟐
(9−7)(9−11)(9−13)(9−17) (9−5)(9−11)(9−13)(9−17)
𝑓(9) = (5−7)(5−11)(5−13)(5−17) (150) + (7−5)(7−11)(7−13)(7−17) (392)
(9−5)(9−7)(9−13)(9−17)
+ (11−5)(11−7)(11−13)(11−17) (1452)
(9−5)(9−7)(9−11)(9−17)
+ (13−5)(13−7)(13−11)(13−17) (2366)
(9−5)(9−7)(9−11)(9−13)
+ (17−5)(17−7)(17−11)(17−13) (5202)
= 810
By data, 𝑥0 = 2, 𝑥1 = 5, 𝑥2 = 8, 𝑥3 = 14,
and 𝑦0 = 94.8, 𝑦1 = 87.9, 𝑦2 = 81.3, 𝑦3 = 68.7. Also 𝑥 = 11.
(11−5)(11−8)(11−14) (11−2)(11−8)(11−14)
𝑓(11) = (94.8) + (87.9)
(2−5)(2−8)(2−14) (5−2)(5−8)(5−14)
(11−2)(11−5)(11−14) (11−2)(11−5)(11−8)
+ (81.3) + (68.7)
(8−2)(8−5)(8−14) (14−2)(14−5)(14−8)
= 74.925
5. Find the value of 𝒇(𝟐) from the following data using Lagrange’s
interpolation formula.
𝒙 𝟏 𝟑 𝟒 𝟔
𝒚 𝟒 𝟒𝟎 𝟖𝟓 𝟐𝟓𝟗
By data, 𝑥0 = 1, 𝑥1 = 3, 𝑥2 = 4, 𝑥3 = 6,
and 𝑦0 = 4, 𝑦1 = 40, 𝑦2 = 85, 𝑦3 = 259. Also 𝑥 = 2.
(2−3)(2−3)(2−6) (2−1)(2−4)(2−6)
𝑓(2) = (1−3)(1−4)(1−6) (4) + (3−1)(3−4)(3−6) (40)
(2−1)(2−3)(2−6) (2−1)(2−3)(2−4)
+ (85) + (259)
(4−1)(4−3)(4−6) (6−1)(6−3)(6−4)
= 15
By data, 𝑥0 = 0, 𝑥1 = 1, 𝑥2 = 2, 𝑥3 = 3, 𝑥4 = 4
And 𝑦0 = 3, 𝑦1 = 6, 𝑦2 = 11, 𝑦3 = 18, 𝑦4 = 27.
(𝑥−1)(𝑥−2)(𝑥−3)(𝑥−4) (𝑥−0)(𝑥−2)(𝑥−3)(𝑥−4)
𝑓(𝑥) = (3) + (6)
(0−1)(0−2)(0−3)(0−4) (1−0)(1−2)(1−3)(1−4)
(𝑥−0)(𝑥−1)(𝑥−3)(𝑥−4) (𝑥−0)(𝑥−1)(𝑥−2)(𝑥−4)
+ (11) + (18)
(2−0)(2−1)(2−3)(2−4) (3−0)(3−1)(3−2)(3−4)
(𝑥−0)(𝑥−1)(𝑥−2)(𝑥−3)
+ (27)
(4−0)(4−1)(4−2)(4−3)
= 𝑥 2 + 2𝑥 + 3
Home work:
7. Using Lagrange’s formula find 𝑓(10) from the following data:
𝑥 5 6 9 11
𝑓(𝑥) 12 13 14 16
8. Using Lagrange’s interpolation formula, find a polynomial which passes
through the points (0, −12), (1, 0), (3, 6), (4, 12).
9. Using Lagrange’s interpolation formula, fit a polynomial which passes
through the points (−1, 0), (1, 2), (2, 9), (3, 8) and hence estimate the
value of 𝑦 when 𝑥 = 2.2 (MQP 1)
𝟕𝟏
1. Evaluate ∫𝟐 𝒙 𝒅𝒙 using Trapezoidal rule by taking 5 equal sub intervals
7−2
By data, = 1.
5
𝑥 2 3 4 5 6 7
𝑦 1/2 1/3 1/4 1/5 1/6 1/7
By Trapezoidal rule,
𝑏 ℎ
∫𝑎 𝑓(𝑥) 𝑑𝑥 = 2 [𝑦0 + 2(𝑦1 + 𝑦2 + ⋯ + 𝑦𝑛−1 ) + 𝑦𝑛 ]
7 1 1 1 1 1 1 1
∫2 𝑓(𝑥) 𝑑𝑥 = 2 [2 + 2 (3 + 4 + 5 + 6) + 7] = 1.2714
𝑏−𝑎 2−0 2 1
By data, ℎ = = =6=3.
𝑛 6
By Trapezoidal rule,
𝑏 ℎ
∫𝑎 𝑓(𝑥) 𝑑𝑥 = 2 [𝑦0 + 2(𝑦1 + 𝑦2 + ⋯ + 𝑦𝑛−1 ) + 𝑦𝑛 ]
1
2 1 3
∫0 𝑑𝑥 = [0.0625 + 2(0.0608 + 0.0588 + 0.0562 + 0.0532) + 0.05]
16+𝑥 2 2
= 0.1158
𝟐.𝟐
3. Evaluate ∫𝟏.𝟒 𝒚 𝒅𝒙 using Trapezoidal rule for the data
𝒙 𝟏. 𝟒 𝟏. 𝟔 𝟏. 𝟖 𝟐. 𝟎 𝟐. 𝟐
𝒇(𝒙) 𝟒. 𝟎𝟓𝟓𝟐 𝟒. 𝟗𝟓𝟑𝟎 𝟔. 𝟎𝟒𝟑𝟔 𝟕. 𝟑𝟖𝟗𝟏 𝟗. 𝟎𝟐𝟓𝟎
By Trapezoidal rule,
𝑏 ℎ
∫𝑎 𝑓(𝑥) 𝑑𝑥 = 2 [𝑦0 + 2(𝑦1 + 𝑦2 + ⋯ + 𝑦𝑛−1 ) + 𝑦𝑛 ]
2.2 0.2
∫1.4 𝑦 𝑑𝑥 = [4.0552 + 2(4.9530 + 6.0436 + 7.3891 + 0.0532) + 9.0250]
2
= 4.9852
1 𝑏−𝑎 6−0
𝑓(𝑥) = 1+𝑥 2 , 𝑎 = 0, 𝑏 = 6, 𝑛 = 6, ℎ = = =1
𝑛 6
𝑥 0 1 2 3 4 5 6
𝑦 = 1/(1 + 𝑥 2 ) 1 0.5 0.2 0.1 0.0588 0.0385 0.0270
Actual value
6 1
∫0 𝑑𝑥 = [𝑡𝑎𝑛−1 𝑥]60 = 𝑡𝑎𝑛−1 6 − 𝑡𝑎𝑛−1 0 = 1.4056
1+𝑥 2
1
𝑓(𝑥) = 1+𝑥 2 , 𝑎 = 0, 𝑏 = 1, 𝑛 = 6
𝑏−𝑎 1−0 1
ℎ= = =6
𝑛 6
1/2
= [(1 + 0.5) + 3(0.9730 + 0.9 + 0.6923 + 0.5902) + 2(0.8)] = 0.7854
8
Actual value
1 1 𝜋
∫0 𝑑𝑥 = [𝑡𝑎𝑛−1 𝑥]10 = 𝑡𝑎𝑛−1 1 − 𝑡𝑎𝑛−1 0 = = 0.7854
1+𝑥 2 4
1
𝑓(𝑥) = 1+𝑥 , 𝑎 = 0, 𝑏 = 1, 𝑛 = 6
𝑏−𝑎 1−0 1
ℎ= = =6
𝑛 6
= 0.6932
Simpson’s three eighth rule
1 1 3ℎ
∫0 𝑑𝑥 = [(𝑦0 + 𝑦6 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 ) + 2(𝑦3 )]
1+𝑥 8
1
2
= [(1 + 0.5) + 3(0.8571 + 0.75 + 0.6 + 0.5455) + 2(0.6667)]
8
= 0.6932
Actual value
1 1
∫0 𝑑𝑥 = [log(1 + 𝑥)]10
1+𝑥
= log 2
= 0.6932
𝑏−𝑎 5.2−4
ℎ= = = 0.2
𝑛 6
2(0.4816 + 1.5686)]
= 1.8279
Simpson’s three eighth rule
5.2 3ℎ
∫4 log e 𝑥 𝑑𝑥 = [(𝑦0 + 𝑦6 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 ) + 2(𝑦3 )]
8
0.2
= [(1.3863 + 1.6487) + 3(0.4351 + 0.4816 + 1.5686 + 1.6094) +
8
2(1.5261)]
= 1.8278
Actual value
5.2
∫4 log e 𝑥 𝑑𝑥 = [𝑥 log 𝑥 − 𝑥]5.2
4 = 3.3730 − 1.5452 = 1.8278
2
𝑓(𝑥) = 𝑒 −𝑥 , 𝑎 = 0, 𝑏 = 0.6, 𝑛 = 6
𝑏−𝑎 0.6−0
ℎ= = = 0.1
𝑛 6
= 0.5351
Simpson’s three eighth rule
0.6 2 3ℎ
∫0 𝑒 −𝑥 𝑑𝑥 = 8
[(𝑦0 + 𝑦6 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 ) + 2(𝑦3 )]
3(0.1)
= [(1 + 0.6977) + 3(0.99 + 0.9608 + 0.8521 + 0.7788) + 2(0.9139)]
8
= 0.5351
1
𝑓(𝑥) = 4𝑥+5 , 𝑎 = 0, 𝑏 = 5, 𝑛 = 10
𝑏−𝑎 5−0
ℎ= = = 0.5
𝑛 10
𝑥 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
1
𝑦= 0.2 0.1429 0.1111 0.0909 0.0769 0.0667 0.0588 0.0526 0.0476 0.0435 0.04
4𝑥 + 5
𝑦0 𝑦1 𝑦2 𝑦3 𝑦4 𝑦5 𝑦6 𝑦7 𝑦8 𝑦9 𝑦10
= 0.4025
Therefore, 𝑙𝑜𝑔 5 = 1.610
𝑏−𝑎 0.3−0
ℎ= = = 0.1
𝑛 3
= 0.2916
Home work
𝟏.𝟒
11. Evaluate ∫𝟎.𝟐 (𝐬𝐢𝐧 𝒙 − 𝐥𝐨𝐠 𝒙 + 𝒆𝒙 ) 𝒅𝒙 by taking seven ordinates using (i)
Simpson’s 1/3 rule, (ii) Simpson’s 3/8 rule
Answer: 1.1873