UNIT III (21MAB206T) ACADEMIC YEAR 2023-2024 (ODD SEMESTER) NUMERICAL METHODS AND ANALYISIS TOPICS Numerical Differenetiation Numerical differentiation using Newton Forward difference formulae Numerical differentiation using Newton backward difference formulae Numerical integration Trapezoidal rule and their applications Simpson’s one-third rule and their application Simpson’s three-eighth rule and their application NUMERICAL DIFFERENTIATION Numerical differentiation using Newton forward difference formulae Suppose we have (𝑛 + 1) ordered pairs (𝑥𝑖 , 𝑦𝑖 ), for 𝑖 = 0,1, … , 𝑛. And we want to find the derivative of 𝑦 = 𝑓(𝑥) passing through the (𝑛 + 1) points, at a point nearer to the starting value 𝑥 = 𝑥0 . We use Newton forward difference interpolation formula to get the derivative. Newton’s forward difference interpolation formula is 𝑢(𝑢−1) 2 𝑢(𝑢−1)(𝑢−2) 3 Δ 𝑦 + Δ 𝑦0 0 2! 3! 𝑥−𝑥 in 𝑥 and 𝑢 = ℎ 0 𝑦 𝑥 = 𝑦 𝑥0 + 𝑢ℎ = 𝑦𝑢 = 𝑦0 + 𝑢Δ𝑦0 + Where 𝑦(𝑥) is a polynomial of degree 𝑛 +⋯ Differentiating 𝑦(𝑥) with respect to 𝑥, we get 𝑑𝑦 𝑑𝑥 𝑑𝑦 𝑑𝑢 = 𝑑𝑢 ⋅ 𝑑𝑥 Also 𝑑𝑢 𝑑𝑥 = 𝑑 𝑥−𝑥0 ℎ 𝑑𝑥 1 =ℎ So 𝑑𝑦 𝑑𝑥 1 ℎ = ⋅ 𝑑𝑦 𝑑𝑢 Again 𝑑𝑦 𝑑𝑢 = Δ𝑦0 + 2𝑢−1 2 Δ 𝑦0 2 + 3𝑢2 −6𝑢+2 3 Δ 𝑦0 6 + 4𝑢3 −18𝑢2 +22𝑢−6 4 Δ 𝑦0 24 +⋯ Hence 𝑑𝑦 𝑑𝑥 = 1 {Δ𝑦0 ℎ + 2𝑢−1 2 Δ 𝑦0 2 𝑑𝑦 + 3𝑢2 −6𝑢+2 3 Δ 𝑦0 6 + 4𝑢3 −18𝑢2 +22𝑢−6 4 Δ 𝑦0 24 + ⋯} This is the value of 𝑑𝑥 at general 𝑥 which may be anywhere in the interval. Some other higher order derivatives of 𝑦(𝑥) with respect to 𝑥 are given as 𝑑2 𝑦 𝑑𝑥 2 = 𝑑3 𝑦 𝑑𝑥 3 = ℎ3 {Δ3 𝑦0 + 1 ℎ2 1 Δ2 𝑦0 + 𝑢−1 Δ3 𝑦0 12𝑢−18 4 Δ 𝑦0 12 + 6𝑢2 −18𝑢+11 4 Δ 𝑦0 12 + ⋯} +⋯ In special case 𝑥 = 𝑥0 , we have 𝑢 = 0. So 𝑑𝑦 𝑑𝑥 𝑥=𝑥0 = 𝑑𝑦 𝑑𝑥 𝑢=0 1 1 1 1 = ℎ {Δ𝑦0 − 2 Δ2 𝑦0 + 3 Δ3 𝑦0 − 4 Δ4 𝑦0 + ⋯ } 𝑑𝑦 This is the value of 𝑑𝑥 at general 𝑥 which may be anywhere in the interval. Similarly, 𝑑2 𝑦 𝑑𝑥 2 𝑥=𝑥0 = ℎ2 Δ2 𝑦0 − Δ3 𝑦0 + 12 Δ4 𝑦0 + ⋯ 𝑑3 𝑦 𝑑𝑥 3 𝑥=𝑥0 = ℎ3 {Δ3 𝑦0 − 2 Δ4 𝑦0 + ⋯ } 1 1 11 3 Numerical differentiation using Newton backward difference formulae Suppose we have (𝑛 + 1) ordered pairs (𝑥𝑖 , 𝑦𝑖 ), for 𝑖 = 0,1, … , 𝑛. And we want to find the derivative of 𝑦 = 𝑓(𝑥) passing through the (𝑛 + 1) points, at a point nearer to the end value 𝑥 = 𝑥𝑛 . We use Newton backward difference interpolation formula to get the derivative. Newton’s backward difference interpolation formula is 𝑣(𝑣+1) 2 𝑣(𝑣+1)(𝑣+2) 3 𝛻 𝑦 + 𝛻 𝑦𝑛 𝑛 2! 3! 𝑥−𝑥 in 𝑥 and v= ℎ 𝑛 𝑦 𝑥 = 𝑦 𝑥𝑛 + 𝑣ℎ = 𝑦𝑣 = 𝑦𝑛 + v𝛻𝑦𝑛 + Where 𝑦(𝑥) is a polynomial of degree 𝑛 +⋯ Differentiating 𝑦(𝑥) with respect to 𝑥, we get 𝑑𝑦 𝑑𝑥 = 𝑑𝑦 𝑑𝑣 𝑑𝑣 ⋅ 𝑑𝑥 Also 𝑑𝑣 𝑑𝑥 = 𝑑 𝑥−𝑥𝑛 ℎ 𝑑𝑥 1 =ℎ So 𝑑𝑦 𝑑𝑥 1 ℎ = ⋅ 𝑑𝑦 𝑑𝑣 Again 𝑑𝑦 𝑑𝑣 = 𝛻𝑦𝑛 + 2𝑣+1 2 𝛻 𝑦𝑛 2 + 3𝑣 2 +6𝑣+2 3 𝛻 𝑦𝑛 6 + 4𝑣 3 +18𝑣 2 +22𝑣+6 4 𝛻 𝑦𝑛 24 +⋯ Hence 𝑑𝑦 𝑑𝑥 = 1 {𝛻𝑦𝑛 ℎ 2𝑣+1 + 2 𝛻 2 𝑦𝑛 𝑑𝑦 + 3𝑣 2 +6𝑣+2 3 𝛻 𝑦𝑛 6 + 4𝑣 3 +18𝑣 2 +22𝑣+6 4 𝛻 𝑦𝑛 24 + ⋯} This is the value of 𝑑𝑥 at general 𝑥 which may be anywhere in the interval. Some other higher order derivatives of 𝑦(𝑥) with respect to 𝑥 are given as 𝑑2 𝑦 𝑑𝑥 2 = 𝑑3 𝑦 𝑑𝑥 3 = ℎ3 {𝛻 3 𝑦𝑛 + 1 ℎ2 1 𝛻 2 𝑦𝑛 + 𝑣+1 Δ3 𝑦𝑛 12𝑣+18 4 𝛻 𝑦𝑛 12 + 6𝑣 2 +18𝑣+11 4 𝛻 𝑦𝑛 12 + ⋯} +⋯ In special case 𝑥 = 𝑥𝑛 , we have v= 0. So 𝑑𝑦 𝑑𝑥 𝑥=𝑥𝑛 = 𝑑𝑦 𝑑𝑥 𝑣=0 1 1 1 1 = ℎ {𝛻𝑦𝑛 + 2 𝛻 2 𝑦𝑛 + 3 𝛻 3 𝑦𝑛 + 4 𝛻 4 𝑦𝑛 + ⋯ } 𝑑𝑦 This is the value of 𝑑𝑥 at general 𝑥 which may be anywhere in the interval. Similarly, 𝑑2 𝑦 𝑑𝑥 2 𝑥=𝑥𝑛 = ℎ2 𝛻 2 𝑦𝑛 + 𝛻 3 𝑦𝑛 + 12 𝛻 4 𝑦𝑛 + ⋯ 𝑑3 𝑦 𝑑𝑥 3 𝑥=𝑥𝑛 = ℎ3 {𝛻 3 𝑦𝑛 + 2 𝛻 4 𝑦𝑛 + ⋯ } 1 1 11 3 Examples Example 1:- Find the first two derivative of 𝑥 below: 50 𝒙 𝑦= 𝑥 1 3 51 3.6840 3.7084 1 3 at 𝑥 = 50 and 𝑥 = 56 given the data 52 53 54 55 56 3.7325 3.7563 3.7798 3.8030 3.8259 Solution:- Since we require 𝑓 ′ (𝑥) at 𝑥 = 50, we use Newton’s forward difference formula and to get 𝑓 ′ 𝑥 at 𝑥 = 56, we use Newton’s backward difference formula. 𝑥 𝑦 50 3.6840 Δ𝑦 Δ2 𝑦 Δ3 𝑦 0.0244 51 3.7084 −0.0003 0.0241 52 3.7325 0 −0.0003 0.0238 53 3.7563 0 −0.0003 0.0235 54 3.7798 0 −0.0003 0.0232 55 3.8030 −0.0003 0.0229 56 3.8259 0 By the differentiation of 𝑦(𝑥) derived from Newton’s forward interpolation formula, we have 𝑑𝑦 𝑑𝑥 𝑥=𝑥0 𝑑𝑦 𝑑𝑥 𝑢=0 = 1 1 1 = ℎ Δ𝑦0 − 2 Δ2 𝑦0 + 3 Δ3 𝑦0 − ⋯ ⇒ 𝑑𝑦 𝑑𝑥 𝑥=50 = 1 0.0244 − 2 −0.0003 + 3 (0) 1 1 1 ⇒ 𝑑𝑦 𝑑𝑥 𝑥=50 = 0.02455 Also, 𝑑2 𝑦 𝑑𝑥 2 𝑥=𝑥0 ⇒ = 𝑑2 𝑦 𝑑𝑥 2 𝑥=50 𝑑2 𝑦 𝑑𝑥 2 𝑢=0 1 = ℎ2 Δ2 𝑦0 − Δ3 𝑦0 … = 1 −0.0003 = −0.0003 By the differentiation of 𝑦(𝑥) derived from Newton’s backward interpolation formula, we have 𝑑𝑦 𝑑𝑥 𝑥=𝑥𝑛 𝑑𝑦 𝑑𝑥 𝑣=0 = 1 1 1 = ℎ 𝛻𝑦𝑛 + 2 𝛻 2 𝑦𝑛 + 3 𝛻 3 𝑦𝑛 + ⋯ ⇒ 𝑑𝑦 𝑑𝑥 𝑥=56 = 1 0.0229 + 2 −0.0003 + 3 (0) 1 1 1 ⇒ 𝑑𝑦 𝑑𝑥 𝑥=56 = 0.02275 Also, 𝑑2 𝑦 𝑑𝑥 2 𝑥=𝑥𝑛 ⇒ = 𝑑2 𝑦 𝑑𝑥 2 𝑥=56 𝑑2 𝑦 𝑑𝑥 2 𝑣=0 1 = ℎ2 𝛻 2 𝑦𝑛 + 𝛻 3 𝑦𝑛 … = 1 −0.0003 = −0.0003 Examples Example 2:- The population f a certain town is given below. Find the rate of growth of the population in 1931,1941,1961 and 1971. Year 𝒙 𝟏𝟗𝟑𝟏 1941 𝟏𝟗𝟓𝟏 𝟏𝟗𝟔𝟏 𝟏𝟗𝟕𝟏 Population in thousands 𝑦 40.62 60.80 79.95 103.56 132.65 Solution:- We use the same difference table for backward and forward differences. 𝑥 𝑦 𝟏𝟗𝟑𝟏 40.62 Δ𝑦 Δ2 𝑦 Δ3 𝑦 𝚫𝟒 𝒚 20.18 𝟏𝟗𝟒𝟏 60.80 −1.03 19.15 𝟏𝟗𝟓𝟏 79.95 5.49 4.46 23.61 𝟏𝟗𝟔𝟏 103.56 𝟏𝟗𝟕𝟏 132.65 1.02 5.48 29.09 −4.47 To get 𝑓 ′ 1931 and 𝑓′(1941), we use the forward interpolation formula. By the differentiation of 𝑦(𝑥) derived from Newton’s forward interpolation formula, we have 𝑑𝑦 𝑑𝑥 1 = ℎ Δ𝑦0 + 2𝑢−1 2 Δ 𝑦0 2 + 3𝑢2 −6𝑢+2 3 Δ 𝑦0 6 + 4𝑢3 −18𝑢2 +22𝑢−6 4 Δ 𝑦0 24 +⋯ Here 𝑥0 = 1931 and 𝑥1 = 1941 First we find the value of 𝑓 ′ 1931 . So we use the following formula 𝑑𝑦 𝑑𝑥 𝑥=𝑥0 = 𝑑𝑦 𝑑𝑥 𝑢=0 = 1 ℎ 1 2 1 3 Δ𝑦0 − Δ2 𝑦0 + Δ3 𝑦0 − ⋯ So, ⇒ 𝑑𝑦 𝑑𝑥 𝑥=1931 = 10 20.18 − 2 −1.03 + 3 5.49 − 4 (−4.47) 1 1 ⇒ 𝑑𝑦 𝑑𝑥 𝑥=1931 = 2.36425 Also, if 𝑥 = 1941, then 𝑢 = 1 1941−1931 10 1 10 = 10 = 1. Putting 𝑢 = 1 in equation (𝐴), we get 𝑑𝑦 𝑑𝑥 𝑥=1941 = 𝑑𝑦 𝑑𝑥 𝑢=1 1 1 1 1 = 10 20.18 + 2 −1.03 − 6 5.49 + 12 (−4.47) = 1.83775. (𝐴) To get 𝑓 ′ 1961 and 𝑓′(1971), we use the backward interpolation formula. By the differentiation of 𝑦(𝑥) derived from Newton’s backward interpolation formula, we have 𝑑𝑦 𝑑𝑥 1 = ℎ 𝛻𝑦𝑛 + 2𝑣+1 2 𝛻 𝑦𝑛 2 + 3𝑣 2 +6𝑣+2 3 𝛻 𝑦𝑛 6 + 4𝑣 3 +18𝑣 2 +22𝑣+6 4 𝛻 𝑦𝑛 24 +⋯ Here 𝑥𝑛 = 1971 and 𝑥𝑛−1 = 1961 First we find the value of 𝑓 ′ 1931 . So we use the following formula 𝑑𝑦 𝑑𝑥 𝑥=𝑥𝑛 = 𝑑𝑦 𝑑𝑥 𝑣=0 = 1 ℎ 1 2 1 3 𝛻𝑦𝑛 + 𝛻 2 𝑦𝑛 + 𝛻 3 𝑦𝑛 + ⋯ So, ⇒ 𝑑𝑦 𝑑𝑥 𝑥=1971 = 10 29.09 + 2 5.48 + 3 1.02 + 4 (−4.47) 1 1 ⇒ 𝑑𝑦 𝑑𝑥 𝑥=1971 = 3.10525 Also, if 𝑥 = 1961, then 𝑣 = 1 1961−1971 10 = 1 −10 10 = −1. Putting 𝑣 = 1 in equation (𝐵), we get 𝑑𝑦 𝑑𝑥 𝑥=1961 = 𝑑𝑦 𝑑𝑥 𝑣=1 1 1 1 1 = 10 29.09 − 2 5.48 − 6 1.02 − 12 (−4.47) = 2.65525. (𝐵) Examples Example 3:- The table given below reveals the velocity 𝑣 of a body at a time 𝑡 specified. Find its acceleration at 𝑡 = 1.1. 𝒕 𝟏. 𝟎 1.1 𝟏. 𝟐 𝟏. 𝟑 𝟏. 𝟒 𝑣 43.1 47.7 52.1 56.4 60.8 Solution:-𝑣 is dependent on time 𝑡, i.e. 𝑣 = 𝑣(𝑡). We require acceleration = 𝑑𝑣 . 𝑑𝑡 Therefore, we have to find 𝑣 ′ 1.1 . That is, it is a problem of numerical differentiation. 𝒕 𝒗 𝟏. 𝟎 43.1 Δ𝐯 Δ2 𝐯 Δ3 𝐯 𝚫𝟒 𝒗 4.6 𝟏. 𝟏 47.7 −0.2 4.4 𝟏. 𝟐 52.1 0.1 −0.1 4.3 𝟏. 𝟑 56.4 𝟏. 𝟒 60.8 0.2 0.1 4.4 0.1 𝑑𝑣 As 𝑑𝑡 at 𝑡 = 1.1 is require, (nearer to the beginning value), we use forward interpolation formula. By the differentiation of v(𝑡) derived from Newton’s forward interpolation formula, we have 𝑑𝑣 𝑑𝑡 = 1 ℎ Δ𝑣0 + Here 𝑢 = 𝑑𝑣 𝑑𝑡 𝑡=1.1 𝑡−𝑡0 ℎ = 2𝑢−1 2 Δ 𝑣0 2 = 1.1−1 0.1 𝑑𝑣 𝑑𝑡 𝑢=1 + 3𝑢2 −6𝑢+2 3 Δ 𝑣0 6 + 4𝑢3 −18𝑢2 +22𝑢−6 4 Δ 𝑣0 24 +⋯ = 1. 1 1 1 1 = 0.1 4.6 + 2 −0.2 − 6 0.1 + 12 (0.1) = 44.917. (𝐴) NUMERICAL INTEGRATION In this section we will be using Trapezodial rule Simpson’s one – third rule Simpson’s three-eighth rule Trapezoidal Rule Simpson’s One-third Rule Simpson’s Three-eighth Rule Problems THE END