Module_4 Math
Module_4 Math
Numerical methods
The process of estimating the value of y for any given value of x which is outside the given
range is called extrapolation.
a) Equal intervals
Finite difference:
𝑥 𝑦 ∆𝑦 𝑜𝑟 ∇y ∆2 𝑦 𝑜𝑟 ∇2 y ∆3 𝑦 𝑜𝑟 ∇3 y
𝑥0 𝑦0
𝑦1 − 𝑦0 = ∆𝑦0
= ∇𝑦1
𝑥1 𝑦1 ∆𝑦1 − ∆𝑦0 = ∆2 𝑦0
= ∇2 𝑦2
𝑦2 − 𝑦1 = ∆𝑦1 ∆2 𝑦1 − ∆2 𝑦0 = ∆3 𝑦0
= ∇𝑦2 = ∇3 𝑦3
𝑥2 𝑦2 ∆𝑦2 − ∆𝑦1 = ∆2 𝑦1
= ∇2 𝑦3
𝑦3 − 𝑦2 = ∆𝑦2
= ∇𝑦3
𝑥3 𝑦3
Newton’s forward interpolation formula:
38 − 40
𝑤ℎ𝑒𝑟𝑒 𝑝 = = −00.2
10
𝑓(38) = 180.24
85 − 90
𝑤ℎ𝑒𝑟𝑒 𝑝 = = −0.5
10
𝑓(85) = 289.75
Solution:
x y ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦
-4 -25
26
-2 1 -24
2 48
0 3 24 0
26 48
2 29 72
98
4 127
𝑝(𝑝 − 1) 2 𝑝(𝑝 − 1)(𝑝 − 2) 3 𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3) 4
𝑦 = 𝑦0 + 𝑝∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯
2! 3! 4!
𝑥+4
𝑤ℎ𝑒𝑟𝑒 𝑝 =
2
𝑦 = 𝑓(𝑥) = 𝑥 3 + 3𝑥 2 + 3𝑥 + 3
𝑓(5) = 218
4. From the following data estimate the number of students who obtained
i. Less than 45 marks
ii. Between 40 & 45 marks
x y ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦
40 31
42
50 73 9
51 -25
60 124 -16 37
35 12
70 159 -4
31
80 190
𝑝(𝑝 − 1) 2 𝑝(𝑝 − 1)(𝑝 − 2) 3 𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3) 4
𝒚 = 𝒚𝟎 + 𝒑∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯
2! 3! 4!
45 − 40
𝑤ℎ𝑒𝑟𝑒 𝑝 = = 0.5
10
𝑓(45) = 47.86 ≈ 48
Practice problems:
1. From the following data, estimate the values of f(22) & f(42)
x 20 25 30 35 40 45
f(x) 354 332 291 260 231 204
2. Find the interpolating polynomial for the following data & hence estimate f(4)
x 0 1 2 3
f(x) 1 2 1 10
3. Given 𝑠𝑖𝑛20° = 0.3420, 𝑠𝑖𝑛25° = 0.4226, 𝑠𝑖𝑛30° = 0.5, 𝑠𝑖𝑛35° = 0.5736,
𝑠𝑖𝑛40° = 0.6428, find 𝑠𝑖𝑛24° & 𝑠𝑖𝑛42° using appropriate interpolation formula
4. Find an interpolating polynomial 𝑢𝑥 satisfying 𝑢−4 = −3, 𝑢−2 = 5, 𝑢0 = 13, 𝑢2 =
69, 𝑢4 = 221, hence find 𝑢3 & 𝑢6
b) Unequal intervals:
Let 𝑦 = 𝑓(𝑥) and 𝑥0 , 𝑥1 , 𝑥2 ,… 𝑥𝑛 be the values of x which are not at equidistant and 𝑦0 ,
𝑦1 , 𝑦2 ,… 𝑦𝑛 be the corresponding values of y
𝑦 = 𝑦0 + (𝑥 − 𝑥0 ) [𝑥0 , 𝑥1 ] + (𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ) [𝑥0 , 𝑥1 , 𝑥2 ]
+ (𝑥 − 𝑥0 ) (𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) [𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ] + ⋯
Problems:
1. Use Newton’s divided difference formula to find f(4), given that
x 0 2 3 6
f(x) -4 2 14 158
Solution:
f(4)=40
2. Given 𝒖𝟐𝟎 = 𝟐𝟒. 𝟑𝟕, 𝒖𝟐𝟐 = 𝟒𝟗. 𝟐𝟖, 𝒖𝟐𝟗 = 𝟏𝟔𝟐. 𝟖𝟔, & 𝒖𝟑𝟐 = 𝟐𝟒𝟎 . 𝟓 find 𝒖𝟐𝟖
by Newton’s divided difference formula
Solution:
𝑢28 = 141.938
Practice problems:
1. Use Newton’s divided difference formula to find f(x) at x=0.5, given that
x 0 2 3 5 6
f(x) 0 6 21 105 186
2. Use Newton’s divided difference formula to find f(x) at x=8, given that
x 1 2 4 7 12
f(x) 576 168 -30 48 378
3. Use Newton’s divided difference formula to find f(x) , given that
x -1 0 3 6 7
f(x) 3 -6 39 822 1611
4. Use Newton’s divided difference formula to find f(x) , given that
x 0 1 2 5
f(x) 2 3 12 147
b. Lagrange’s interpolation formula:
(𝒙 − 𝒙𝟏 )(𝒙 − 𝒙𝟐 )(𝒙 − 𝒙𝟑 ) … (𝒙 − 𝒙𝒏 )
𝒚= 𝒚
(𝒙𝟎 − 𝒙𝟏 )(𝒙𝟎 − 𝒙𝟐 )(𝒙𝟎 − 𝒙𝟑 ) … (𝒙𝟎 − 𝒙𝒏 ) 𝟎
(𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟐 )(𝒙 − 𝒙𝟑 ) … (𝒙 − 𝒙𝒏 )
+ 𝒚
(𝒙𝟎 − 𝒙𝟎 )(𝒙𝟎 − 𝒙𝟐 )(𝒙𝟎 − 𝒙𝟑 ) … (𝒙𝟎 − 𝒙𝒏 ) 𝟏
(𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 )(𝒙 − 𝒙𝟑 ) … (𝒙 − 𝒙𝒏 )
+ 𝒚 +⋯
(𝒙𝟎 − 𝒙𝟎 )(𝒙𝟎 − 𝒙𝟏 )(𝒙𝟎 − 𝒙𝟑 ) … (𝒙𝟎 − 𝒙𝒏 ) 𝟐
Problems:
1. Using Lagrange’s interpolation formula, find y when x=10 from the following data
x 5 6 9 11
f(x) 12 13 14 16
Solution:
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )
𝑦= 𝑦0 + 𝑦
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) (𝑥0 − 𝑥0 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) 1
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )
+ 𝑦2 + 𝑦 = 14.6667
(𝑥0 − 𝑥0 )(𝑥0 − 𝑥1 )(𝑥0 − 𝑥3 ) (𝑥0 − 𝑥0 )(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) 3
x 0 1 3 4
f(x) -12 0 6 12
Solution:
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )
𝑦= 𝑦0 + 𝑦
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) (𝑥0 − 𝑥0 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) 1
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )
+ 𝑦2 + 𝑦
(𝑥0 − 𝑥0 )(𝑥0 − 𝑥1 )(𝑥0 − 𝑥3 ) (𝑥0 − 𝑥0 )(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) 3
= 𝑥 3 − 7𝑥 2 + 18𝑥 − 12
Practice problems:
1. Using Lagrange’s interpolation formula, find y when x=11 from the following data
x 2 5 8 14
f(x) 94.8 87.9 81.3 68.7
2. Using Lagrange’s interpolation formula, find y when x=18 from the following data
x 10 12 19 22
f(x) 24 48 162 200
3. Using Lagrange’s interpolation formula, find an interpolating polynomial that
approximates to the function described by the following table
x 1 2 4 5
f(x) 14 41 197 350
4. Using Lagrange’s interpolation formula, find an interpolating polynomial that
approximates to the function described by the following table
x 0 2 3 5
f(x) 2 10 17 37
Solution of algebraic and transcendental equations:
Ex:𝑥 3 − 3𝑥 + 1 = 0
Transcendental equation: Equations involving quantities like 𝑒 𝑥 , 𝑙𝑜𝑔𝑥, 𝑠𝑖𝑛𝑥, 𝑡𝑎𝑛𝑥 …are
called as transcendental equations.
Intermediate value property: If there exist two values a & b such that f(x) has opposite sign,
say f(a)<0, f(b)>0, then there exist atleast one real root in(a, b).
Working rule:
approximately same
• That is the root of the equation
Problems:
Find a real root of the following using Newton Raphson method
i. 𝒙𝟑 + 𝒙𝟐 + 𝟑𝒙 + 𝟒 = 𝟎
Solution: 𝑓(𝑥) = 𝑥 3 + 𝑥 2 + 3𝑥 + 4
𝑓 ′ (𝑥) = 3𝑥 2 + 2𝑥 + 3
𝑓(−2) = −6
𝑓(−1) = 1
Let𝑥0 = −1.5
𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 −
𝑓 ′ (𝑥𝑛 )
𝑓(𝑥0 ) 𝑓(−1.5)
𝑥1 = 𝑥0 − ′
= −1.5 − ′ = −1.25
𝑓 (𝑥0 ) 𝑓 (−1.5)
𝑓(𝑥1 ) 𝑓(−1.25)
𝑥2 = 𝑥1 − = −1.25 − = −1.2229
𝑓 ′ (𝑥1 ) 𝑓 ′ (−1.25)
𝑓(𝑥2 ) 𝑓(−1.2229)
𝑥3 = 𝑥2 − = −1.2229 − = −1.2229
𝑓 ′ (𝑥2 ) 𝑓 ′ (−1.2229)
ii. 𝒙𝒍𝒐𝒈𝟏𝟎 𝒙 = 𝟏. 𝟐
𝑓(2) = −0.6
𝑓(3) = 0.23
Let𝑥0 = 2.5
𝑓(𝑥0 ) 𝑓(2.5)
𝑥1 = 𝑥0 − ′
= 2.5 − ′ = 2.7461
𝑓 (𝑥0 ) 𝑓 (2.5)
𝑓(𝑥1 ) 𝑓(2.7461)
𝑥2 = 𝑥1 − ′
= 2.7461 − ′ = 2.7406
𝑓 (𝑥1 ) 𝑓 (2.7461)
𝑓(𝑥2 ) 𝑓(2.7406)
𝑥3 = 𝑥2 − = 2.7406 − = 2.7406
𝑓 ′ (𝑥2 ) 𝑓 ′ (2.7406)
Practice problems:
i. 𝑥 4 + 2𝑥 2 − 16𝑥 + 5 = 0
ii. 𝑥 3 + 5𝑥 − 11 = 0 in (1, 2)
iii. 𝑥𝑠𝑖𝑛𝑥 + 𝑐𝑜𝑠𝑥 = 0 𝑛𝑒𝑎𝑟 𝑥 = 𝜋
iv. 𝑥𝑒 𝑥 − 2 = 0
v. 𝑥 + 𝑙𝑜𝑔10 𝑥 = 3.375
𝑏−𝑎
Here ℎ = is the interval of difference or step length
𝑛
Trapezoidal rule:
𝒉
𝑰= [(𝒚𝟎 + 𝒚𝒏 ) + 𝟐(𝒚𝟏 + 𝒚𝟐 + 𝒚𝟑 + ⋯ 𝒚𝒏−𝟐 )]
𝟐
𝒉
𝑰= [(𝒚𝟎 + 𝒚𝒏 ) + 𝟐(𝒚𝟐 + 𝒚𝟒 + 𝒚𝟔 + ⋯ 𝒚𝒏−𝟏 ) + 𝟒(𝒚𝟏 + 𝒚𝟑 + 𝒚𝟓 + ⋯ 𝒚𝒏−𝟏 )]
𝟑
𝟑𝒉
𝑰= [(𝒚𝟎 + 𝒚𝒏 ) + 𝟐(𝒚𝟑 + 𝒚𝟔 + 𝒚𝟗 + ⋯ 𝒚𝒏−𝟑 ) + 𝟑(𝒚𝟏 + 𝒚𝟐 + 𝒚𝟒 + ⋯ 𝒚𝒏−𝟏 )]
𝟖
Note:
• To apply Simpson’s 1/3rd rule, n must be multiples of 2
• To apply Simpson’s 3/8th rule, n must be multiples of 3
Problems:
1
Solution: ℎ = 6
𝝅
ii. ∫𝟎𝟐 √𝒄𝒐𝒔𝜽 𝒅𝜽
ℎ
𝐼= [(𝑦 + 𝑦𝑛 ) + 2(𝑦2 + 𝑦4 + 𝑦6 + ⋯ 𝑦𝑛−1 ) + 4(𝑦1 + 𝑦3 + 𝑦5 + ⋯ 𝑦𝑛−1 )]
3 0
= 1.1873
x 1 2 3 4
y 2.7183 1.6487 1.3956 1.2840
3ℎ
𝐼= [(𝑦0 + 𝑦𝑛 ) + 2(𝑦3 + 𝑦6 + 𝑦9 + ⋯ 𝑦𝑛−3 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + ⋯ 𝑦𝑛−1 )]
8
= 4.9257
𝟏 𝟏
ii. ∫𝟎 𝒅𝒙 taking 7 ordinates & hence deduce the value of 𝒍𝒐𝒈𝟐
𝟏+𝒙
Practice problems: