DAYANANDA SAGAR COLLEGE OF ENGINERING
DEPARTMENT OF MATHEMATICS
Staff Incharge: D.R. SASI REKHA
Linear Algebra
Solution of a system of non – homogenous equation:
Gauss elimination method:
This method is illustrated by considering a system of three independent equations in three
unknowns. The method is very much similar to the method we employed in solving a system
of equation by testing its consistency.
In this method, the unknowns are eliminated successively and the system is reduced to an
upper triangular system from which the unknowns are found by back substitution.
Working procedure:
1. Consider the system of equation
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 = 𝑏2
𝑎31 𝑥1 + 𝑎32 𝑥2 + 𝑎33 𝑥3 = 𝑏3
2. The system is equivalent to the matrix equation 𝐴𝑋 = 𝐵
𝑎11 𝑎12 𝑎13 𝑥1 𝑏1
Where 𝐴 = [𝑎21 𝑎22 𝑎23 ] ; 𝑋 = [𝑥2 ] ; 𝐵 = [𝑏2 ]
𝑎31 𝑎32 𝑎33 𝑥3 𝑏3
3. Consider the augmented matrix [𝐴 ⋮ 𝐵]
𝑎11 𝑎12 𝑎13 : 𝑏1
[𝐴 ⋮ 𝐵] = [𝑎21 𝑎22 𝑎23 : 𝑏2 ]
𝑎31 𝑎32 𝑎33 : 𝑏3
4. Reducing the coefficient matrix ‘𝐴’ in the augmented matrix [𝐴 ⋮ 𝐵] to an upper triangular
matrix.
5. Let us now convert the prevailing form of [𝐴: 𝐵] into a set of equation
6. Using back substitution, find the unknowns.
1
DAYANANDA SAGAR COLLEGE OF ENGINERING
DEPARTMENT OF MATHEMATICS
Staff Incharge: D.R. SASI REKHA
Problems:
1. Solve the following system of equation by Gauss elimination Method
𝒙 + 𝒚 + 𝒛 = 𝟗, 𝒙 − 𝟐𝒚 + 𝟑𝒛 = 𝟖, 𝟐𝒙 + 𝒚 − 𝒛 = 𝟑
Solution
1 1 1 : 9
Consider [𝐴 ∶ 𝐵] = [1 −2 3 : 8] 𝑅2 → 𝑅2 − 𝑅1 ; 𝑅3 → 𝑅3 − 2𝑅1
2 1 −1 : 3
1 1 1 : 9
[𝐴 ∶ 𝐵] = [0 −3 2 : −1 ] 𝑅3 → 3𝑅3 − 𝑅2
0 −1 −3 : −15
1 1 1 : 9
[𝐴 ∶ 𝐵] = [0 −3 2 : −1 ]
0 0 −11 : −44
Let us now convert the prevailing form of [𝐴: 𝐵] into a set of equation as follows
𝑥 + 𝑦 + 𝑧 = 9 ; −3𝑦 + 2𝑧 = −1 ; −11𝑧 = −44
Using back substitution we get
𝒙=𝟐 , 𝒚=𝟑 , 𝒛=𝟒
2. Solve the following system of equation by Gauss elimination Method
𝟐𝒙𝟏 + 𝒙𝟐 + 𝟑𝒙𝟑 = 𝟏, 𝟒𝒙𝟏 + 𝟒𝒙𝟐 + 𝟕𝒙𝟑 = 𝟏, 𝟐𝒙𝟏 + 𝟓𝒙𝟐 + 𝟗𝒙𝟑 = 𝟑
Solution
2 1 3 : 1
Consider [𝐴 ∶ 𝐵] = [4 4 7 : 1] 𝑅2 → 𝑅2 − 2𝑅1 ; 𝑅3 → 𝑅3 − 𝑅1
2 5 9 : 3
2 1 3 : 1
[𝐴 ∶ 𝐵] = [0 2 1 : −1] 𝑅3 → 𝑅3 − 2𝑅2
0 4 6 : 2
2 1 3 : 1
[𝐴 ∶ 𝐵] = [0 2 1 : −1]
0 0 4 : 4
2
DAYANANDA SAGAR COLLEGE OF ENGINERING
DEPARTMENT OF MATHEMATICS
Staff Incharge: D.R. SASI REKHA
Let us now convert the prevailing form of [𝐴: 𝐵] into a set of equation as follows
2𝑥1 + 𝑥2 + 3𝑥3 = 1 ; 2𝑥2 + 𝑥3 = −1 ; 4𝑥3 = 4
Using back substitution we get
𝟏
𝒙𝟏 = − , 𝒙𝟐 = −𝟏 , 𝒙𝟑 = 𝟏
𝟐
3. Solve the following system of equation by Gauss elimination Method
𝒙 + 𝟓𝒚 + 𝟔𝒛 = 𝟖 , 𝟒𝒙 − 𝟓𝒚 + 𝒛 = 𝟓 , 𝟓𝒙 + 𝒚 + 𝟔𝒛 = 𝟏𝟏
Solution
1 5 6 : 8
Consider [𝐴 ∶ 𝐵] = [4 −5 1 : 5] 𝑅2 → 𝑅2 − 4𝑅1 ; 𝑅3 → 𝑅3 − 5𝑅1
5 1 6 : 11
1 5 6 : 8
[𝐴 ∶ 𝐵] = [0 −25 −23 : −27] 𝑅3 → 25𝑅3 − 24𝑅2
0 −24 −24 : −29
1 5 6 : 8
[𝐴 ∶ 𝐵] = [0 −25 −23 : −27]
0 0 −48 : −77
Let us now convert the prevailing form of [𝐴: 𝐵] into a set of equation as follows
𝑥 + 5𝑦 + 6𝑧 = 8 ; −25𝑦 − 23𝑧 = −27 ; −48𝑧 = −77
Using back substitution we get
𝟏𝟕 𝟏𝟗 𝟕𝟕
𝒙= , 𝒚=− , 𝒛=
𝟒𝟖 𝟒𝟖 𝟒𝟖
4. Solve the following system of equation by Gauss elimination Method
𝒙 − 𝒚 + 𝒛 = 𝟏 , −𝟑𝒙 + 𝟐𝒚 − 𝟑𝒛 = −𝟔 , 𝟐𝒙 − 𝟓𝒚 + 𝟑𝒛 = 𝟓
Solution
1 −1 1 : 1
Consider [𝐴 ∶ 𝐵] = [−3 2 −3 : −6] 𝑅2 → 𝑅2 + 3𝑅1 ; 𝑅3 → 𝑅3 − 2𝑅1
2 −5 3 : 5
3
DAYANANDA SAGAR COLLEGE OF ENGINERING
DEPARTMENT OF MATHEMATICS
Staff Incharge: D.R. SASI REKHA
1 −1 1 : 1
[𝐴 ∶ 𝐵] = [0 −1 0 : −3] 𝑅3 → 𝑅3 − 3𝑅2
0 −3 1 : 3
1 −1 1 : 1
[𝐴 ∶ 𝐵] = [0 −1 0 : −3]
0 0 1 : 12
Let us now convert the prevailing form of [𝐴: 𝐵] into a set of equation as follows
𝑥 − 𝑦 + 𝑧 = 1 ; −𝑦 = −3 ; 𝑧 = 12
Using back substitution we get
𝒙 = −𝟖 , 𝒚 = 𝟑 , 𝒛 = 𝟏𝟐
5. Solve the following system of equation by Gauss elimination Method
𝟓𝒙𝟏 + 𝒙𝟐 + 𝒙𝟑 + 𝒙𝟒 = 𝟒 , 𝒙𝟏 + 𝟕𝒙𝟐 + 𝒙𝟑 + 𝒙𝟒 = 𝟏𝟐 , 𝒙𝟏 + 𝒙𝟐 + 𝟔𝒙𝟑 + 𝒙𝟒 = −𝟓 ,
𝒙𝟏 + 𝒙𝟐 + 𝒙𝟑 + 𝟒𝒙𝟒 = −𝟔
Solution
5 1 1 1 : 4
Consider [𝐴 ∶ 𝐵] = [1 7 1 1 : 12
] 𝑅1 ↔ 𝑅4
1 1 6 1 : −5
1 1 1 4 : −6
1 1 1 4 : −6
[𝐴 ∶ 𝐵] = [1 7 1 1 : 12
] 𝑅2 → 𝑅2 − 𝑅1 ; 𝑅3 → 𝑅3 − 𝑅1 ; 𝑅4 → 𝑅4 − 5𝑅1
1 1 6 1 : −5
5 1 1 1 : 4
1 1 1 4 : −6
0 6 0 −3 : 18
[𝐴 ∶ 𝐵] = [ ] 𝑅2 → 𝑅2 /3
0 0 5 −3 : 1
0 −4 −4 −19 : 34
1 1 1 4 : −6
[𝐴 ∶ 𝐵] = [0 2 0 −1 : 6
] 𝑅4 → 𝑅3 + 2𝑅3
0 0 5 −3 : 1
0 −4 −4 −19 : 34
4
DAYANANDA SAGAR COLLEGE OF ENGINERING
DEPARTMENT OF MATHEMATICS
Staff Incharge: D.R. SASI REKHA
1 1 1 4 : −6
[𝐴 ∶ 𝐵] = [0 2 0 −1 : 6
] 𝑅4 → 5𝑅4 + 4𝑅3
0 0 5 −3 : 1
0 0 −4 −21 : 46
1 1 1 4 : −6
[𝐴 ∶ 𝐵] = [0 2 0 −1 : 6
]
0 0 5 −3 : 1
0 0 0 −117 : 234
Let us now convert the prevailing form of [𝐴: 𝐵] into a set of equation as follows
𝑥1 + 𝑥2 + 𝑥3 + 4𝑥4 = −6 ; 2𝑥2 − 𝑥4 = 6 ; 5𝑥3 − 3𝑥4 = 1 ; 117𝑥4 = 234 ,
Using back substitution we get
𝒙𝟏 = 𝟏 , 𝒙𝟐 = 𝟐 , 𝒙𝟑 = −𝟏 ; 𝒙𝟒 = −𝟐
6. Solve the following system of equation by Gauss elimination Method
𝟐𝒙𝟏 − 𝒙𝟐 + 𝒙𝟑 = −𝟏, 𝟐𝒙𝟐 − 𝒙𝟑 + 𝒙𝟒 = 𝟏 , 𝒙𝟏 + 𝟐𝒙𝟑 − 𝒙𝟒 = −𝟏, 𝒙𝟏 + 𝒙𝟐 + 𝟐𝒙𝟒 = 𝟑
Solution
2 −1 1 0 : −1
[𝐴 ∶ 𝐵] = [0 2 −1 1 : 1
Consider ] 𝑅1 ↔ 𝑅3
1 0 2 −1 : −1
1 1 0 2 : 3
1 0 2 −1 : −1
0 2 −1 1 : 1
[𝐴 ∶ 𝐵] = [ ] 𝑅3 → 𝑅3 − 2𝑅1 ; 𝑅4 → 𝑅4 − 𝑅1
2 −1 1 0 : −1
1 1 0 2 : 3
1 0 2 −1 : −1
0 2 −1 1 : 1
[𝐴 ∶ 𝐵] = [ ] 𝑅3 → 2𝑅3 + 𝑅2 ; 𝑅4 → 2𝑅4 − 𝑅2
0 −1 −3 2 : 1
0 1 −2 3 : 4
1 0 2 −1 : −1
[𝐴 ∶ 𝐵] = [0 2 −1 1 : 1
] 𝑅4 → 7𝑅4 − 3𝑅3
0 0 −7 5 : 3
0 0 −3 5 : 7
5
DAYANANDA SAGAR COLLEGE OF ENGINERING
DEPARTMENT OF MATHEMATICS
Staff Incharge: D.R. SASI REKHA
1 0 2 −1 : −1
[𝐴 ∶ 𝐵] = [0 2 −1 1 : 1
]
0 0 −7 5 : 3
0 0 0 20 : 40
Let us now convert the prevailing form of [𝐴: 𝐵] into a set of equation as follows
𝑥1 + 2𝑥3 − 𝑥4 = −1 ; 2𝑥2 − 𝑥3 + 𝑥4 = 1 ; −7𝑥3 + 5𝑥4 = 3 ; 20𝑥4 = 40 ,
Using back substitution we get
𝒙𝟏 = −𝟏 , 𝒙𝟐 = 𝟎 , 𝒙𝟑 = 𝟏 ; 𝒙𝟒 = 𝟐
Problem for practice:
Solve the following equations by Gauss elimination method
(i) 4𝑥 + 𝑦 + 𝑧 = 4, 𝑥 + 4𝑦 − 2𝑧 = 4, 3𝑥 + 2𝑦 − 4𝑧 = 6
(ii) 𝑥 + 2𝑦 + 𝑧 = 3 , 2𝑥 + 3𝑦 + 3𝑧 = 10 , 3𝑥 − 𝑦 + 2𝑧 = 13
(iii) 2𝑦 + 𝑧 = −8 , 𝑥 − 2𝑦 − 3𝑧 = 0 , − 𝑥 + 𝑦 + 2𝑧 = 3
(iv) 2𝑥 − 𝑦 + 3𝑧 = 1 , −3𝑥 + 4𝑦 − 5𝑧 = 0 , 𝑥 + 3𝑦 − 6𝑧 = 0
(v) 5𝑥1 + 𝑥2 + 𝑥3 + 𝑥4 = 4, 𝑥1 + 7𝑥2 + 𝑥3 + 𝑥4 = 12,
𝑥1 + 𝑥2 + 6𝑥3 + 𝑥4 = −5, 𝑥1 + 𝑥2 + 6𝑥3 + 𝑥4 = −6
Answers:
𝟏 𝟏
(i) 𝒙=𝟏 , 𝒚=𝟐 , 𝒛 = −𝟐
(ii) 𝑥 = 2 , 𝑦 = −1, 𝑧 = 3
(iii) 𝑥 = −4 , 𝑦 = −5, 𝑧 = 2
9 23 13
(iv) 𝑥 = 34 , 𝑦 = 34 , 𝑧 = 34
(v) 𝑥1 = 1, 𝑥2 = 2, 𝑥3 = −1, 𝑥4 = −2