Ch-3 & 4 Solving System of Equations
Ch-3 & 4 Solving System of Equations
1
gives𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1 (4)
′ ′
𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2′ (5)
′ ′
𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3′ (6)
Equation (4) is called the pivotal equationand the coefficient 𝑎11 is the pivot element.
′
Step 2: Eliminate 𝑥2 from the (6) using (5) by assuming𝑎22 ≠ 0.
𝑎′
i.e.,(6) − 𝑎32
′ (5)
22
we get 𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1 (7)
′ ′
𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2′ (8)
′′
𝑎33 𝑥3 = 𝑏3′′ (9)
′′
Here (8) is called the pivotal equationand the coefficient 𝑎22 is the pivot element.
Step 3: To find 𝑥1 , 𝑥2 and 𝑥3 , we apply back substitution starting from Eq. (9) giving 𝑥3 , then
𝑥2 from Eq. (8) and 𝑥1 from Eq. (7).
Pivoting:Gauss elimination method fails if any one of the pivots in the above equations (1) to (9)
becomeszero.To overcome this difficulty, the equations are to be rewritten in a slightly
different order such that the pivotsare not zero.
Partial pivoting method:
Step 1: The numerically largest coefficient of 𝑥1 is selected from all the equations are pivot and
thecorresponding equation becomes the first equation (1).
Step 2: The numerically largest coefficient of 𝑥2 is selected from all the remaining equations as
pivot and thecorresponding equation becomes the second equation (5). This process is repeated
till an equation intoa simple variable is obtained.
Complete pivoting method:In this method, we select at each stage the numerically largest
coefficient of the complete matrix of coefficients.This procedure leads to an interchange of the
equations as well as interchange of the position of variables.
Example: Solve the following equations by Gauss elimination method:
2𝑥 + 4𝑦 – 6𝑧 = – 4
𝑥 + 5𝑦 + 3𝑧 = 10
𝑥 + 3𝑦 + 2𝑧 = 5
Solution:
Solution:
2𝑥 + 4𝑦 – 6𝑧 = – 4 (E.1)
𝑥 + 5𝑦 + 3𝑧 = 10 (E.2)
𝑥 + 3𝑦 + 2𝑧 = 5 (E.3)
To eliminate x from (E.2) and (E.3) using (E.1):
1 1
i.e., (E.2)− 2 (E.1) and (E.3)− 2 (E.1), gives
2𝑥 + 4𝑦 – 6𝑧 = – 4
2
3𝑦 + 6𝑧 = 12 (E.4)
𝑦 + 5𝑧 = 7(E.5)
1
To eliminate 𝑦from (E.5) using (E.4): i.e., i.e., (E.5)− 3 (E.4), we obtain
2𝑥 + 4𝑦 – 6𝑧 = – 4 (E.6)
3𝑦 + 6𝑧 = 12 (E.7)
3𝑧 = 3 (E.8)
Now, Evaluation of the unknowns by back substitution:
from (E.8) 3𝑧 = 3⇒𝑧 = 1, from (E.7) 3𝑦 + 6(1) = 12
⇒3𝑦 = 12 − 6 = 6
⇒𝑦 = 2 and
from (E.6), 2𝑥 + 4(2) – 6(1) = – 4
⇒2𝑥 = −4 − 8 + 6 = −6
⇒𝑥 = −3.
Exercise: Use the method of Gaussian elimination to solve the following system of linear
equations:
2 x 4 y z 1 𝑥1 + 𝑥2 + 𝑥3 – 𝑥4 = 2
4𝑥1 + 4𝑥2 + 𝑥3 + 𝑥4 = 11
a) x 2 y 3z 2 c) {
x y z 1 𝑥1 – 𝑥2 – 𝑥3 + 2𝑥4 = 0
2𝑥 + 𝑥 + 2𝑥 – 2𝑥 = 2
1 2 3 4
x 2 y z 1
b) x y z 4
x 2 y 4 z 8
(ii) LU decomposition method
It is possible to show that any square matrix 𝐴can be expressed as a productof a lower triangular
matrix 𝐿and an upper triangular matrix 𝑈.
𝐴 = 𝐿𝑈
For instance
𝑎11 𝑎12 𝑎13 𝐿11 0 0 𝑈11 𝑈12 𝑈13
𝑎
( 21 𝑎22 𝑎23 ) = (𝐿21 𝐿22 0 )( 0 𝑈22 𝑈23 )
𝑎31 𝑎32 𝑎33 𝐿31 𝐿32 𝐿33 0 0 𝑈33
The process of computing 𝐿and 𝑈for a given 𝐴is known as LU-Decomposition or LU-
Factorization. LU-decomposition is not unique (the combinations of 𝐿and 𝑈for a prescribed
𝐴 are endless), unless certain constraints are placed on 𝐿or 𝑈. These constraints distinguish
onetype of decomposition from another.
The three decomposition methods are given below:
3
1. Doolittle’s decomposition: Constraints are𝐿𝑖𝑖 = 1,
2. Crout’s decomposition: Constrains are𝑈𝑖𝑖 = 1 and
3. Cholesky’s decomposition: Constraints are 𝐿 = 𝑈 𝑇 for 𝑖 = 1, 2, 3, … , 𝑛.
After decomposing the matrix 𝐴, it is easier to solve the equations 𝐴𝑥 = 𝑏.We can rewrite the
equations as𝐿𝑈𝑥 = 𝑏
or denoting 𝑈𝑥 = 𝑣, the above equation becomes
𝐿𝑣 = 𝑏
This equation 𝐿𝑣 = 𝑏can be solved for vby forward substitution. Then 𝑈𝑥 = 𝑣will yield 𝑥by
thebackward substitution process. The advantage of LU decomposition method over the Gauss
eliminationmethod is that once 𝐴is decomposed, we can solve 𝐴𝑥 = 𝑏for as many constant
vectors 𝑏as we please.Also, the forward and backward substitutions operations are much less
time consuming than thedecomposition process.
Doolittle’s Method: This method is based on the fact that every square matrix A can be
expressed as the product of a lowertriangular matrix and an upper triangular matrix, provided all
the principle minors of A are non-singular. Also,such a factorization, if exists, is unique.
Method: Decomposes𝐴 to 𝐿 and 𝑈
𝑈 is the same as the coefficient matrix at the end of the forward elimination step.
𝐿is obtained using the multipliers that were used in the forward elimination process.
Consider the system of linear equations:
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3
Finding the 𝑼 matrix: Using the Forward Elimination Procedure of Gauss Elimination, we get
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
′ ′
𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2′
′′
𝑎33 𝑥3 = 𝑏3′′
𝑎11 𝑎12 𝑎13
′ ′
Thus, 𝑈 = [ 0 𝑎22 𝑎23 ]
′′
0 0 𝑎33
Finding the 𝑳 matrix: Using the multipliers used during the Forward Elimination Procedure
From the first step of forward elimination
4
𝑎11 𝑎12 𝑎13 𝑎31
𝐿31 =
(𝑎21 𝑎22 𝑎23 ) 𝑎11
𝑎31 𝑎32 𝑎33
𝑎
⇒𝐿21 = 𝑎21 and
11
2 1 4 𝑥 12
𝑦
We have, 𝐴 = (8 −3 2 ), 𝑥 = ( ) and 𝑏 = (20)
4 11 −1 𝑧 33
2 1 4 ⇒ 𝑅2 → 𝑅2 − 4𝑅1 2 1 4
𝐴 = (8 −3 2 ) (0 −7 −14)
4 11 −1 𝑅3 → 𝑅3 − 2𝑅1 0 9 −9
2 1 4
−9 −9
𝑅3 → 𝑅3 − 7
𝑅2 (0 −7 −14)⇒𝐿32 = 7 .
0 0 −27
5
1 0 0 2 1 4
Thus, 𝐿 = (4 1 0) and 𝑈 = (0 −7 −14)
2 −9⁄7 1 0 0 −27
1 0 0 𝑣1 12
Writing: 𝐿𝑣 = 𝑏, we get ( 4 1 0) (𝑣2 ) = (20) by forward elimination which gives
2 −9⁄7 1 𝑣3 33
9
𝑣1 = 12, ⇒4𝑣1 + 𝑣2 = 20⇒𝑣2 = 20 − 4(12) = −28 and 2𝑣1 − 7 𝑣2 + 𝑣3 = 33
9
⇒𝑣3 = 33 − 2(12) + 7 (−28)⇒𝑣3 = 33 − 24 − 36 = −27.
2 1 4 𝑥 12
(0 −7 −14) (𝑦) = (−28)
0 0 −27 𝑧 −27
2𝑥 + 𝑦 + 4𝑧 = 12
⇒ −7𝑦 − 14𝑧 = −28}, then by back substitutation 𝑧 = 1, 𝑦 = 2 and 𝑥 = 3.
−27𝑧 = −27
Exercise:Applying (a) Crouts’ method (b) triangularization method solves the ff equations.
2𝑥1 + 𝑥2 + 𝑥3 = 7 c) 10𝑥 + 𝑦 + 𝑧 = 122𝑥 + 10𝑦 +
a) 𝑥1 + 2𝑥2 + 𝑥3 = 8 𝑧 = 132𝑥 + 2𝑦 + 10𝑧 = 14
𝑥1 + 𝑥2 + 2𝑥3 = 9
d) 2𝑥 – 6𝑦 + 8𝑧 = 245𝑥 +
b) 3𝑥 + 2𝑦 + 7𝑧 = 42𝑥 + 3𝑦 + 4𝑦 – 3𝑧 = 23𝑥 + 𝑦 + 2𝑧 = 16
𝑧 = 53𝑥 + 4𝑦 + 𝑧 = 7
Exercise: An electrical engineer supervises the production of three types of electrical
components. Three kinds of material-metal, plastic, and rubber—are required for production.
The amounts needed to produce each component are
Component Metal (𝑔/component) Plastic (𝑔/component) Rubber (𝑔/component)
1 15 0.25 1.0
2 17 0.33 1.2
3 19 0.42 1.6
If totals of 2.12, 0.0434, and 0.164 𝑘𝑔 of metal, plastic, andrubber, respectively, are available
each day, how many components can be produced per day?
2. Iterative or indirect methods: An iterative technique to solve the 𝑛 𝑥 𝑛linear system
𝐴𝑥 = 𝑏 starts with an initial approximation 𝑥 (0) to the solution 𝑥 and generates a sequence
∞
ofvectors {𝑥 (𝑘) }𝑘=1 thatconverges to 𝑥. Iterative techniques involve a process that converts the
system 𝐴𝑥 = 𝑏 intoan equivalent system of the form 𝑥 = 𝐶𝑥 + 𝑑for some fixed matrix𝐶and
6
vector 𝑑.After the initial vector 𝑥 (0) is selected, the sequence of approximate solution vectors is
generated by computing 𝑥 (𝑘) = 𝐶𝑥 (𝑘−1) + 𝑑, for each 𝑘 = 1,2,3, . . .. and 𝐶𝑖𝑖 = 0.
Convergence Criterion
𝑥𝑖𝑘 −𝑥𝑖𝑘−1
1. 𝜀𝑎,𝑖 = | | × 100% < 𝜀 for all 𝑥𝑖
𝑥𝑖𝑘
2. Norm of the residual vector |𝐴𝑥 − 𝑏| < 𝜀
Convergence and Diagonal Dominant
Sufficient condition -𝐴 is diagonally dominant. In other words, the solution will exist
(iterating will converge) if the absolute values of the leading diagonal elements of the
coefficient matrix 𝐴 of the system 𝐴𝑥 = 𝑏 are greater than thesum of absolute values of
the other coefficients of that row.
Necessary and sufficient condition-The magnitude of the largest eigenvalue of 𝐶(not 𝐴) is
less than 1.
(i) Jacobi’s Method
The Jacobi iterative methodis obtained by solving the 𝑖 𝑡ℎ equation in 𝐴𝑥 = 𝑏for 𝑥𝑖 to
obtain (provided𝑎𝑖𝑖 ≠ 0)
𝑎𝑖𝑗 𝑥𝑗 𝑏
𝑥𝑖 = ∑𝑛𝑗=1 (− ) + 𝑎 𝑖 , for 𝑖 = 1, 2, … , 𝑛.
𝑎𝑖𝑖 𝑖𝑖
𝑗≠𝑖
(𝑘)
For each 𝑘 ≥ 1, generate the components 𝑥𝑖 of 𝒙(𝑘) from the components of𝒙(𝑘−1) by
(𝑘) 1 (𝑘−1)
𝑥𝑖 = 𝑎 [∑𝑛𝑗=1(−𝑎𝑖𝑗 𝑥𝑗 ) + 𝑏𝑖 ], for 𝑖 = 1, 2, … , 𝑛. …….(*)
𝑖𝑖
𝑗≠𝑖
(ii) Gauss Seidel Method
A possible improvement in Jacobi’s Method can be seen by reconsidering Eq. (*). The
(𝑘)
components of 𝑥 (𝑘−1) ) are used to compute all the components𝑥𝑖 of𝒙(𝑘) . But, for 𝑖 > 1,
(𝑘) (𝑘)
the components𝑥1 , … , 𝑥𝑖−1of 𝒙(𝑘) have already been computed and are expected to be
(𝑘−1) (𝑘−1)
better approximations to the actual solutions𝑥1 , … , 𝑥𝑖−1 than are𝑥1 , … , 𝑥𝑖−1 . It
(𝑘)
seemsreasonable, then, to compute𝑥𝑖 using these most recently calculated values. That is, to use
(𝑘) 1 (𝑘) (𝑘−1)
𝑥𝑖 = 𝑎 [− ∑𝑖−1 𝑛
𝑗=1(𝑎𝑖𝑗 𝑥𝑗 ) − ∑𝑗=𝑖+1(𝑎𝑖𝑗 𝑥𝑗 ) + 𝑏𝑖 ], for 𝑖 = 1, 2, … , 𝑛, instead of Eq. (*).
𝑖𝑖
This modification is called the Gauss-Seideliterative technique.
(iii) SOR method
Starting from Gauss-Seidel method, we introduce the successive over-relaxation method (or
SOR method)
(𝑘) 𝜔 (𝑘) (𝑘−1) (𝑘−1)
𝑥𝑖 = 𝑎 [𝑏𝑖 − ∑𝑖−1 𝑛
𝑗=1(𝑎𝑖𝑗 𝑥𝑗 ) − ∑𝑗=𝑖+1(𝑎𝑖𝑗 𝑥𝑗 )] + (1 − 𝜔)𝑥𝑖 , for 𝑖 = 1, 2, … , 𝑛.
𝑖𝑖
It is consistent for any0 < 𝜔 < 2 and for𝜔 = 1 it coincides with Gauss-Seidelmethod. In
particular, if 𝜔 ∈ (0, 1) the method is called under-relaxation,while if 𝜔 > 1 it is called over-
relaxation.The idea is to choose avalue for 𝜔that will accelerate the rate of convergence of the
iterates to the solution.
7
Example:Solve the following equations by Gauss-Seidel and SOR (for 𝜔 = 1.2, 1.5, 1.8)method
correct to two decimal places.
15𝑥 + 3𝑦 – 2𝑧 = 85 10𝑥1 − 2𝑥2 − 𝑥3 − 𝑥4 = 3
a) {2𝑥 + 10𝑦 + 𝑧 = 51 −2𝑥1 + 10𝑥2 − 𝑥3 − 𝑥4 = 15
c) {
𝑥 – 2𝑦 + 8𝑧 = 5 −𝑥1 − 𝑥2 + 10𝑥3 − 2𝑥4 = 27
𝑥 + 2𝑦 + 𝑧 = 0 −𝑥1 − 𝑥2 − 2𝑥3 + 10𝑥4 = −9
b) { 3𝑥 + 𝑦– 𝑧 = 0
𝑥– 𝑦 + 4𝑧 = 3
Solution:
Note 1: Iterative methods are generally less efficient than direct methods due to the large number
of operations or iterations required.
Note 2: Iterative procedures are self-correcting, meaning that round off errors (or even arithmetic
mistakes) in one iteration cycle is corrected in subsequent cycles and the solution contains
truncation error.
Note 3: A serious drawback of iterative methods is that they do not always converge to the
solution.
Note 4: The initial guess affects only the number of iterations that are required for convergence.
3.2 System of Non-Linear Equations Using Newton’s method
A system of nonlinear equations has the form
𝑓1 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0
𝑓2 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0
} ……… (1)
⋮
𝑓𝑛 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0
where at least one 𝑓𝑖 is non linear equation.
𝑇
(𝑘) (𝑘) (𝑘)
Now, starting with the initial approximations 𝒙(𝟎) = (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) , we obtain the
sequence of iterates using Newton Raphson method as
𝒙(𝒌+𝟏) = 𝒙(𝒌) − 𝐽−1 𝒇(𝒌) , 𝑘 = 0, 1, 2, …
𝑇
(𝑘) (𝑘) (𝑘) (𝑘) (𝑘) (𝑘) (𝒌) (𝑘) (𝑘) (𝑘)
where𝒙(𝒌) = (𝑥1 , 𝑥2 , … , 𝑥𝑛 ) , 𝒇(𝒌) = (𝑓1 , 𝑓2 , … , 𝑓𝑛 )𝑇 , 𝒇𝒊 = 𝑓𝑖 (𝑥1 , 𝑥2 , … , 𝑥𝑛 ),
𝜕𝑓1 𝜕𝑓1 𝜕𝑓1
(𝒙) (𝒙) ⋯ 𝜕𝑥𝑛
(𝒙)
𝜕𝑥1 𝜕𝑥2
𝜕𝑓2 𝜕𝑓2 𝜕𝑓2
and 𝐽 = (𝒙) (𝒙) ⋯ 𝜕𝑥𝑛
(𝒙)
.
𝜕𝑥1 𝜕𝑥2
⋮ ⋮ ⋮ ⋮
𝜕𝑓𝑛 𝜕𝑓𝑛 𝜕𝑓𝑛
[𝜕𝑥 (𝒙)
1 𝜕𝑥2
(𝒙) ⋯ 𝜕𝑥
(𝒙)]
𝑛
𝑥 2 + 𝑦 2 = 1.12
Example: Solve the system { correct to three decimal places.
𝑥𝑦 = 0.23
Solution: From the system
𝜕𝑓 𝜕𝑓1
𝑓1 (𝑥, 𝑦) = 𝑥 2 + 𝑦 2 − 1.12⇒ 𝜕𝑥1 = 2𝑥, = 2𝑦
𝜕𝑦
𝜕𝑓 𝜕𝑓1
𝑓2 (𝑥, 𝑦) = 𝑥𝑦 − 0.23⇒ 𝜕𝑥2 = 𝑦, =𝑥
𝜕𝑦
8
2𝑥 2𝑦 1 𝑥 −2𝑦
⇒we have the Jacobian matrix 𝐽(𝑥, 𝑦) = [ ]⇒𝐽−1 (𝑥, 𝑦) = 2(𝑥 2 −𝑦 2 ) [ ]
𝑦 𝑥 −𝑦 2𝑥
Now using the method 𝒙(𝒌+𝟏) = 𝒙(𝒌) − 𝐽−1 𝒇(𝒌) 𝑦(2) = 1 10 51 − 2𝑥 1 − 𝑧 1 = 3.904 𝑧(2) = 1 8 5 − 𝑥 1
+ 2𝑦 1 = 1.192 Iteration 3: when 𝑘 = 3 𝑥(3) = 1 15 85 − 3𝑦 2 + 2𝑧 2 = 5.045 𝑦(3) = 1 10 51 − 2𝑥 2 − 𝑧
2 = 4.035 𝑧(3) = 1 8 5 − 𝑥 2 + 2𝑦 2 = 1.010
9
point on the curve corresponding to argument 𝑥and obtain the corresponding entry value 𝑦.
This method is not reliable most of the cases.
2. Method of curve fitting: -This method can be used only in those cases in which theform of
the function in known. This method is not exact and becomes more complicatedwhen the
number of observations is sufficiently large. The only merit of this method liesin the fact that
it gives closer approximation than the graphical method.
3. Use the finite differences: -The study of finite differences for the purpose of interpolation
can be divided into three parts.
(a) The technique of interpolation with equal intervals.
(b) The technique of interpolation with unequal intervals.
(c) The technique of central differences.
These methods are less approximate than the others and do not assume the form of thefunction to
be known. On using the method of calculus of finite difference, the calculationsremain simple
even if some additional observations are included in the given data.
Finite differences: - Let 𝑦 = 𝑓(𝑥) be a function tabulated for the equally spaced values or
argument𝑎 = 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ, … , 𝑥0 + 𝑛ℎ = 𝑏, where ℎis the increment given to the
independent variable offunction 𝑦 = 𝑓(𝑥). To determine the values of function 𝑦 = 𝑓(𝑥) for
given intermediate or argumentvalues of 𝑥, three types of differences are useful:
Forward or Leading Differences
If we subtract from each value of 𝑦except 𝑦0 , the previous value of 𝑦, we have𝑦1 − 𝑦0 , 𝑦2 −
𝑦1 , 𝑦3 − 𝑦2 … , 𝑦𝑛 − 𝑦𝑛−1.These differences are called the first forward differencesof 𝑦and is
denoted by ∆𝑦. The symbol ∆ denotes the forward difference operator. That is,
∆𝑦0 = 𝑦1 − 𝑦0
∆𝑦1 = 𝑦2 − 𝑦1
∆𝑦2 = 𝑦3 − 𝑦2
………………….
∆𝑦𝑛−1 = 𝑦𝑛 − 𝑦𝑛−1
Also it can be written as,
∆𝑓(𝑥) = 𝑓(𝑥 + ℎ) − 𝑓(𝑥)
where ℎis the interval of differencing.
Similarly for second and higher order differences,
∆2 𝑦0 = ∆𝑦1 − ∆𝑦0
∆2 𝑦1 = ∆𝑦2 − ∆𝑦1
………………………
∆2 𝑦𝑛−1 = ∆𝑦𝑛 − ∆𝑦𝑛−1
Or ∆3 𝑦0 = ∆2 𝑦1 − ∆2 𝑦0
∆3 𝑦1 = ∆2 𝑦2 − ∆2 𝑦1
……………………...
∆ 𝑦𝑛−1 = ∆2 𝑦𝑛 − ∆2 𝑦𝑛−1
3
10
∆𝑛 𝑦𝑟−1 = ∆𝑛−1 𝑦𝑟 − ∆𝑛−1 𝑦𝑟−1
∆𝑛 𝑓(𝑥) = ∆𝑛−1 𝑓(𝑥 + ℎ) − ∆𝑛−1 𝑓(𝑥)
Forward difference table:
𝑥 𝑦 ∆ ∆2 ∆3 ∆4
𝑥0 𝑦0
∆𝑦0
𝑥1 𝑦1 ∆2 𝑦0
∆𝑦1 ∆3 𝑦0
𝑥2 𝑦2 ∆2 𝑦1 ∆4 𝑦0
3
∆𝑦2 ∆ 𝑦1
𝑥3 𝑦3 ∆2 𝑦2
∆𝑦3
𝑥4 𝑦4
11
Backward difference table:
𝑥 𝑦 ∇ ∇2 ∇3 ∇4
𝑥0 𝑦0
∇𝑦1
𝑥1 𝑦1 ∇2 𝑦2
∇𝑦2 ∇3 𝑦3
𝑥2 𝑦2 ∇2 𝑦3 ∇4 𝑦4
3
∇𝑦3 ∇ 𝑦4
2
𝑥3 𝑦3 ∇ 𝑦4
∇𝑦4
𝑥4 𝑦4
where, 𝑥1 = 𝑥0 + ℎ, 𝑥2 = 𝑥0 + 2ℎ, … . , 𝑥𝑛 = 𝑥0 + 𝑛ℎ.
Example: Construct the backward difference table for 𝑦 = log 𝑥 given that:
𝑥 10 20 30 40 50
𝑦 1 1.3010 1.4771 1.6021 1.6990
and find the values of ∇3 log 40 and ∇4 log 50.
The operator 𝑬: The operator 𝐸 is called shift operator or displacement or translation operator.
It shows the operation of increasing the argument value 𝑥by its interval of differencingℎso that
𝐸𝑓(𝑥) = 𝑓(𝑥 + ℎ) or 𝐸𝑦𝑥 = 𝑦𝑥+ℎ
Similarly,𝐸𝑓(𝑥 + ℎ) = 𝑓(𝑥 + 2ℎ)
...............................................................
In general,𝐸 𝑦𝑥 = 𝑦𝑥+𝑛ℎ or 𝐸 𝑛 𝑓(𝑥) = 𝑓(𝑥 + 𝑛ℎ)
𝑛
12
Theorem:-If 𝑓(𝑥) be the 𝑛𝑡ℎ degree polynomial in 𝑥, then the 𝑛𝑡ℎ difference of 𝑓(𝑥) is constant
and∆𝑛+1 𝑓(𝑥)and all higher differences are zero when the values of the independent variables are
atequal interval.
Interpolation with equal intervals
1. Newton Forward Interpolation Formula
Let 𝑦 = 𝑓(𝑥) be a given function of 𝑥which takes the value 𝑓(𝑥0 ), 𝑓(𝑥0 + ℎ), 𝑓(𝑥0 + 2ℎ),
. . ., 𝑓(𝑥0 + 𝑛ℎ) for(𝑛 + 1) equally spaced values 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ, … , 𝑥0 + 𝑛ℎof
theindependent variable 𝑥. Assume that𝑓(𝑥) be a polynomial of 𝑛𝑡ℎ degree, given by
𝑓(𝑥) = 𝑎0 + 𝑎1 (𝑥 − 𝑥0 ) + 𝑎2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) + ⋯ + 𝑎𝑛 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑛−1 ) … (1)
and 𝑓(𝑥𝑖 ) = 𝑦𝑖 for 𝑖 = 0, 1, … , 𝑛.
Where 𝑎0 , 𝑎1 , … , 𝑎𝑛 are to be determined. Now to find the values of𝑎0 , 𝑎1 , … , 𝑎𝑛 :
put 𝑥 = 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ, … , 𝑥0 + 𝑛ℎin equation (1) successively.
Therefore for 𝑥 = 𝑥0 , 𝑓(𝑥0 ) = 𝑎0
for 𝑥 = 𝑥0 + ℎ, 𝑓( 𝑥0 + ℎ) = 𝑓(𝑥1 ) = 𝑎0 + 𝑎1 ( 𝑥0 + ℎ − 𝑥0 ) + 0 = 𝑎0 + ℎ𝑎1
𝑓( 𝑥0 + ℎ) − 𝑎0 𝑓( 𝑥0 + ℎ) − 𝑓(𝑥0 ) ∆𝑓( 𝑥0 )
⇒ 𝑎1 = = =
ℎ ℎ ℎ
for 𝑥 = 𝑥0 + 2ℎ, 𝑓(𝑥0 + 2ℎ) = 𝑓(𝑥2 ) = 𝑎0 + 𝑎1 (𝑥0 + 2ℎ − 𝑥0 ) + 𝑎2 (𝑥0 + 2ℎ − 𝑥0 )(𝑥0 +
2ℎ − (𝑥0 + ℎ)) + 0
⇒ 𝑓(𝑥0 + 2ℎ) = 𝑎0 + 𝑎1 (2ℎ) + 𝑎2 (2ℎ)(ℎ)
𝑓(𝑥0 + 2ℎ) − 𝑎0 − 𝑎1 (2ℎ) 𝑓(𝑥0 + 2ℎ) − 𝑓(𝑥0 ) − 2∆𝑓(𝑥0 )
⇒ 𝑎2 = =
2ℎ2 2ℎ2
𝑓(𝑥0 + 2ℎ) − 𝑓(𝑥0 ) − 2(𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 ))
⇒ 𝑎2 =
2ℎ2
𝑓(𝑥0 + 2ℎ) − 𝑓(𝑥0 ) − 2𝑓(𝑥0 + ℎ) + 2𝑓(𝑥0 ) 𝑓(𝑥0 + 2ℎ) − 2𝑓(𝑥0 + ℎ) + 𝑓(𝑥0 )
⇒ 𝑎2 = =
2ℎ2 2ℎ2
2 2
∆ 𝑓(𝑥0 ) ∆ 𝑓(𝑥0 )
⇒ 𝑎2 = =
2ℎ2 2! ℎ2
∆3 𝑓(𝑥0 ) ∆𝑛 𝑓(𝑥0 )
Similarly, ⇒ 𝑎3 = , … , 𝑎𝑛 =
3!ℎ3 𝑛!ℎ𝑛
Put the values of 𝑎0 , 𝑎1 , … , 𝑎𝑛 , in the equation (1), we get
∆𝑓( 𝑥0 ) ∆2 𝑓(𝑥0 )
𝑓(𝑥) = 𝑓(𝑥0 ) + (𝑥 − 𝑥0 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) + ⋯
ℎ 2! ℎ2
∆𝑛 𝑓(𝑥0 )
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑛−1 )
𝑛! ℎ𝑛
𝑥−𝑥
Again, put 𝑥 = 𝑥0 + ℎ𝑢 ⇒ 𝑢 = ℎ 0, we have
(𝑥 − 𝑥0 ) ∆2 𝑓(𝑥0 ) (𝑥 − 𝑥0 ) 𝑥 − 𝑥0 ) ℎ
𝑓(𝑥) = 𝑓(𝑥0 ) + ∆𝑓( 𝑥0 ) + ( − )+⋯
ℎ 2! ℎ ℎ ℎ
∆𝑛 𝑓(𝑥0 ) (𝑥 − 𝑥0 ) 𝑥 − 𝑥0 ℎ 𝑥 − 𝑥0 (𝑛 − 1)ℎ
+ ( − )…( − )
𝑛! ℎ ℎ ℎ ℎ ℎ
∆2 𝑓(𝑥0 ) ∆𝑛 𝑓(𝑥0 )
𝑓(𝑥) = 𝑓(𝑥0 ) + 𝑢𝑝∆𝑓( 𝑥0 ) + 𝑢(𝑢 − 1) + ⋯ + 𝑢(𝑢 − 1) … (𝑢 − (𝑛 − 1)
2! 𝑛!
13
which is required formula for forward interpolation.
This formula is useful for interpolating the values of 𝑓(𝑥) near the starting of the set of values
given and is applicablefor equally spaced argument only.
Example 1: second degree polynomial passes through the points (1, – 1), (2, – 2), (3, – 1) and
(4, 2). Find the polynomial and evaluate 𝑦 at 𝑥 = 0.
Example 2:The following table gives the distance in nautical miles of the visible horizon for the
given heights in feet above the earth’s surface.
𝑥 100 150 200 250 300 350 400
𝑦 10.63 13.03 15.04 16.81 18.42 19.9 21.27
Use Newton’s forward formula to find 𝑦 when 𝑥 = 218 𝑓𝑡.
Example 3: Find 𝑒 3𝑥 for 𝑥 = 0.05 using the following table
𝑥 0 0.1 0.2 0.3 0.4
3𝑥 1
𝑒 1.3499 1.8221 2.4596 3.3201
Example 4: Find the cubic polynomial which takes the following data:
𝑥 0 1 2 3
𝑦 = 𝑓(𝑥) 1 0 1 10
Example 5: Given that√12600 = 112.24972, √12610 = 112.29426, √12620 = 112.33877
and √12630 = 112.38327. Findthe value of 12616 .
2. Newton Backward Interpolation Formula
Let 𝑦 = 𝑓(𝑥) be a given function of 𝑥which takes the value 𝑓(𝑥0 ), 𝑓(𝑥0 + ℎ), 𝑓(𝑥0 + 2ℎ),
. . ., 𝑓(𝑥0 + 𝑛ℎ) for (𝑛 + 1) equally spaced values 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ, … , 𝑥0 + 𝑛ℎof the
independent variable 𝑥. Assume that 𝑓(𝑥) be a polynomial of 𝑛𝑡ℎ degree, given by
𝑓(𝑥) = 𝑎0 + 𝑎1 (𝑥 − 𝑥𝑛 ) + 𝑎2 (𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 ) + ⋯ + 𝑎𝑛 (𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 ) … (𝑥 − 𝑥0 )(*)
and 𝑓(𝑥𝑖 ) = 𝑦𝑖 for 𝑖 = 0, 1, … , 𝑛.
Where 𝑎0 , 𝑎1 , … , 𝑎𝑛 are to be determined. Now to find the values of 𝑎0 , 𝑎1 , … , 𝑎𝑛 :
Put𝑥 = 𝑥0 + 𝑛ℎ, (𝑛 − 1)ℎ, 𝑥0 + (𝑛 − 2)ℎ, … , 𝑥0 in (*) respectively, we get
Therefore for 𝑥 = 𝑥𝑛 , 𝑓(𝑥𝑛 ) = 𝑎0
for 𝑥 = 𝑥0 + (𝑛 − 1)ℎ, 𝑓( 𝑥0 + (𝑛 − 1)ℎ) = 𝑓(𝑥𝑛−1 ) = 𝑎0 + 𝑎1 ( 𝑥0 + (𝑛 − 1)ℎ − 𝑥𝑛 ) + 0
𝑓( 𝑥0 + (𝑛 − 1)ℎ) − 𝑓(𝑥𝑛 ) 𝑓( 𝑥𝑛 ) − 𝑓(𝑥𝑛−1 ) 𝛻𝑓(𝑥𝑛 ) 𝛻 𝑦𝑛
⇒ 𝑎1 = = = =
−ℎ ℎ ℎ ℎ
Similarly,
∇2 𝑓( 𝑥𝑛 ) ∇2 𝑦𝑛 ∇𝑛 𝑓( 𝑥𝑛 ) ∇𝑛 𝑦𝑛
𝑎2 = = , … , 𝑎𝑛 = =
2! ℎ2 2! ℎ2 𝑛! ℎ𝑛 𝑛! ℎ𝑛
Substituting the vaues in (*) and let 𝑥 = 𝑥𝑛 + 𝑣ℎ, we obtain
∇2 𝑓( 𝑥𝑛 ) ∇𝑛 𝑓( 𝑥𝑛 )
𝑓(𝑥) = 𝑓(𝑥𝑛 ) + 𝑣𝛻𝑓(𝑥𝑛 ) + 𝑣(𝑣 + 1) + ⋯ + 𝑣(𝑣 + 1) … (𝑣 + 𝑛 − 1)
2! 𝑛!
This formula is called the Newton’s backward interpolation formula and usedfor interpolating
values of 𝑦near the end of the tabulated values, and also used for extrapolating values of𝑦a little
backward of 𝑦𝑛 .
Example 1: The table below gives the value of 𝑡𝑎𝑛𝑥 for 0.10 ≤ 𝑥 ≤ 0.30
14
𝑥 0.10 0.15 0.20 0.25 0.30
𝑡𝑎𝑛𝑥 0.1003 0.1511 0.2027 0.2553 0.3093
Find
(a) 𝑡𝑎𝑛0.50 (b) 𝑡𝑎𝑛0.26 (c) 𝑡𝑎𝑛0.40
Example 2: The area 𝐴 of a circle of diameter 𝑑 is given for the following values:
𝑑 80 85 90 95 100
𝐴 5026 5674 6362 7088 7854
Find 𝐴 for 105.
Example 3: Find the 4th degree polynomial which takes the following values using NBIF and
evaluate at 𝑥 = 10.
𝑥 0 2 4 6 8
𝑓(𝑥) 1 2 1 10 9
15
∏ (𝑥−𝑥 )
𝑙𝑖 (𝑥) = ∏ 0≤𝑘≤𝑛;𝑘≠𝑖(𝑥 −𝑥𝑘 ) for 𝑖 = 0, 1, … , 𝑛.
0≤𝑘≤𝑛;𝑘≠𝑖 𝑖 𝑘
16
𝑓(𝑥2 ) − 𝑓(𝑥3 )
𝑓(𝑥2 , 𝑥3 ) =
𝑥2 − 𝑥3
The second divided differences for the arguments𝑥0 , 𝑥1 , 𝑥2 , … is defined as
𝑓(𝑥0 , 𝑥1 ) − 𝑓(𝑥1 , 𝑥2 )
𝑓(𝑥0 , 𝑥1 , 𝑥2 ) =
𝑥0 − 𝑥2
Similarly the third divided differences for the arguments 𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 , …is defined as
𝑓(𝑥0 , 𝑥1 , 𝑥2 ) − 𝑓(𝑥1 , 𝑥2 , 𝑥3 )
𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ) =
𝑥0 − 𝑥3
The first divided differences are called the divided differences of order one; the second divided
differences are called the divided differences of order two, etc.
The divided difference table:
𝑥 𝑓(𝑥) ⍋𝑓(𝑥) ⍋2 𝑓(𝑥) ⍋3 𝑓(𝑥)
𝑥0 𝑓(𝑥0 )
𝑓(𝑥0 , 𝑥1 )
𝑥1 𝑓(𝑥1 ) 𝑓(𝑥0 , 𝑥1 , 𝑥3 )
𝑓(𝑥1 , 𝑥2 ) 𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 )
𝑥2 𝑓(𝑥2 ) 𝑓(𝑥1 , 𝑥2 , 𝑥3 )
𝑓(𝑥2 , 𝑥3 )
𝑥3 𝑓(𝑥3 )
Derivation of NDDIF: Let a function 𝑓(𝑥) be given for the (𝑛 + 1) values 𝑥0 , 𝑥1 , … , 𝑥𝑛 as
𝑓(𝑥0 ), 𝑓(𝑥1 ), … , 𝑓(𝑥𝑛 )where 𝑥0 , 𝑥1 , … , 𝑥𝑛 are not necessarily equispaced. From the definition of
divided difference
𝑓(𝑥) − 𝑓(𝑥0 )
𝑓(𝑥, 𝑥0 ) =
𝑥 − 𝑥0
⇒ 𝑓(𝑥) = 𝑓(𝑥0 ) +(𝑥 − 𝑥0 )𝑓(𝑥, 𝑥0 ) ……. (1)
𝑓(𝑥, 𝑥0 ) − 𝑓(𝑥0 , 𝑥1 )
𝑓(𝑥, 𝑥0 , 𝑥1 ) =
𝑥 − 𝑥1
∴ 𝑓(𝑥, 𝑥0 ) = 𝑓(𝑥0 , 𝑥1 ) +(𝑥 − 𝑥1 )𝑓(𝑥, 𝑥0 , 𝑥1 )
Substituting in (1) we get
𝑓(𝑥) = 𝑓(𝑥0 ) +(𝑥 − 𝑥0 )𝑓(𝑥0 , 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓(𝑥, 𝑥0 , 𝑥1 )
Proceeding in this way we get
𝑓(𝑥) = 𝑓(𝑥0 ) +(𝑥 − 𝑥0 )𝑓(𝑥, 𝑥0 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓(𝑥, 𝑥0 , 𝑥1 ) + ⋯ + (𝑥 − 𝑥0 )(𝑥 −
𝑥1 ) … (𝑥 − 𝑥𝑛−1 )𝑓(𝑥, 𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛−1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑛 )𝑓(𝑥, 𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 )
.... (2)
𝑡ℎ
If 𝑓(𝑥) is a polynomial of degree n, then the(𝑛 + 1) divided differences of 𝑓(𝑥) will be zero.
∴ 𝑓(𝑥, 𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 ) = 0.
∴ Equation (2) can be written as
𝑓(𝑥) = 𝑓(𝑥0 ) + (𝑥 − 𝑥0 )𝑓(𝑥0 , 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓(𝑥0 , 𝑥1 , 𝑥2 ) + ⋯ + (𝑥 − 𝑥0 )(𝑥 −
𝑥1 ) … (𝑥 − 𝑥𝑛−1 )𝑓(𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 ) ….. (3)
∴ Equation (3) is called Newton’s General divided difference interpolation formula.
17
Example 1:Apply Newton’s divided difference formula to find the value of 𝑓(8) if
𝑓(1) = 3, 𝑓(3) = 31, 𝑓(6) = 223, 𝑓(10) = 1011, 𝑓(11) = 1343.
Example 2: Find the third divided difference with arguments 2, 4, 9, 10 of the function 𝑓(𝑥) =
𝑥 3 − 2𝑥.
Example 3: The mode of a certain frequency Curve 𝑦 = 𝑓(𝑥) is very near to 𝑥 = 9 and the
valuesof frequency density 𝑓(𝑥) for 𝑥 = 8.9, 9.0 and 9.3 are respectively equal to 0.30, 0.35
and 0.25. Calculatethe approximate value of mode.
Note: The divided differences are symmetrical in their arguments that are independent of the
order of the arguments.
𝑦 −𝑦 𝑦 −𝑦
i.e. [𝑥0 , 𝑥1 ] = 𝑥0−𝑥1 = 𝑥1 −𝑥0 = [𝑥1 , 𝑥0 ]
0 1 1 0
18