Ch4 Num
Ch4 Num
CH:4
Mech. power
0
Numerical
∫
Formulas
1
2
𝐸𝑆𝑖𝑚𝑝𝑠𝑜𝑛
b−a
Simpson
𝒃 (𝒃 − 𝒂)
(𝒇(𝒂) + 𝟒𝒇 (
𝒃+𝒂
)
𝒃
𝒉
(𝒇 + 𝟒(𝒇𝟏 + 𝒇𝟑 ⋯ + 𝒇𝒏−𝟏 ) + 𝟐(𝒇𝟐 + 𝒇𝟒 ⋯ + 𝒇𝒏−𝟐 ) + 𝒇𝒏 )
≈ ℎ4 max |𝑓 ′′′′ (𝑥)|
∫ 𝒇(𝒙)𝒅𝒙 ≈ ∫ 𝒇(𝒙)𝒅𝒙 ≈ 180 𝑎≤ 𝑥≤ 𝑏
𝒂 𝟔 𝟐 𝒂 𝟑 𝟎
+ 𝒇(𝒃))
Trapezoidal
1
Etrapezodial = 𝐸𝑚𝑖𝑑𝑝𝑜𝑖𝑛𝑡
𝒃
𝒇(𝒂) + 𝒇(𝒃) 𝒃
𝒉 2
∫ 𝒇(𝒙)𝒅𝒙 ≈ (𝒃 − 𝒂) ∫ 𝒇(𝒙)𝒅𝒙 ≈ (𝒇 + 𝟐(𝒇𝟏 + 𝒇𝟐 ⋯ + 𝒇𝒏−𝟏 ) + 𝒇𝒏 ) =
𝒂 𝟐 𝒂 𝟐 𝟎
𝐸𝑚𝑖𝑑𝑝𝑜𝑖𝑛𝑡
Mid-point
𝒃
𝒃+𝒂 𝒃 b−a
∫ 𝒇(𝒙)𝒅𝒙 ≈ (𝒃 − 𝒂)𝒇 ( ) ∫ 𝒇(𝒙)𝒅𝒙 ≈ 𝟐𝒉(𝒇𝟏 + 𝒇𝟑 + ⋯ + 𝒇𝒏−𝟏 ) ≈ ℎ2 max |𝑓 ′′ (𝑥)|
𝒂 𝟐 𝒂 6 𝑎≤ 𝑥≤ 𝑏
Basic rule Composite Error bound
Ex: 1
Use composite midpoint and trapezoidal and Simpson formulas with 4 subintervals to approximate the
following integrals and estimate their error bounds:
𝟐
𝟐
∫ 𝒅𝒙
𝟎 𝒙𝟐 +𝟒
𝒃−𝒂 𝟐−𝟎
𝒉= = = 𝟎. 𝟓
𝒏 𝟒
𝑥 0 0.5 1 1.5 2
𝑓(𝑥) 0.5 0.4705 0.4 0.32 0.25
Midpoint
𝟐
2
∫ 𝑑𝑥 ≈ 2ℎ(𝑓1 + 𝑓3 ) = 0.4705 + 0.32 = 0.7905
𝟎 𝑥2 +4
2 ′ (𝑥)
4𝑥 ′′ (𝑥)
4(𝑥 2 + 4)2 − 16𝑥 2 (𝑥 2 + 4) 16 − 12𝑥 2
𝑓(𝑥) = → 𝑓 = − → 𝑓 = − = −
𝑥2 + 4 (𝑥 2 + 4)2 (𝑥 2 + 4)4 (𝑥 2 + 4)3
−1
𝑓 ′′ (0) =
4
b−a 2 2−0 1 1
Upper bound ≈ ℎ max|𝑓 ′′ | = 0.25 =
6 6 4 48
Trapezoidal
𝟐
𝟐 ℎ
∫ 𝒅𝒙 ≈ (𝑓0 + 2(𝑓1 + 𝑓2 + 𝑓3 ) + 𝑓4 ) = 0.25(0.5 + 2(0.4705 + 0.4 + 0.32) + 0.25) = 0.7825
𝟎 𝒙𝟐 +𝟒 2
1 1
Upper bound ≈ 𝐸𝑚𝑖𝑑𝑝𝑜𝑖𝑛𝑡 =
2 96
3
Simpson
𝟐
𝟐 ℎ 1
∫ 𝒅𝒙 ≈ (𝑓0 + 4(𝑓1 + 𝑓3 ) + 2𝑓2 + 𝑓4 ) = (0.5 + 4(0.470 + 0.32) + 2 ∗ 0.4 + 0.25) = 0.785
𝟎 𝒙𝟐 +𝟒 3 6
2 ′ (𝑥)
4𝑥 ′′ (𝑥)
4(𝑥 2 + 4)2 − 16𝑥 2 (𝑥 2 + 4) 16 − 12𝑥 2
𝑓(𝑥) = → 𝑓 = − → 𝑓 = − = −
𝑥2 + 4 (𝑥 2 + 4)2 (𝑥 2 + 4)4 (𝑥 2 + 4)3
′′′ (𝑥)
−24𝑥(𝑥 2 + 4)3 − 6𝑥(16 − 12𝑥 2 )(𝑥 2 + 4)2 48𝑥 3 − 192𝑥
𝑓 =− =−
(𝑥 2 + 4)6 (𝑥 2 + 4)4
3
𝑓 ′′′′ (0) =
4
b−a 4 2−0 43 1
Upper bound ≈ ℎ max|𝑓 ′′′′ | = 0.5 =
180 180 4 1920
4
Ex: 2
𝟎.𝟑
Use the composite trapezoidal ‘s formula to evaluate the approximate value of ∫𝟎.𝟏 𝒆𝒙 𝒅𝒙 , at accuracy 𝝐 =
𝟏𝟎−𝟒
𝐛−𝐚 𝟐
𝐔𝐩𝐩𝐞𝐫 𝐛𝐨𝐮𝐧𝐝 ≈ 𝒉 𝐦𝐚𝐱|𝒇′′ | < 𝟏𝟎−𝟒
𝟏𝟐
𝒇(𝒙) = 𝒆𝒙
𝑓′ = 𝑒 𝑥 𝑓′′ = 𝑒 𝑥
𝐦𝐚𝐱|𝒇′′ | = 𝒆𝟎.𝟑 𝒂𝒕 𝒙 = 𝟎. 𝟑
𝟎. 𝟑 − 𝟎. 𝟏 𝟐 𝟎.𝟑
𝒉 𝒆 < 𝟏𝟎−𝟒 → 𝒉𝟐 < 𝟒. 𝟒𝟒𝟒 × 𝟏𝟎−𝟑 → 𝒉 < 𝟎. 𝟎𝟔𝟔𝟔
𝟏𝟐
𝒉 = 𝟎. 𝟎𝟓
𝟎.𝟑
𝐡
∫ 𝒆𝒙 𝒅𝒙 ≈ [𝒇 + 𝟐(𝒇𝟏 + 𝒇𝟐 + 𝒇𝟑 ) + 𝒇𝟒 ]
𝟎.𝟏 𝟐 𝟎
𝟎. 𝟎𝟓
= [𝟏. 𝟏𝟎𝟓𝟏𝟕 + 𝟐(𝟏. 𝟏𝟔𝟏𝟖𝟑𝟒 + 𝟏. 𝟐𝟐𝟏𝟒 + 𝟏. 𝟐𝟖𝟒𝟎) + 𝟏. 𝟑𝟒𝟗𝟖𝟓𝟖𝟖] = 𝟎. 𝟐𝟒𝟒𝟕𝟑𝟕
𝟐
5
Ex: 3
𝟏.𝟑
Use the composite Simpson’s formula to evaluate the approximate value of ∫𝟏 √𝒙 𝒅𝒙 , at accuracy 𝝐 =
𝟏𝟎−𝟖
𝐛−𝐚 𝟒
𝐔𝐩𝐩𝐞𝐫 𝐛𝐨𝐮𝐧𝐝 ≈ 𝒉 𝐦𝐚𝐱|𝒇′′′′ | < 𝟏𝟎−𝟖
𝟏𝟖𝟎
𝒇(𝒙) = √𝒙 = 𝒙𝟎.𝟓
𝟏𝟓
𝐦𝐚𝐱|𝒇′′′′ | = 𝒂𝒕 𝒙 = 𝟏
𝟏𝟔
𝟏. 𝟑 − 𝟏 𝟒 𝟏𝟓 𝟏
𝒉 < 𝟏𝟎−𝟖 → 𝒉𝟒 < → 𝒉 < 𝟎. 𝟎𝟓𝟎𝟐
𝟏𝟖𝟎 𝟏𝟔 𝟏𝟓𝟔𝟐𝟓𝟎
𝒉 = 𝟎. 𝟎𝟓
𝟏.𝟑
𝐡
∫ √𝒙 𝒅𝒙 ≈ [𝒇 + 𝟒(𝒇𝟏 + 𝒇𝟑 + 𝒇𝟓 ) + 𝟐(𝒇𝟐 + 𝒇𝟒 ) + 𝒇𝟔 ]
𝟏 𝟑 𝟎
𝟎. 𝟎𝟓
= [𝟏 + 𝟒(𝟏. 𝟎𝟐𝟒𝟔 + 𝟏. 𝟎𝟕𝟐𝟑 + 𝟏. 𝟏𝟏𝟖) + 𝟐(𝟏. 𝟎𝟒𝟖𝟖 + 𝟏. 𝟎𝟗𝟓𝟒) + 𝟏. 𝟏𝟒] = 𝟎. 𝟑𝟐𝟏𝟒𝟔𝟔
𝟑
6
Ex: 4
𝟏 𝟏
Use Romberg method to evaluate the approximate value of ∫𝟎 𝒙𝟐 +𝟏
𝒅𝒙 , correct to two decimal places at
accuracy 𝝐 = 𝟎. 𝟓 × 𝟏𝟎−𝟐
𝒉=𝟏
𝑓0 + 𝑓1 1 𝑓1/4 + 𝑓3/4
𝑇0 = ℎ = (1 + 0.5) = 0.75 𝑀2 = = 0.790
2 2 2
4 𝑇1 + ℎ 𝑀2 0.775 + 0.790
𝑀1 = 𝑓1/2 = , 𝑇2 = = = 0.78279
5 2 2
𝑇0 + ℎ𝑀1 0.75 + 4/5
𝑇1 = = = 0.775 |𝑇2 − 𝑇1 | = 7.794 × 10−2 > 0.5 × 10−2
2 2
𝑇2 + ℎ 𝑀3 0.78279 + 0.7867
𝑇3 = = = 0.7873
2 2
Ex: 5
𝟐
Use Romberg method to evaluate the approximate value of ∫𝟏 𝒙 𝐥𝐧 𝒙 𝒅𝒙 , correct to two decimal places at
accuracy 𝝐 = 𝟏𝟎−𝟑
7
𝒉=𝟐−𝟏 =𝟏
𝑓1/4 + 𝑓3/4 𝑀4
𝑀2 = = 0.6291 𝑓1/16 + 𝑓3/16 + 𝑓5/16 + 𝑓7/16 + 𝑓9/16 + 𝑓11/16 + 𝑓13/16 + 𝑓15/16
2 =
8
= 0.63581
𝑇1 + ℎ 𝑀2 0.65066 + 0.6291 0.6371 + 0.63581
𝑇2 = = = 0.63988 𝑇4 = = 0.636455
2 2 2
|𝑇4 − 𝑇3 | = 6.45 × 10 < 10−3
−4
8
Numerical
𝒅
𝒅𝒙
Formulas
9
𝒇′(𝒙𝟎 )
Formula Shape Error bound
2-Point 𝒙𝟎 𝒙𝟎 + 𝒉
𝒇(𝒙𝟎 + 𝒉) − 𝒇(𝒙𝟎 )
𝒇′ (𝒙𝟎 ) ≈ ℎ
𝒉 𝐸≈ max |𝑓 ′′ (𝑥)|
2 𝑥0 ≤ 𝑥≤ 𝑥0 +ℎ
𝐸
End-Point 𝟏 𝒙𝟎 𝒙𝟎 + 𝒉 𝒙𝟎 + 𝟐𝒉
(Left)
𝒇′ (𝒙𝟎 ) ≈
𝟐𝒉
[−𝟑𝒇(𝒙𝟎 ) + 𝟒𝒇(𝒙𝟎 + 𝒉) − 𝒇(𝒙𝟎 + 𝟐𝒉)] ℎ2
(𝒉 > 𝟎)
≈ max |𝑓 ′′′ (𝑥)|
3 𝑥0 ≤ 𝑥≤ 𝑥0 +2ℎ
𝟏 𝐸
𝒇′ (𝒙𝟎 ) ≈ [−𝟑𝒇(𝒙𝟎 ) + 𝟒𝒇(𝒙𝟎 − 𝒉) − 𝒇(𝒙𝟎 − 𝟐𝒉)] 𝒙𝟎 − 𝟐𝒉 𝒙𝟎 − 𝒉 𝒙𝟎
End point 𝟐𝒉
3-Point (Right) ℎ2
(𝒉 < 𝟎)
≈ max |𝑓 ′′′ (𝑥)|
3 𝑥0 −2ℎ≤ 𝑥≤ 𝑥0
𝒙𝟎 − 𝒉 𝒙𝟎 𝒙𝟎 + 𝒉
𝒇(𝒙𝟎 + 𝒉) − 𝒇(𝒙𝟎 − 𝒉) 𝐸
Mid-Point 𝒇′ (𝒙𝟎 ) ≈
𝟐𝒉
ℎ2
≈ max |𝑓 ′′′ (𝑥)|
6 𝑥0 −ℎ≤ 𝑥≤ 𝑥0 +ℎ
End point 𝟏 𝐸
𝒇′ (𝒙𝟎 ) ≈ [−𝟐𝟓𝒇(𝒙𝟎 ) + 𝟒𝟖 𝒇(𝒙𝟎 + 𝒉)
(Right) 𝟏𝟐𝒉
(𝒉 < 𝟎) − 𝟑𝟔𝒇(𝒙𝟎 + 𝟐𝒉) + 𝟏𝟔𝒇(𝒙𝟎 ℎ4
+ 𝟑𝒉) − 𝟑𝒇(𝒙𝟎 + 𝟒𝒉)] ≈ max |𝑓 (𝑣) (𝑥)|
5 𝑥0 ≤ 𝑥≤ 𝑥0 +4ℎ
𝟏
𝒇′ (𝒙𝟎 ) ≈ [−𝟐𝟓𝒇(𝒙𝟎 ) + 𝟒𝟖 𝒇(𝒙𝟎 − 𝒉)
End point 𝟏𝟐𝒉
5-Point − 𝟑𝟔𝒇(𝒙𝟎 − 𝟐𝒉) + 𝟏𝟔𝒇(𝒙𝟎 𝐸
(Right)
(𝒉 < 𝟎)
− 𝟑𝒉) − 𝟑𝒇(𝒙𝟎 − 𝟒𝒉)] ℎ4
≈ max |𝑓 (𝑣) (𝑥)|
5 𝑥0 −4ℎ≤ 𝑥≤ 𝑥0
Mid-Point 𝟏
𝒇′ (𝒙𝟎 ) ≈ [𝒇(𝒙𝟎 − 𝟐𝒉) − 𝟖 𝒇(𝒙𝟎 − 𝒉) + 𝟖𝒇(𝒙𝟎 𝐸
𝟏𝟐𝒉
+ 𝒉) − 𝒇(𝒙𝟎 + 𝟐𝒉)] ℎ4
≈ max |𝑓 (𝑣) (𝑥)|
30 𝑥0 −2ℎ≤ 𝑥≤ 𝑥0 +2ℎ
𝒇′′(𝒙𝟎 )
Formula Shape Error bound
𝒙𝟎 − 𝒉 𝒙𝟎 𝒙𝟎 + 𝒉
3-Point 𝟏 𝐸
Mid-Point 𝒇′ (𝒙𝟎 ) ≈ [𝒇(𝒙𝟎 − 𝒉) − 𝟐𝒇(𝒙𝟎 ) + 𝒇(𝒙𝟎 + 𝒉)]
𝒉𝟐
ℎ2
≈ max |𝑓 (𝑖𝑣) (𝑥)|
12 𝑥0 −ℎ≤ 𝑥≤ 𝑥0 +ℎ
10
Ex: 6
Use the most suitable three points formula to complete the following table
𝑥 𝑓(𝑥) 𝑓′(𝑥) 𝑓′′(𝑥)
1.1 1.949477
1.2 2.199796
1.3 2.439189
1.4 2.670324
𝒉 = 𝟎. 𝟏
𝒙 𝒇(𝒙) 𝒇′(𝒙) 𝒇′′(𝒙)
1.1 1.949477 1
𝑓 ′ (𝑥) = [−3 ∗ 1.94977 + 4 ∗ 2.199796 − 2.439189] = 2.55782
0.2
1.2 2.199796 2.439189 − 1.949477
𝑓 ′ (𝑥) = = 2.44856
0.2
1.3 2.439189 2.670324 − 2.199796
𝑓 ′ (𝑥) = = 2.35264
0.2
1.4 2.670324 1
𝑓 ′ (𝑥) = [−3 ∗ 2.670324 + 4 ∗ 2.439189 − 2.199796] = 2.27006
−0.2
𝒆𝒓𝒓𝒐𝒓 𝒃𝒐𝒖𝒏𝒅
𝒙 𝒇′(𝒙) 𝒇′′(𝒙)
1.1 ℎ2 ℎ
max |𝑓 ′′′ (𝑥)| max |𝑔′′ (𝑥)| , 𝑔(𝑥) = 𝑓′(𝑥)
3 𝑥0 ≤ 𝑥≤ 𝑥0 +2ℎ 2 𝑥0 ≤ 𝑥≤ 𝑥0 +ℎ
1.2 ℎ2 ℎ2
max |𝑓 ′′′ (𝑥)| max |𝑓 (𝑖𝑣) (𝑥)|
6 𝑥0 −ℎ≤ 𝑥≤ 𝑥0 +ℎ 12 𝑥0 −ℎ≤ 𝑥≤ 𝑥0 +ℎ
1.3 ℎ2 ℎ2
max |𝑓 ′′′ (𝑥)| max |𝑓 (𝑖𝑣) (𝑥)|
6 𝑥0 −ℎ≤ 𝑥≤ 𝑥0 +ℎ 12 𝑥0 −ℎ≤ 𝑥≤ 𝑥0 +ℎ
1.4 ℎ2 ℎ
max |𝑓 ′′′ (𝑥)| max |𝑔′′ (𝑥)| , 𝑔(𝑥) = 𝑓′(𝑥)
6 𝑥0 −ℎ≤ 𝑥≤ 𝑥0 +ℎ 2 𝑥0 −ℎ≤ 𝑥≤ 𝑥0
11
Ex: 7
Use the most suitable three points formula to complete the following table
𝑓′(𝑥)
𝑓′′(𝑥)
𝒉 = 𝟎. 𝟏
𝒙 𝒇(𝒙) 𝒇′(𝒙)
2.1 -1.709847 1
[−25(−1.7098) + 48 (−1.373823) − 36(−1.119214) + 16(−0.9160143)
12 ∗ 0.1
− 3(−0.7470223)] = 3.89934425
2.2 -1.373823 1
[−25(−1.373823) + 48 (−1.119214) − 36(−0.916014) + 16(−0.747022)
12 ∗ 0.1
− 3(−0.601596)] = 2.876875667
2.3 -1.119214 1
[(−1.709847) − 8 (−1.373823) + 8(−0.916014) − (−0.7470223)]
12 ∗ 0.1
= 2.249704083
2.4 -0.9160143 1
[(−1.373833) − 8 𝑓(−1.119214) + 8𝑓(−0.7470223) − (−0.6015966)]
12 ∗ 0.1
= 1.837756
2.5 -0.7470223 1
[−25(−0.7470223) + 48 (−0.9160143) − 36(−1.119214)
12 ∗ −0.1
+ 16(−1.373823) − 3(−1.709847)] = −1.544209917
2.6 -0.6015966 1
[−25(−0.60159) + 48 (−0.7470223) − 36(−0.9160143) + 16(−1.119214)
12 ∗ −0.1
− 3(−1.373823)] = −1.355496333
12