Study Material Numerical Differentiation and Integration
1. Page | 1
VIVEKANANDA COLLEGE, TIRUVEDAKAM WEST
(Residential & Autonomous – A Gurukula Institute of Life-Training)
(Affiliated to Madurai Kamaraj University)
PART III: PHYSICS MAJOR – FOURTH SEMESTER-CORE SUBJECT PAPER-II
NUMERICAL METHODS – 06CT42
(For those who joined in June 2018 and after)
Reference Text Book: Numerical Methods – P.Kandasamy, K.Thilagavathy & K.Gunavathi,
S.Chand & Company Ltd., New Delhi, 2014.
UNIT – IV Numerical Differentiation and Integration
Numerical Differentiation
Introduction
We found the polynomial curve y = f (x), passing through the (n+1) ordered pairs (xi, yi), i=0, 1,
2…n. Now we are trying to find the derivative value of such curves at a given x = xk (say), whose x0 <
xk < xn.
To get derivative, we first find the curve y = f (x) through the points and then differentiate and get its
value at the required point.
If the values of x are equally spaced. We get the interpolating polynomial due to Newton-Gregory.
• If the derivative is required at a point nearer to the starting value in the table, we use
Newton’s forward interpolation formula.
• If we require the derivative at the end of the table, we use Newton’s backward interpolation
formula.
• If the value of derivative is required near the middle of the table value, we use one of the
central difference interpolation formulae.
Newton’s forward difference formula to get the derivative
Newton’s forward difference interpolation formula is
𝑦 (𝑥0 + 𝑢ℎ) = 𝑦𝑢 = 𝑦0 + 𝑢∆𝑦0 +
𝑢(𝑢 − 1)
2!
∆2
𝑦0 +
𝑢(𝑢 − 1)(𝑢 − 2)
3!
∆3
𝑦0 + ⋯
where 𝑦 (𝑥) is a polynomial of degree 𝑛 𝑖𝑛 𝑥 𝑎𝑛𝑑 𝑢 =
𝑥 − 𝑥0
ℎ
where ℎ 𝑖s interval of differencing
The values of first and second derivative at the starting value 𝑥 = 𝑥0 for given by
(
𝑑𝑦
𝑑𝑥
)
𝑥=𝑥0
=
1
ℎ
[∆ 𝑦0 −
1
2
∆2
𝑦0 +
1
3
∆3
𝑦0 − ⋯ ]
(
𝑑2
𝑦
𝑑𝑥2
)
𝑥=𝑥0
=
1
ℎ2
[∆2
𝑦0 − ∆3
𝑦0 +
11
12
∆4
𝑦0 − ⋯ ]
2. Page | 2
Problems:
1. The table given below revels the velocity v of a body during the time ‘t’ specified. find its
acceleration at t = 1.1
t : 1.0 1.1 1.2 1.3 1.4
v : 43.1 47.7 52.1 56.4 60.8
𝐒𝐨𝐥𝐮𝐭𝐢𝐨𝐧. 𝑣 is dependent on time 𝑡 𝑖. 𝑒. , 𝑣 = 𝑣(𝑡). we require acceleration =
𝑑𝑣
𝑑𝑡
.
therefore, we have to find 𝑣′(1.1).
𝐴𝑠
𝑑𝑣
𝑑𝑡
𝑎𝑡 𝑡 = 1.1 is require, (nearer to beginning value), we use 𝑁𝑒𝑤𝑡𝑜𝑛 𝑓𝑜𝑟𝑤𝑎𝑟𝑑 𝑓𝑜𝑟𝑚𝑢𝑙𝑎.
𝑣(𝑡) = 𝑣 (𝑥0 + 𝑢ℎ) = 𝑣0 + 𝑢∆𝑣0 +
𝑢(𝑢 − 1)
2!
∆2
𝑣0 +
𝑢(𝑢 − 1)(𝑢 − 2)
3!
∆3
𝑣0 + ⋯
𝑑𝑣
𝑑𝑡
=
1
ℎ
.
𝑑𝑣
𝑑𝑡
=
1
ℎ
[∆𝑣0 +
2𝑢 − 1
2
∆2
𝑣0 +
3𝑢2
− 6𝑢 + 2
6
∆3
𝑣0 + ⋯ ]
where 𝑢 =
𝑡 − 𝑡0
ℎ
=
1.1 − 1.0
0.1
= 1
(
𝑑𝑣
𝑑𝑡
)
𝑡=1.1
= (
𝑑𝑣
𝑑𝑡
)
𝑛=1
=
1
0.1
[4.6 +
1
2
(−0.2) +
1
6
(0.1) +
1
12
(0.1)]
= 10[4.6 − 0.1 − 0.0166 + 0.0083]
= 𝟒𝟒. 𝟗𝟏𝟕
t
1.0
1.1
1.2
1.3
1.4
v
43.1
47.7
52.1
56.4
60.8
∆𝑣
4.6
4.4
4.3
4.4
∆2
𝑣
-0.2
-0.1
0.1
∆3
𝑣
0.1
0.2
∆4
𝑣
0.1
3. Page | 3
2. Derive the Newton’s forward difference formula to get the derivative.
We are given (𝑛 + 1)ordered pairs (𝑥𝑖, 𝑦𝑖)𝑖 = 0, 1, … 𝑛. we want to find the derivative of
𝑦 = 𝑓(𝑥) passing through the (𝑛 + 1) points, at a point near to the startinng value 𝑥 = 𝑥0
Newton’s forward difference interpolation formula is
𝑦 (𝑥0 + 𝑢ℎ) = 𝑦𝑢 = 𝑦0 + 𝑢∆𝑦0 +
𝑢(𝑢 − 1)
2!
∆2
𝑦0 +
𝑢(𝑢 − 1)(𝑢 − 2)
3!
∆3
𝑦0 + ⋯ … (1)
where 𝑦 (𝑥) is a polynomial of degree 𝑛 𝑖𝑛 𝑥 𝑎𝑛𝑑 𝑢 =
𝑥 − 𝑥0
ℎ
Differentiating 𝑦(𝑥) w. r. t. 𝑥,
𝑑𝑦
𝑑𝑥
=
𝑑𝑦
𝑑𝑢
.
𝑑𝑢
𝑑𝑥
=
1
ℎ
.
𝑑𝑦
𝑑𝑢
𝑑𝑦
𝑑𝑥
=
1
ℎ
[∆𝑦0 +
2𝑢 − 1
2
∆2
𝑦0 +
3𝑢2
− 6𝑢 + 2
6
∆3
𝑦0 +
(4𝑢3
− 18𝑢2
+ 22𝑢 − 6)
24
∆4
𝑦0] … . (2)
Equation (2) gives the value of
𝑑𝑦
𝑑𝑥
at general 𝑥 which may be anywhere in the interval.
In special case like 𝑥 = 𝑥0, 𝑖. 𝑒. , 𝑢 = 0 𝑖𝑛 (2)
(
𝑑𝑦
𝑑𝑥
)
𝑥=𝑥0
= (
𝑑𝑦
𝑑𝑥
)
𝑢=0
=
1
ℎ
[∆𝑦0 +
1
2
∆2
𝑦0 +
1
3
∆3
𝑦0 −
1
4
∆4
𝑦0 + ⋯ ] … (3)
Differentiating (2) again w. r. t. 𝑥,
𝑑2
𝑦
𝑑𝑥2
=
𝑑
𝑑𝑢
(
𝑑𝑦
𝑑𝑥
) .
𝑑𝑢
𝑑𝑥
=
𝑑
𝑑𝑢
(
𝑑𝑦
𝑑𝑥
) .
1
ℎ
𝑑2
𝑦
𝑑𝑥2
=
1
ℎ2
[∆2
𝑦0 + (𝑢 − 1)∆3
𝑦0 +
(6𝑢2
− 18𝑢 + 11)
12
∆4
𝑦0 + ⋯ ] … (4)
Equation (4) give the second derivative value at 𝑥 = 𝑥.
setting 𝑥 = 𝑥0 𝑖. 𝑒. , 𝑢 = 0 𝑖𝑛 (4)
(
𝑑2
𝑦
𝑑𝑥2
)
𝑥=𝑥0
=
1
ℎ2
[∆2
𝑦0 − ∆3
𝑦0 +
11
12
∆4
𝑦0 + ⋯ ] … (5)
This equation (5) give the value of second derivative at the starting value 𝑥 = 𝑥0
3. 𝐓𝐡𝐞 𝐭𝐚𝐛𝐥𝐞 𝐛𝐞𝐥𝐨𝐰 𝐠𝐢𝐯𝐞𝐬 𝐭𝐡𝐞 𝐫𝐞𝐬𝐮𝐥𝐭𝐬 𝐨𝐟 𝐚𝐧 𝐨𝐛𝐬𝐞𝐫𝐯𝐚𝐭𝐢𝐨𝐧: 𝛉 𝐢𝐬 𝐭𝐡𝐞 𝐨𝐛𝐬𝐞𝐫𝐯𝐞𝐝 𝐭𝐞𝐦𝐩𝐞𝐫𝐚𝐭𝐮𝐫𝐞 𝐢𝐧
𝐝𝐞𝐠𝐫𝐞𝐞𝐬 𝐜𝐞𝐧𝐭𝐫𝐢𝐠𝐫𝐚𝐝𝐞 𝐨𝐟𝐚 𝐯𝐞𝐬𝐬𝐞𝐥 𝐨𝐟 𝐜𝐨𝐨𝐥𝐢𝐧𝐠 𝐰𝐚𝐭𝐞𝐫; 𝐭 𝐢𝐬 𝐭𝐡𝐞 𝐭𝐢𝐦𝐞 𝐢𝐧 𝐦𝐢𝐧𝐮𝐭𝐞𝐬 𝐟𝐫𝐨𝐦 𝐭𝐡𝐞
𝐛𝐞𝐠𝐢𝐧𝐧𝐢𝐧𝐠 𝐨𝐟 𝐨𝐛𝐬𝐞𝐫𝐯𝐚𝐭𝐢𝐨𝐧.
𝐅𝐢𝐧𝐝 𝐭𝐡𝐞 𝐚𝐩𝐩𝐫𝐨𝐱𝐢𝐦𝐚𝐭𝐞 𝐫𝐚𝐭𝐞 𝐨𝐟 𝐜𝐨𝐨𝐥𝐢𝐧𝐠 𝐚𝐭 𝒕 = 𝟑 𝒂𝒏𝒅 𝟑. 𝟓
t :
𝜽 :
1
85.3
3
74.5
5
67.0
7
60.5
9
54.3
12. Page | 12
ii) Since n = 6, we can use Simpson′
s rule
𝐵𝑦 𝑆𝑖𝑚𝑝𝑠𝑜𝑛′
𝑠 𝑜𝑛𝑒 − 𝑡ℎ𝑖𝑟𝑑 𝑟𝑢𝑙𝑒
𝐼 =
0.2
3
[(1.3862944 + 1.6486586 + 2(1.4816045 + 1.5686159)
+ 4(1.4350845 + 1.5260563)]
= 𝟏. 𝟖𝟐𝟕𝟖𝟒𝟕𝟐𝟒
𝑖𝑖𝑖) 𝐵𝑦 𝑆𝑖𝑚𝑝𝑜𝑛𝑠𝑜𝑛′
𝑠 𝑡ℎ𝑖𝑟𝑑 − 𝑒𝑖𝑔ℎ𝑡ℎ𝑠 𝑟𝑢𝑙𝑒,
𝐼 =
3(0.2)
8
[(1.3862944 + 1.6486586)
+ 3(1.4350845 + 1.4816045 + 1.5686159 + 1.6094379 + 2(1.5260563)]
= 𝟏. 𝟖𝟐𝟕𝟖𝟒𝟕𝟐𝟒
Short Answer:
1. Write down the Newton-Cote’s quadrature formula.
∫ 𝑓(𝑥) 𝑑𝑥 ≈ ℎ [𝑛𝑦0 +
𝑛2
2
∆𝑦0 +
1
2
(
𝑛3
3
−
𝑛2
2
) ∆2
𝑦0 +
1
6
(
𝑛4
4
− 𝑛3
+ 𝑛2
) ∆3
𝑦0 + ⋯ ]
𝑥 𝑛
𝑥0
This equation is called 𝑁𝑒𝑤𝑡𝑜𝑛 − 𝐶𝑜𝑡𝑒′
𝑠 𝑞𝑢𝑎𝑑𝑟𝑎𝑡𝑢𝑟𝑒 𝑓𝑜𝑟𝑚𝑢𝑙𝑎.
2. What is the nature of y (x) in the case of trapezoidal rule?
In trapezoidal rule, y (x) is a linear function of x.
3. State the nature of y (x) and number of intervals in the case of Simpson’s one-third rule?
In Simpson’s one-third rule, y (x) is a polynomial of degree two. To apply this rule n, the number of
intervals must be even.
4. What is the nature of y (x) in the case of Simpson’s three-eighths rule and when it is
applicable?
In Simpson’s third-eighths rule, y (x) is a polynomial of degree three. This rule is applicable if n, the
number of intervals is a multiple of 3.
5. Differentiate between Simpson’s one-third rule and Simpson’s three-eighths rule.
S.No Simpson’s one-third rule Simpson’s three-eighths rule
1 y (x) is a polynomial of degree two y (x) is a polynomial of degree three
2 The number of intervals must be even. The number of intervals is a multiple of 3.