Appendix C
Vector-Matrix Algebra
In this appendix we first review the determinant of a matrix, then we define the adjoint
matrix, the inverse of a matrix, and the derivative and integral of a matrix.
Determinant of a Matrix. For each square matrix, there exists a [Link]
determinant of a square matrix A is usually written as @A@ or det A. The determinant has
the following properties:
1. If any two consecutive rows or columns are interchanged, the determinant changes
its sign.
2. If any row or any column consists only of zeros, then the value of the dererminant
is zero.
3. If the elements of any row (or any column) are exactly k times those of another
row (or another column), then the value of the determinant is zero.
4. If, to any row (or any column), any constant times another row (or column) is
added, the value of the determinant remains unchanged.
5. If a determinant is multiplied by a constant, then only one row (or one column) is
multiplied by that constant. Note, however, that the determinant of k times an
n*n matrix A is kn times the determinant of A, or
@kA@ = kn @A@
874
This is because
ka11 ka12 p ka1m
ka21 ka22 p ka2m
kA = D T
o o o
kan1 kan2 p kanm
6. The determinant of the product of two square matrices A and B is the product of
determinants, or
@AB@ = @A@ @B@
If B=n*m matrix and C=m*n matrix, then
det(In+BC)=det(Im+CB)
If A Z 0 and D=m*m matrix, then
det c d = det Adet S
A B
C D
where S=D-CA1 B.
If D Z 0, then
det c d = det Ddet T
A B
C D
where T=A-BD1 C.
If B = 0 or C = 0, then
det c d = det Adet D
A 0
C D
det c d = det Adet D
A B
0 D
Rank of Matrix. A matrix A is said to have rank m if there exists an m*m sub-
matrix M of A such that the determinant of M is nonzero and the determinant of every
r*r submatrix (where r m + 1) of A is zero.
As an example, consider the following matrix:
1 2 3 4
0 1 -1 0
A = D T
1 0 1 2
1 1 0 2
Appendix C / Vector-Matrix Algebra 875
Note that @A@ =0. One of a number of largest submatrices whose determinant is not
equal to zero is
1 2 3
C0 1 -1 S
1 0 1
Hence, the rank of the matrix A is 3.
Minor Mij. If the ith row and jth column are deleted from an n*n matrix A,
the resulting matrix is an (n-1)*(n-1) matrix. The determinant of this
(n-1) (n-1) matrix is called the minor Mij of the matrix A.
Cofactor Aij. The cofactor Aij of the element aij of the n*n matrix A is defined
by the equation
Aij=(1)ijMij
That is, the cofactor Aij of the element aij is (1)ij times the determinant of the matrix
formed by deleting the ith row and the jth column from A. Note that the cofactor Aij of
the element aij is the coefficient of the term aij in the expansion of the determinant @A@ ,
since it can be shown that
ai1A i1 + ai2A i2 + p + ainA in = @A@
If ai1, ai2, p , ain are replaced by aj1, aj2, p , ajn, then
aj1Ai1 + aj2Ai2 + p + ajnAin = 0 i Z j
because the determinant of A in this case possesses two identical rows. Hence, we obtain
n
a ajkA ik = dji @A@
k=1
Similarly,
n
a akiA kj = dij @A@
k=1
Adjoint Matrix. The matrix B whose element in the ith row and jth column equals
Aji is called the adjoint of A and is denoted by adj A, or
B=(bij)=(Aji)=adj A
That is, the adjoint of A is the transpose of the matrix whose elements are the cofactors
of A, or
A11 A21 p An1
A A22 p An2
adj A = D 12 T
o o o
A1n A2n p Anm
876 Appendix C / Vector-Matrix Algebra
Note that the element of the jth row and ith column of the product A(adj A) is
n n
a ajkbki = a ajkA ik = dji @A@
k=1 k=1
Hence, A(adj A) is a diagonal matrix with diagonal elements equal to @A@ , or
A(adj A)= @A@ I
Similarly, the element in the jth row and ith column of the product (adj A)A is
n n
a bjkaki = a A kjaki = dij @A@
k=1 k=1
Hence, we have the relationship
A(adj A)=(adj A)A= @A@ I (C–1)
Thus
A 11 A 21 A n1
@A@ @A@ @A@
p
A 12 A 22 A n2
= G @A@ @A@ @A@ W
adj A p
@A@
A-1 =
o o o
A 1n A 2n A nn
@A@ @A@ @A@
p
where Aij is the cofactor of aij of the matrix A. Thus, the terms in the ith column of A1
are l/ @A@ times the cofactors of the ith row of the original matrix A. For example, if
1 2 0
A = C3 -1 -2 S
1 0 -3
then the adjoint of A and the determinant @A@ are respectively found to be
` ` -` ` ` `
-1 -2 2 0 2 0
0 -3 0 -3 -1 -2
-` ` ` ` -` `
adj A= G 3 -2 1 0 1 0 W
1 -3 1 -3 3 -2
` ` -` ` ` `
3 -1 1 2 1 2
1 0 1 0 3 -1
3 6 -4
= C7 -3 2S
1 2 -7
Appendix C / Vector-Matrix Algebra 877
and
@A@ =17
Hence, the inverse of A is
3 6 -4
17 17 17
adj A
A- 1 = C 177 -3
17 S
2
@A@
= 17
1 2 - 7
17 17 17
In what follows, we give formulas for finding inverse matrices for the 2*2 matrix
and the 3*3 matrix. For the 2*2 matrix
A = c d
a b
where ad - bc Z 0
c d
the inverse matrix is given by
c d
1 d -b
A-1 =
ad - bc -c a
For the 3*3 matrix
a b c
A = Cd e fS where @A@ Z 0
g h i
the inverse matrix is given by
` ` -` ` ` `
e f b c b c
h i h i e f
G- ` ` ` ` -` W`
1 d f a c a c
A- 1 =
@A@ g i g i d f
` ` -` ` ` `
d e a b a b
g h g h d e
Note that
(A- 1) - 1 = A
(A- 1)¿ = (A¿) - 1
(A- 1)* = (A*) - 1
There are several more useful formulas available. Assume that A=n*n matrix,
B=n*m matrix, C=m*n matrix, and D=m*m matrix. Then
[A + BC] - 1 = A - 1 - A - 1 B[Im + CA - 1 B] - 1 CA - 1
878 Appendix C / Vector-Matrix Algebra
If @A@ Z 0 and @D@ Z 0, then
B -1 A-1 -A - 1 BD - 1
c d = c d
A
0 D 0 D-1
0 -1 A-1
c d = c d
A 0
C D -D - 1 CA - 1 D-1
If @A@ Z 0, S = D - CA- 1 B, @S@ Z 0, then
B -1 A - 1 + A - 1 BS - 1 CA - 1 -A - 1 BS - 1
c d = c d
A
C D -S - 1 CA - 1 S-1
If @D@ Z 0, T = A - BD - 1 C, and @T@ Z 0, then
B -1 T-1 -T - 1 BD - 1
c d = c d
A
C D -D - 1 CT - 1 D-1 + D - 1 CT - 1 BD - 1
Finally, we present the MATLAB approach to obtain the inverse of a square matrix.
If all elements of the matrix are given as numerical values, this approach is best.
MATLAB Approach to Obtain the Inverse of a Square Matrix. The inverse of
a square matrix A can be obtained with the command
inv(A)
For example, if matrix A is given by
1 1 2
A = C3 4 0S
1 2 5
then the inverse of matrix A is obtained as follows:
A = [1 1 2;3 4 0;1 2 5];
inv(A)
ans =
2.2222 0.1111 0.8889
1.6667 0.3333 0.6667
0.2222 0.1111 0.1111
Appendix C / Vector-Matrix Algebra 879
That is
2.2222 -0.1111 -0.8889
A -1
= C -1.6667 0.3333 0.6667 S
0.2222 -0.1111 0.1111
MATLAB Is Case Sensitive. It is important to note that MATLAB is case sen-
[Link] is, MATLAB distinguishes between upper- and lowercase [Link], x and
X are not the same variable. All function names must be in lowercase, such as inv(A),
eig(A), and poly(A).
Differentiation and Integration of Matrices. The derivative of an n*m matrix
A(t) is defined to be the n*m matrix, each element of which is the derivative of the
corresponding element of the original matrix, provided that all the elements aij(t) have
derivatives with respect to t. That is,
d d d
a (t) a (t) p a (t)
dt 11 dt 12 dt 1m
d d d
a21(t) a (t) a (t)
A(t) = a aij(t) b = G
d d p
dt dt 22 dt 2m W
dt dt
o o o
d d d
a (t) a (t) p a (t)
dt n1 dt n2 dt nm
Similarly, the integral of an n*m matrix A(t) is defined to be
a11(t) dt a12(t) dt p a1m(t) dt
3 3 3
A(t) dt = a aij(t) dt b = G 3
a21(t) dt a22(t) dt p a2m(t) dt
3 3 W
3 3 o o o
an1(t) dt a2n(t) dt p anm(t) dt
3 3 3
Differentiation of the Product of Two Matrices. If the matrices A(t) and B(t)
can be differentiated with respect to t, then
d dA(t) dB(t)
[A(t)B(t)] = B(t) + A(t)
dt dt dt
Here again the multiplication of A(t) and dB(t)/dt [or dA(t)/dt and B(t)] is, in gener-
al, not commutative.
880 Appendix C / Vector-Matrix Algebra
Differentiation of A21(t). If a matrix A(t) and its inverse A1(t) are differen-
tiable with respect to t, then the derivative of A1(t) is given by
dA - 1(t) dA(t) - 1
= -A - 1(t) A (t)
dt dt
The derivative may be obtained by differentiating A(t)A1(t) with respect to t. Since
d dA(t) - 1 dA - 1(t)
[A(t)A - 1(t)] = A (t) + A(t)
dt dt dt
and
d d
[A(t)A- 1(t)] = I = 0
dt dt
we obtain
dA- 1(t) dA(t) - 1
A(t) = - A (t)
dt dt
or
dA - 1(t) dA(t) - 1
= -A - 1(t) A (t)
dt dt
Appendix C / Vector-Matrix Algebra 881