2/10/2021
ENGR 201 Lecture:
Inverse Matrix and Cramer’s Rule
By Prof. Ilhan Tuzcu
Department of Mechanical Engineering
California State University, Sacramento
Consider the linear system 𝐴𝐱 = 𝐜.
Let us seek a matrix 𝐴−1 having the property
𝐴−1 𝐴 = 𝐼
so that when we pre-multiply 𝐴𝐱 = 𝐜 by 𝐴−1
𝐼 𝐱
𝐴−1 𝐴𝐱 = 𝐴−1 𝐜 → 𝐼𝐱 = 𝐴−1 𝐜 → 𝐱 = 𝐴−1 𝐜
We call this matrix, 𝐴−1 , inverse of 𝐴.
However, in order for 𝐴−1 such that 𝐴−1 𝐴 = 𝐼 to be the inverse 𝐴, 𝐴 must
be an 𝑛 × 𝑛 square matrix.
1
2/10/2021
Example
Consider the system
−𝑥1 − 2𝑥2 = 1
𝑥1 + 𝑥2 = 1
𝑥2 = 1
We cast the system in the matrix-vector form as
−1 −2 𝑥 1
1
𝐴𝐱 = 𝐜 → 1 1 𝑥 = 1
2
0 1 𝐱 1 𝐜
𝐴
Obviously this system has no solution. (Please, solve it to see.)
12 0
If we pre-multiply both sides by ,
11 2
−1 −2 𝑥 1
1 2 0 1 1 2 0 1 0 𝑥1 3
1 1 𝑥 = 1 → 𝑥 =
1 1 2 2 1 1 2 0 1 2 4
0 1 1
which leads to 𝑥1 = 3 and 𝑥2 = 4.
Hence, a matrix 𝐵 having property 𝐵𝐴 = 𝐼 does not necessarily mean 𝐵 is
the inverse of 𝐴.
If both 𝐴 and 𝐵 are 𝑛 × 𝑛 and 𝐵𝐴 = 𝐼 holds, then it necessarily means 𝐵
is the inverse of 𝐴, and hence 𝐵 = 𝐴−1 .
2
2/10/2021
If 𝐴 = 𝑎𝑖𝑗 , then 𝐴−1 = 𝛼𝑖𝑗 .
One way to compute 𝐴−1 is to use the formula
1 Cofactor corresponding to 𝑎𝑗𝑖
−1 𝐴
𝐴 = 𝛼𝑖𝑗 = 𝐴 Hence, 𝛼𝑖𝑗 = det𝑗𝑖𝐴
det 𝐴 𝑗𝑖
𝑇
𝐴11 𝐴12 … 𝐴1𝑛 𝐴11 𝐴21 … 𝐴𝑛1
1 𝐴21 𝐴22 … 𝐴2𝑛 1 𝐴12 𝐴22 … 𝐴𝑛2
𝐴−1 = =
det 𝐴 ⋮ ⋮ ⋱ ⋮ det 𝐴 ⋮ ⋮ ⋱ ⋮
𝐴𝑛1 𝐴𝑛2 … 𝐴𝑛𝑛 𝐴1𝑛 𝐴2𝑛 … 𝐴𝑛𝑛
Cofactor matrix Adjoint matrix: adj𝐴
adj𝐴
=
det 𝐴
Example
2 1 1
Determine the inverse of 𝐴 = 4 −6 0 .
−2 7 2
3
2/10/2021
𝐴𝑖𝑗 = −1 𝑖+𝑗 𝑀𝑖𝑗
Solution
2 1 1
1+1 −6 0 𝐴 = 4 −6 0
𝐴11 = −1 = −12
7 2 −2 7 2
1+2 4 0
𝐴12 = −1 = −8
−2 2
1+3 4 −6
𝐴13 = −1 = 16
−2 7
2+1 1 1
𝐴21 = −1 =5
7 2
2+2 2 1
𝐴22 = −1 =6
−2 2
2 1 𝐴𝑖𝑗 = −1 𝑖+𝑗 𝑀𝑖𝑗
2+3
𝐴23 = −1 = −16 2 1 1
−2 7
𝐴 = 4 −6 0
1 1
𝐴31 = −1 3+1 =6 −2 7 2
−6 0
2 1
𝐴32 = −1 3+2 =4
4 0
2 1
𝐴33 = −1 3+3 = −16
4 −6
det 𝐴 = 𝑎13 𝐴13 + 𝑎23 𝐴23 + 𝑎33 𝐴33
= 1 16 + 0 −16 + 2 −16 = −16
4
2/10/2021
𝑇
𝐴11 𝐴12 −12 −8 16 𝑇
𝐴13 −12 5 6
adj𝐴 = 𝐴21 𝐴22 = 5 𝐴23
6 −16 = −8 6 4
𝐴31 𝐴32 6 𝐴33
4 −16 16 −16 −16
3 5 3
− −
adj𝐴 1 −12 5 6 4 16 8
𝐴−1 = = −8 6 4 = 1 3 1
det 𝐴 −16 − −
16 −16 −16 2 8 4
−1 1 1
To verify this is in fact the inverse of 𝐴,
3 5 3
− − 2 1 1 1 0 0
4 16 8
−1
𝐴 𝐴=𝐼 → 1
−
3
−
1 4 −6 0 = 0 1 0
2 8 4 −2 7 2 0 0 1
−1 1 1
Inverse Matrix
Let 𝐴 be 𝑛 × 𝑛. If det 𝐴 ≠ 0, then there exists a unique matrix 𝐴−1 , also
𝑛 × 𝑛, called the inverse of 𝐴, such that
𝐴−1 𝐴 = 𝐴𝐴−1 = 𝐼
𝐴 is then said to be invertible and its inverse is given by
adj𝐴
𝐴−1 =
det 𝐴
If det 𝐴 = 0, then a matrix 𝐴−1 satisfying 𝐴−1 𝐴 = 𝐴𝐴−1 = 𝐼 does not
exist, and 𝐴 is said to be singular.
5
2/10/2021
Solution of 𝐴𝐱 = 𝐜
If 𝐴 is 𝑛 × 𝑛 and det 𝐴 ≠ 0, then 𝐴𝐱 = 𝐜 admits the unique solution
𝐱 = 𝐴−1 𝐜
Properties of Inverses
If 𝐴 and 𝐵 are of the same order, and invertible, then 𝐴𝐵 is too, and
−1
𝐴𝐵 = 𝐵−1 𝐴−1
If 𝐴 is invertible, then 𝐴−1 −1
= 𝐴 and
𝐴𝑚 𝑛
= 𝐴𝑚𝑛
for any (positive, negative, or zero) integers 𝑚 and 𝑛.
6
2/10/2021
If 𝐴 is invertible, then
• 𝐴𝐵 = 𝐴𝐶 implies that 𝐵 = 𝐶
• 𝐵𝐴 = 𝐶𝐴 implies that 𝐵 = 𝐶
• 𝐴𝐵 = 0 implies that 𝐵 = 0
• 𝐵𝐴 = 0 implies that 𝐵 = 0.
Cramer’s Rule
If 𝐴 is 𝑛 × 𝑛 and det 𝐴 ≠ 0, then 𝐴𝐱 = 𝐜 has the unique solution
𝐱 = 𝐴−1 𝐜
or
𝑛
𝛼1𝑗 𝑐𝑗
𝑗=1
𝑥1 𝛼11 𝛼12 … 𝛼1𝑛 𝑐1 𝑛
𝑥2 𝛼21 𝛼22 … 𝛼2𝑛 𝑐2 𝛼2𝑗 𝑐𝑗
⋮ = ⋮ ⋮ ⋱ ⋮ ⋮ = 𝑗=1
𝑥𝑛 𝛼𝑛1 𝛼𝑛2 … 𝛼𝑛𝑛 𝑐𝑛 ⋮
𝑛
𝛼𝑛𝑗 𝑐𝑗
𝑗=1
7
2/10/2021
𝑛
Hence, det 𝐴 = 𝐴𝑗𝑖 𝑎𝑗𝑖
𝑗=1
𝑛
𝑥𝑖 = 𝛼𝑖𝑗 𝑐𝑗
𝑗=1
𝐴𝑗𝑖
Remember that 𝛼𝑖𝑗 = . Then
det 𝐴
𝑛 𝐴𝑗𝑖 𝑛 1 𝑛
𝑥𝑖 = 𝛼𝑖𝑗 𝑐𝑗 = 𝑐𝑗 = 𝐴 𝑐
𝑗=1 𝑗=1 det 𝐴 det 𝐴 𝑗=1 𝑗𝑖 𝑗
σ𝑛𝑗=1 𝐴𝑗𝑖 𝑐𝑗 is the determinant of the 𝐴 matrix with 𝑖th column replaced by
the column of 𝑐𝑗 ’s (or the vector 𝐜).
This result is known as Cramer’s rule.
Example
Solve the system using the Cramer’s rule.
2 1 1 𝑢 5
𝐴𝐱 = 𝐜 → 4 −6 0 𝑣 = −2
−2 7 2 𝑤 9
8
2/10/2021
Solution
2 1 1
4 −6 2 1
det 𝐴 = 4 −6 0 = 1 −1 1+3 + 2 −1 3+3
−2 7 4 −6
−2 7 2
= 16 − 2 16 = −16
𝐜
5 1 1
−2 −6 5 1
−2 −6 0 = 1 + 2 = −16
9 7 −2 −6
9 7 2
1 5 1 1 −16
𝑢= −2 −6 0 = =1
det 𝐴 −16
9 7 2
𝐜
2 5 1
4 −2 2 5
4 −2 0 = 1 + 2 = −16
−2 9 4 −2
−2 9 2
1 2 5 1 −16
𝑣= 4 −2 0 = =1
det 𝐴 −16
−2 9 2
9
2/10/2021
𝐜
2 1 5
−6 −2 1 5 1 5
4 −6 −2 = 2 − 4 + −2
7 9 7 9 −6 −2
−2 7 9
= −32
1 2 1 5 −32
𝑤= 4 −6 −2 = =2
det 𝐴 −16
−2 7 9
Hence, the solution of the system is 𝑢 = 1, 𝑣 = 1, 𝑤 = 2.
Evaluation of 𝐴−1 by Elementary Row Operations
The system 𝐴𝐱 = 𝐜 can be reduced to 𝐱 = 𝐴−1 𝐜 by Gauss-Jordan
reduction.
Hence, the sequence of elementary row operations transform the system
𝐴𝐱 = 𝐼𝐜 to 𝐼𝐱 = 𝐴−1 𝐜 or the augmented matrix 𝐴|𝐼 to 𝐼|𝐴−1 .
𝐴 | 𝐼 → 𝐼 | 𝐴−1
10
2/10/2021
Example
Solve the system
2 1 1 𝑢 5
𝐴𝐱 = 𝐜 → 4 −6 0 𝑣 = −2
−2 7 2 𝑤 9
Solution 𝐴 𝐼
2 1 1 ⋮ 1 0 0 𝑟1 → 𝑟1
𝐴|𝐼 = 4 −6 0 ⋮ 0 1 0 → 𝑟2 → 𝑟2 − 2𝑟1
−2 7 2 ⋮ 0 0 1 𝑟3 → 𝑟3 + 𝑟1
2 1 1 ⋮ 1 0 0 𝑟1 → 𝑟1
0 −8 −2 ⋮ −2 1 0 → 𝑟2 → 𝑟2
0 8 3 ⋮ 1 0 1 𝑟3 → 𝑟3 + 𝑟2
2 1 1 ⋮ 1 0 0 𝑟1 → 𝑟1 − 𝑟3
0 −8 −2 ⋮ −2 1 0 → 𝑟2 → 𝑟2 + 2𝑟3
0 0 1 ⋮ −1 1 1 𝑟3 → 𝑟3
2 1 0 ⋮ 2 −1 −1
0 −8 0 ⋮ −4 3 2
0 0 1 ⋮ −1 1 1
11
2/10/2021
2 1 0 ⋮ 2 −1 −1 𝑟1 → 𝑟1
0 −8 0 ⋮ −4 3 2 → 𝑟2 → −𝑟2 /8
0 0 1 ⋮ −1 1 1 𝑟3 → 𝑟3
2 1 0 ⋮ 2 −1 −1 𝑟1 → 𝑟1 − 𝑟2
0 1 0 ⋮ 1/2 −3/8 −1/4 → 𝑟2 → 𝑟2
0 0 1 ⋮ −1 1 1 𝑟3 → 𝑟3
2 0 0 ⋮ 3/2 −5/8 −3/4 𝑟1 → 𝑟1 /2
0 1 0 ⋮ 1/2 −3/8 −1/4 → 𝑟2 → 𝑟2
0 0 1 ⋮ −1 1 1 𝑟3 → 𝑟3
1 0 0 ⋮ 3/4 −5/16 −3/8 𝑟1 → 𝑟1 /2
0 1 0 ⋮ 1/2 −3/8 −1/4 → 𝑟2 → 𝑟2
0 0 1 ⋮ −1 1 1 𝑟3 → 𝑟3
𝐼 𝐴−1
3 5 3
− −
4 16 8
𝐴−1 = 1 3 1
− −
2 8 4
−1 1 1
3 5 3
𝑢 − − 1
4 16 8 5
−1
𝐱= 𝑣 =𝐴 𝐜= 1 3 1 −2 = 1
𝑤 − − 2
2 8 4 9
−1 1 1
Hence, the solution of the system is 𝑢 = 1, 𝑣 = 1, 𝑤 = 2.
12
2/10/2021
Change of Basis
Let 𝐵 = 𝐞1 , 𝐞2 , … , 𝐞𝑛 be a given basis for the vector space 𝑉.
Any given vector 𝐱 can be expanded as
𝐱 = 𝑥1 𝐞1 + 𝑥2 𝐞2 + ⋯ + 𝑥𝑛 𝐞𝑛
If we switch to some other basis 𝐵′ = 𝐞1′ , 𝐞′2 , … , 𝐞′𝑛
𝐱 = 𝑥1′ 𝐞1′ + 𝑥2′ 𝐞′2 + ⋯ + 𝑥𝑛′ 𝐞′𝑛
How are the 𝑥𝑗′ coordinates related to the 𝑥𝑗 coordinates?
Since 𝐵′ is a basis, we can write
𝐞1 = 𝑞11 𝐞1′ + 𝑞21 𝐞′2 + ⋯ + 𝑞𝑛1 𝐞′𝑛
𝐞2 = 𝑞12 𝐞1′ + 𝑞22 𝐞′2 + ⋯ + 𝑞𝑛2 𝐞′𝑛
⋮
𝐞𝑛 = 𝑞1𝑛 𝐞1′ + 𝑞2𝑛 𝐞′2 + ⋯ + 𝑞𝑛𝑛 𝐞′𝑛
13
2/10/2021
𝐱 = 𝑥1 𝐞1 + 𝑥2 𝐞2 + ⋯ + 𝑥𝑛 𝐞𝑛
𝐱 = 𝑥1 𝑞11 𝐞1′ + 𝑞21 𝐞′2 + ⋯ + 𝑞𝑛1 𝐞′𝑛
+𝑥2 𝑞12 𝐞1′ + 𝑞22 𝐞′2 + ⋯ + 𝑞𝑛2 𝐞′𝑛 + ⋯
+𝑥𝑛 𝑞1𝑛 𝐞1′ + 𝑞2𝑛 𝐞′2 + 𝑥⋯′ + 𝑞𝑛𝑛 𝐞′𝑛
1
=′ 𝑞11 𝑥1 + 𝑞12 𝑥2 + ⋯ + 𝑞1𝑛 𝑥𝑛 𝐞1′
𝑥2
+ 𝑞21 𝑥1 + 𝑞22 𝑥2 + ⋯ + 𝑞2𝑛 𝑥𝑛 𝐞′2 + ⋯
𝑥𝑛′
+ 𝑞𝑛1 𝑥1 + 𝑞𝑛2 𝑥2 + ⋯ + 𝑞𝑛𝑛 𝑥𝑛 𝐞′𝑛
= 𝑥1′ 𝐞1′ + 𝑥2′ 𝐞′2 + ⋯ + 𝑥𝑛′ 𝐞′𝑛
𝑥1′ = 𝑞11 𝑥1 + 𝑞12 𝑥2 + ⋯ + 𝑞1𝑛 𝑥𝑛
𝑥2′ = 𝑞21 𝑥1 + 𝑞22 𝑥2 + ⋯ + 𝑞2𝑛 𝑥𝑛
⋮
𝑥𝑛′ = 𝑞𝑛1 𝑥1 + 𝑞𝑛2 𝑥2 + ⋯ + 𝑞𝑛𝑛 𝑥𝑛
𝑥1′ 𝑞11 𝑞12 … 𝑞1𝑛 𝑥1
𝑥2′ 𝑞21 𝑞22 … 𝑞2𝑛 𝑥2
= ⋮ ⋮ ⋱ ⋮ ⋮ → 𝐱′ = 𝑄 𝐱
⋮
𝑥𝑛′ 𝑞𝑛1 𝑞𝑛2 … 𝑞𝑛𝑛 𝑥𝑛
𝐱′ 𝑄 𝐱
where 𝑄 is the coordinate transformation matrix.
14
2/10/2021
Let us assume 𝐵 and 𝐵′ are orthonormal (ON).
𝐞ො1 = 𝑞11 𝐞ො1′ + 𝑞21 𝐞ො ′2 + ⋯ + 𝑞𝑛1 𝐞ො ′𝑛
𝐞ො 2 = 𝑞12 𝐞ො1′ + 𝑞22 𝐞ො ′2 + ⋯ + 𝑞𝑛2 𝐞ො ′𝑛
⋮
𝐞ො 𝑛 = 𝑞1𝑛 𝐞ො1′ + 𝑞2𝑛 𝐞ො ′2 + ⋯ + 𝑞𝑛𝑛 𝐞ො ′𝑛
1 0 0
𝐞ො1 ∙ 𝐞ො1′ = 𝑞11 𝐞ො1′ ∙ 𝐞ො1′ + 𝑞21 𝐞ො ′2 ∙ 𝐞ො1′ + ⋯ + 𝑞𝑛1 𝐞ො ′𝑛 ∙ 𝐞ො1′
𝑞11 = 𝐞ො1 ∙ 𝐞ො1′
Similarly, 𝑞𝑖𝑗 = 𝐞ො𝑗 ∙ 𝐞ො ′𝑖 .
𝐞ො1 = 𝑞11 𝐞ො1′ + 𝑞21 𝐞ො ′2 + ⋯ + 𝑞𝑛1 𝐞ො ′𝑛
𝐞ො 2 = 𝑞12 𝐞ො1′ + 𝑞22 𝐞ො ′2 + ⋯ + 𝑞𝑛2 𝐞ො ′𝑛
⋮
𝐞ො 𝑛 = 𝑞1𝑛 𝐞ො1′ + 𝑞2𝑛 𝐞ො ′2 + ⋯ + 𝑞𝑛𝑛 𝐞ො ′𝑛
2 2 2 2
𝐞ො1 = 𝐞ො1 ∙ 𝐞ො1 = 𝑞11 + 𝑞21 + ⋯ + 𝑞𝑛1 =1
2 2 2 2
𝐞ො 2 = 𝐞ො 2 ∙ 𝐞ො 2 = 𝑞12 + 𝑞22 + ⋯ + 𝑞𝑛2 =1
⋮
2 2 2 2
𝐞ො 𝑛 = 𝐞ො 𝑛 ∙ 𝐞ො 𝑛 = 𝑞1𝑛 + 𝑞2𝑛 + ⋯ + 𝑞𝑛𝑛 =1
15
2/10/2021
𝑞11 𝑞21 … 𝑞𝑛1 𝑞11 𝑞12 … 𝑞1𝑛 1 0 … 0
𝑞12 𝑞22 … 𝑞𝑛2 𝑞21 𝑞22 … 𝑞2𝑛 0 1 … 0
𝑄𝑇 𝑄 = ⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮ = ⋮ ⋮ ⋱ ⋮
𝑞1𝑛 𝑞2𝑛 … 𝑞𝑛𝑛 𝑞𝑛1 𝑞𝑛2 … 𝑞𝑛𝑛 0 0 … 1
𝑄𝑇 𝑄 = 𝐼 → 𝑄𝑇 = 𝑄−1
𝐱′ = 𝑄 𝐱 → 𝐱 = 𝑄−1 𝐱 ′ = 𝑄𝑇 𝐱 ′
Any matrix with the property 𝑄𝑇 = 𝑄−1 is known as orthogonal matrix.
𝑄𝑇 𝑄 = 𝐼 → det 𝑄𝑇 𝑄 = det 𝐼 → det 𝑄𝑇 det 𝑄 = 1
2
det 𝑄 =1 → det 𝑄 = ±1
Example
𝑣 = 𝑥1 𝐞ො1 + 𝑥2 𝐞ො 2 = 𝑥1′ 𝐞ො1′ + 𝑥2′ 𝐞ො ′2
𝑞𝑖𝑗 = 𝐞ො𝑗 ∙ 𝐞ො ′𝑖
𝑞11 = 𝐞ො1 ∙ 𝐞ො1′ = 𝐞ො1 𝐞ො1′ cos 𝜃 = 1 1 cos 𝜃 = cos 𝜃
𝐵 = 𝐞ො1 , 𝐞ො 2
𝑥2
𝐯
𝐵′ = 𝐞ො1′ , 𝐞ො ′2
𝑥2′
𝜃
𝐞ො 2
𝐞ො ′2
𝐞ො 1′ 𝑥1′
𝜃
𝐞ො 1 𝑥1
16
2/10/2021
𝑞12 = 𝐞ො 2 ∙ 𝐞ො1′ = 𝐞ො 2 𝐞ො1′ cos(90° − 𝜃) = 1 1 sin 𝜃 = sin 𝜃
𝑞21 = 𝐞ො1 ∙ 𝐞ො ′2 = 𝐞ො1 𝐞ො ′2 cos 90° + 𝜃 = 1 1 − sin 𝜃 = − sin 𝜃
𝑞22 = 𝐞ො 2 ∙ 𝐞ො ′2 = 𝐞ො 2 𝐞ො ′2 cos 𝜃 = 1 1 cos 𝜃 = cos 𝜃
𝑞11 𝑞12 cos 𝜃 sin 𝜃
𝑄= 𝑞 =
21 𝑞22 − sin 𝜃 cos 𝜃
cos 𝜃 − sin 𝜃
𝑄−1 = 𝑄𝑇 = 𝐵 = 𝐞ො1 , 𝐞ො 2
sin 𝜃 cos 𝜃 𝐯 ′
𝑥2 𝐵 = 𝐞ො1′ , 𝐞ො ′2
𝑥2′
𝜃
𝐞ො 2
𝐞ො ′2
𝐞ො 1′ 𝑥1′
𝜃
𝐞ො 1 𝑥1
′ 𝑥1′ cos 𝜃 sin 𝜃 𝑥1
𝐱 =𝑄 𝐱 → ′ =
𝑥2 − sin 𝜃 cos 𝜃 𝑥2
𝑥1′ = cos 𝜃 𝑥1 + sin 𝜃 𝑥2
𝑥1′ = − sin 𝜃 𝑥1 + cos 𝜃 𝑥2
𝑥1 ′
−1 ′ 𝑇 ′ cos 𝜃 − sin 𝜃 𝑥1
𝐱 =𝑄 𝐱 =𝑄 𝐱 → 𝑥2 = sin 𝜃 cos 𝜃 𝑥2′ 𝐵 = 𝐞ො , 𝐞ො
1 2
𝑥1 = cos 𝜃 𝑥1′ − sin 𝜃 𝑥2′ 𝑥2
𝐯 ′
𝐵 = 𝐞ො1′ , 𝐞ො ′2
𝑥2 = sin 𝜃 𝑥1′ + cos 𝜃 𝑥2′ 𝑥2′
𝜃
𝐞ො 2
𝐞ො ′2
𝐞ො 1′ 𝑥1′
𝜃
𝐞ො 1 𝑥1
17