Matrix Inversion and Functions Guide
Matrix Inversion and Functions Guide
▶ Function of matrices
▶ Matrix power
▶ Inverse matrix
▶ Inverse matrix
▶ Definition and properties
▶ Simple examples
▶ Gauss-Jordan elimination to find A−1
▶ Transposition of matrices
▶ Definition and properties
▶ Examples
▶ A = LU factorization
Classification of functions
▶ Scalar functions
▶ y(x) scalar function of scalar argument
▶ y(x) scalar function of vector argument
▶ y(X) scalar function of matrix argument
▶ Example: determinant of a matrix, det X
▶ Vector functions
▶ y(x) vector function of scalar argument
▶ Example: position of a particle in R2 as a function of time
▶ y(x) vector function of vector argument
▶ Example: transformation from cartesian to polar coordinates
▶ y(X) vector function of matrix argument
▶ Matrix functions
▶ Y (x) matrix function of scalar argument
▶ Y (x) matrix function of vector argument
▶ Y (X) matrix function of matrix argument
Matrix functions of matrices
▶ A0 = I by definition
▶ A−1 (inverse matrix) — the main issue of our study
Inverse matrix
Definition
A square matrix A is invertible (non-singular) if there exists a
matrix A−1 such that AA−1 = I and A−1 A = I
▶ (A−1 )−1 = A
Inverse Matrix
Easy examples
▶ Diagonal matrix
d1 . . . 0 1/d1 . . . 0
.. . . ..
A= . =⇒ A−1 = ... .. ..
. . . .
0 ... dn 0 . . . 1/dn
▶ Elimination matrix: E −1
ij (l) = E ij (−l)
1 0 0 1 0 0
E 31 (2) = 0 1 0 , E −1
31 (2) =
0 1 0 = E 31 (−2)
2 0 1 −2 0 1
Preliminaries
▶ Fact1 if B ≜ [b1 b2 . . . bn ] then
AB = A [b1 b2 . . . bn ] = [Ab1 Ab2 . . . Abn ]
▶ Fact2 for Ax = b the solution x = A−1 b.
Let A−1 ≜ [α1 α2 . . . αn ] and b = (b1 , b2 , . . . , bn ) then
x = A−1 b = α1 b1 + α2 b2 + . . . + αn bn
▶ If b = (1, 0, . . . , 0) ≜ e1 =⇒ x = α1
▶ If b = (0, 1, . . . , 0) ≜ e2 =⇒ x = α2
▶ If b = (0, 0, . . . , 1) ≜ en =⇒ x = αn
A−1 [A | I] = I | A−1
▶ By definition
1 3 a c 1 0
=
2 7 b d 0 1
| {z } | {z } | {z }
A A−1 I
1 3 1 3 1 0
A= , [A|I] =
2 7 2 7 0 1
Check that
1 3 7 −3 1 0
=
2 7 −2 1 0 1
| {z } | {z } | {z }
A A−1 I
▶ By definition
2 −1 0 a d g 1 0 0
−1 2 −1 b e h = 0 1 0
0 −1 2 c f k 0 0 1
| {z }| {z } | {z }
A A−1 I
2 −1 0 2 −1 0 1 0 0
A = −1 2 −1 , [A|I] = −1 2 −1 0 1 0
0 −1 2 0 −1 2 0 0 1
▶ Step1 (Gauss): 1
2 row1 + row2 → row2
1 0 0 2 −1 0 1 0 0
1 1 0 −1 2 −1 0 1 0 =
2
0 0 1 0 −1 2 0 0 1
| {z }| {z }
E 21 ( 12 ) [A|I]
2 −1 0 1 0 0
3 1
0
2 −1 2 1 0
0 −1 2 0 0 1
| {z }
E 21 [A|I]
Example 2: [A|I] =⇒ I | A−1 continued
2 −1 0 1 0 0
3 1
E 21 [A|I] = 0 2 −1 2 1 0
0 −1 2 0 0 1
▶ Step2 (Gauss): 2
3 row2 + row3 → row3
1 0 0 2 −1 0 1 0 0
3 1
0 1 0 0
2 −1 2 1 0
=
0 23 1 0 −1 2 0 0 1
| {z }| {z }
E 32 ( 23 ) E 21 [A|I]
2 −1 0 1 0 0
3 1
2 −1
0 1 0
2
4 1 2
0 0 3 3 3 1
| {z }
E 32 E 21 [A|I]
The left block is upper triangular, but we need to make it I.
Example 2: [A|I] =⇒ I | A−1 continued
2 −1 0 1 0 0
3 1
E 32 E 21 [A|I] = 0 2 −1 1 0
2
4 1 2
0 0 3 3 3 1
▶ Step3 (Jordan): 3
4 row3 + row2 → row2
1 0 0 2 −1 0 1 0 0
0 1 3 0 3
−1 1
1 0 =
4 2 2
4 1 2
0 0 1 0 0 3 3 3 1
| {z }| {z }
E 23 ( 34 ) E 32 E 21 [A|I]
2 −1 0 1 0 0
0 3 3 3 3
2 0 4 2 4
4 1 2
0 0 3 3 3 1
| {z }
E 23 E 32 E 21 [A|I]
Example 2: [A|I] =⇒ I | A−1 continued
2 −1 0 1 0 0
3 3 3 3
E 23 E 32 E 21 [A|I] = 0 2 0 4 2 4
4 1 2
0 0 3 3 3 1
1 23 0
2 −1 0 1 0 0
0 1 0 3 3 3 3
0 2 0 4 2 4
=
4 1 2
0 0 1 0 0 3 3 3 1
| {z }| {z }
E 12 ( 23 ) E 23 E 32 E 21 [A|I]
3 1
2 0 0 2 1 2
0 3 3 3 3
2 0 4 2 4
4 1 2
0 0 3 3 3 1
| {z }
E 12 E 23 E 32 E 21 [A|I]
The left block is already diagonal, but we need to make it I.
Example 2: [A|I] =⇒ I | A−1 continued
3 1
2 0 0 2 1 2
3 3 3 3
E 12 E 23 E 32 E 21 [A|I] = 0 2 0 4 2 4
4 1 2
0 0 3 3 3 1
Check that
3 1 1
2 −1 0 4 2 4 1 0 0
−1 1 1
2 −1 2 1 2
= 0 1 0
3 1 3
0 −1 2 4 2 4 0 0 1
| {z }| {z } | {z }
A A−1 I
▶ By definition
2 4 −2 a d g 1 0 0
4 9 −3 b e h = 0 1 0
−2 −3 7 c f k 0 0 1
| {z }| {z } | {z }
A A−1 I
2 4 −2 2 4 −2 1 0 0
A= 4 9 −3 , [A|I] = 4 9 −3 0 1 0
−2 −3 7 −2 −3 7 0 0 1
2 4 −2 1 0 0
E 21 [A|I] = 0 1 1 −2 1 0
−2 −3 7 0 0 1
2 4 −2 1 0 0
E 31 E 21 [A|I] = 0 1 1 −2 1 0
0 1 5 1 0 1
2 4 −2 1 0 0
E 32 E 31 E 21 [A|I] = 0 1
1 −2 1 0
0 0 4 3 −1 1
2 4 −2 1 0 0
E 23 E 32 E 31 E 21 [A|I] = 0 1 0 − 11
4
5 1
4 −4
0 0 4 3 −1 1
▶ Step5 (Jordan): 1
2 row3 + row1 → row1
1 0 12
2 4 −2 1 0 0
0 1 0 0 1 0 − 11
4
5 1
4 −4 =
0 0 1 0 0 4 3 −1 1
| {z }| {z }
E 13 ( 12 ) E 23 E 32 E 31 E 21 [A|I]
5
− 21 1
2 4 0 2 2
11 5
0 1 0 −4 4 − 14
0 0 4 3 −1 1
| {z }
E 13 E 23 E 32 E 31 E 21 [A|I]
Example 3: [A|I] =⇒ I | A−1 continued
5
− 12 1
2 4 0 2 2
11 5
E 13 E 23 E 32 E 31 E 21 [A|I] = 0 1 0 −4 4 − 41
0 0 4 3 −1 1
5
− 12 1
1 −4 0 2 4 0 2 2
11 5
0 1 0 0 1 0 −4 4 − 14 =
0 0 1 0 0 4 3 −1 1
| {z }| {z }
E 12 (− 14 ) E 13 E 23 E 32 E 31 E 21 [A|I]
27
− 11 3
2 0 0 2 2 2
0 1 0 − 11
4
5
4
1
−4
0 0 4 3 −1 1
| {z }
E 12 E 13 E 23 E 32 E 31 E 21 [A|I]
The left block is already diagonal, but we need to make it I.
Example 3: [A|I] =⇒ I | A−1 continued
27
− 11 3
2 0 0 2 2 2
11 5
E 12 E 13 E 23 E 32 E 31 E 21 [A|I] = 0 1 0 −4 4 − 14
0 0 4 3 −1 1
▶ Step7 (Jordan): 1 1
2 row1 → row1; 4 row3 → row3
1 27
− 11 3
0 0
2 2 0 0 2 2 2
0 1 0 0 1 0 − 11
4
5
4 − 14 =
0 0 14 0 0 4 3 −1 1
| {z }| {z }
S( 12 ,1, 14 ) E 12 E 13 E 23 E 32 E 31 E 21 [A|I]
27
− 11 3
1 0 0 4 4 4
0 1 0 − 11
4
5
4 − 14
3 1 1
0 0 1 4 −4 4
| {z }
SE 12 E 13 E 23 E 32 E 31 E 21 [A|I]
−1
The left block is I, the right one is the inverse matrix A .
Example 3: [A|I] =⇒ I | A−1 continued
We found
27
− 11 3
4 4 4
A−1 = − 11
4
5
4 − 14 = SE 12 E 13 E 23 E 32 E 31 E 21
3
4 − 14 1
4
Check that
27
− 11 3
2 4 −2 4 4 4 1 0 0
4 9 −3 − 11
4
5
4 − 41 = 0 1 0
3
−2 −3 7 4 − 41 1
4 0 0 1
| {z }| {z } | {z }
A A−1 I
▶ Matrix transpose
▶ Examples and notation
▶ Definition and properties
▶ Useful representations:
▶ inner and outer vector products
▶ symmetric and skew-symmetric matrices
▶ Transpose of permutation matrices
▶ A = LU factorization
Transposition: definition & examples
▶ Transposition is non-algebraic operation
▶ Columns of A become rows of AT and rows of A become
columns of AT
▶ (i-th row, j-th column) element of AT is
T
(j-th row, i-th column) element of A: A ij = [A]ji
▶ Examples
1 4
1 2 3
A= AT = 2 5
4 5 6
3 6
1
A= 2 AT = 1 2 3
3
▶ (AT )T = A
▶ (cA)T = cAT , where c is a scalar
▶ (A + B)T = AT + B T
▶ (AB)T = ?
(AB)T = B T AT
▶ recall that rowi (A) = coli (AT ) and coli (A) = rowi (AT )
Proof:
▶ [AB]ij = rowi (A) · colj (B)
▶ [(AB)T ]ij = [AB]ji = rowj (A) · coli (B)
▶ [B T AT ]ij = rowi (B T ) · colj (AT )
▶ [B T AT ]ij = coli (B) · rowj (A) = [(AB)T ]ij
Basic properties of transposition
▶ (AT )T = A
▶ (cA)T = cAT , where c is a scalar
▶ (A + B)T = AT + B T
▶ (AB)T = B T AT
▶ (ABC . . . XY Z)T = Z T Y T X T . . . C T B T AT
▶ for square matrices (A−1 )T = (AT )−1 ≜ A−T
▶ proof:
▶ A−1 A = I =⇒ (A−1 A)T = I T =⇒ AT (A−1 )T = I
▶ but by definition of the inverse of AT we have AT (AT )−1 = I
▶ note
▶ Ax is the linear combination of the columns of A
▶ (Ax)T = xT AT is the linear combination of the rows of AT
Symmetric and skew-symmetric matrices
▶ Symmetric and skew-symmetric matrices are square
▶ Symmetric matrix: aij = aji or A = AT
▶ Skew-symmetric matrix aij = −aji or A = −AT
▶ Diagonal elements of skew-symmetric matrices are zeros
(aii = −aii =⇒ aii = 0)
▶ A + AT is always symmetric
T T
▶ A + AT = AT + AT = AT + A = A + AT
▶ A − AT is always skew-symmetric
T T
▶ A − AT = AT − AT = AT − A = −(A − AT )
▶ Any square matrix can be decomposed as
A + AT A − AT
A= + = Asym + Askew
2 2
| {z } | {z }
symmetric skew-symmetric
Rectangular matrices
▶ If R is a rectangular m × n matrix then RT is a rectangular
n × m matrix
▶ R RT is m × m symmetric matrix: (R RT )T = R RT
example
1 0
1 2 1 6 2
2 1 =
0 1 0 2 1
| {z } 1 0 | {z }
R | {z } RRT
RT
▶ Multiple permutations
▶ Inverse is transpose
P −1 = P T
xT x = (P x)T (P x) = xT P T P x =⇒ P T P = I =⇒ P T = P −1
LU factorization