Tutorial 2 - Solving systems of linear equations by explicitly inverting the matrix
Tutorial 2 - Solving systems of linear equations by explicitly inverting the matrix
Steps:
1) Get the determinant det (A)
2) Compute the Matrix of Minors |𝐴|
3) Find the Cofactor Matrix, C, where 𝐶𝑖𝑗 = (−1)𝑖+𝑗 × |𝐴𝑖𝑗 |
4) Compute the Adjugated Matrix, 𝐶̃ , where 𝐶̃ = 𝐶 𝑇
1
5) Get the inverse of the matrix A by using 𝐴−1 = × 𝐶̃
det(𝐴)
𝟏
𝑨−𝟏 = Č
𝐝𝐞𝐭(𝑨)
𝒙 = 𝑨−𝟏 𝒃
Exercise 1: Solve the following systems of linear equations by explicitly inverting the
coefficient matrix:
𝒙 + 𝟑𝒚 = 𝟔
{ 𝒚 − 𝟑𝒛 = 𝟓
𝟑𝒙 − 𝒛 = 𝟒
You can also get
Write the system of equations in the matrix form: 𝐴𝑥 = 𝑏 the determinant
using Sarrus Rule
1 3 0 6
Matrix = [0 1 −3] [5]
3 0 −1 4
|𝑎11 | = 𝑑𝑒𝑡 [1 −3
] = (1 × −1) − (−3 × 0) = −1
0 −1
|𝑎12 | = 𝑑𝑒𝑡 [0 −3
] = (0 × −1) − (−3 × 3) = 9
3 −1
|𝑎13 | = 𝑑𝑒𝑡 [0 1
] = 0 × 0 − 1 × 3 = −3
3 0
3 0
|𝑎21 | = 𝑑𝑒𝑡 [ ] = 3 × −1 − 0 × 0 = −3
0 −1
|𝑎22 | = 𝑑𝑒𝑡 [1 0
] = (1 × −1) − (0 × 3) = −1
3 −1
|𝑎23 | = 𝑑𝑒𝑡 [1 3
] = 1 × 0 − 3 × 3 = −9
3 0
|𝑎31 | = 𝑑𝑒𝑡 [3 0
] = (3 × −3) − (0 × 1) = −9
1 −3
|𝑎32 | = 𝑑𝑒𝑡 [1 0
] = (1 × −3) − 0 × 1 = −3
0 −3
|𝑎33 | = 𝑑𝑒𝑡 [1 3
]= 1×1−3×0= 1
0 1
−1 9 −3
Matrix of Minors: |𝐴| = [−3 −1 −9]
−9 −3 1
−1 3 −9
T
C = [−9 −1 3 ]
−3 9 1
1
5. Finally, use 𝐴−1 = det(𝐴) × 𝐶̃ to invert the Coefficient Matrixand𝑥 = 𝐴−1 𝑏 to solve the
system:
1 −1 3 −9
𝐴−1 = × [−9 −1 3 ]
−28
−3 9 1
1 −3 9
28 28 28
9 1 −3
𝐴−1 =
28 28 28
3 −9 −1
[28 28 28 ]
𝑥 = 𝐴−1 𝑏
𝟏 −𝟑 𝟗 𝟐𝟕
𝟐𝟖 𝟐𝟖 𝟐𝟖 𝟐𝟖
𝟗 𝟏 −𝟑 𝟔 𝟒𝟕
𝒙= × [𝟓 ] =
𝟐𝟖 𝟐𝟖 𝟐𝟖 𝟒 𝟐𝟖
𝟑 −𝟗 −𝟏 −𝟑𝟏
[𝟐𝟖 𝟐𝟖 𝟐𝟖 ] [ 𝟐𝟖 ]
Exercise 2: Solve the following systems of linear equations by explicitly inverting the
coefficient matrix:
𝒙 + 𝒚 + 𝟐𝒙 = 𝟒
{𝒙 − 𝟑𝒚 + 𝟐𝒛 = −𝟏
𝒙 − 𝟓𝒚 = −𝟒
1 1 2 𝑥 4
[1 −3 2] [𝑦] = [−1]
1 −5 0 𝑧 −4
1
5. Finally, use 𝐴−1 = det(𝐴) × 𝐶̃ to invert the Coefficient Matrixand𝑥 = 𝐴−1 𝑏 to solve the
system:
1
∴ 𝐴−1 = × 𝐶̃
det(𝐴)
5 −5
1
10 −10 8 4 4
1 1 −1
𝐴−1 =8×[ 2 −2 0 ]= 4 4
0
−2 6 −4 −1 3 −1
[4 4 2 ]
𝑥 = 𝐴−1 𝑏
𝟓 −𝟓 𝟗
𝟏
𝟒 𝟒 𝟒
𝟏 −𝟏 𝟒 𝟓
𝒙= 𝟎 × [−𝟏] =
𝟒 𝟒 −𝟒 𝟒
−𝟏 𝟑 −𝟏 𝟏
[𝟒 𝟒 𝟐] [𝟒]