Professional Documents
Culture Documents
Content
1. Objectives
2. Matrices and Vectors
2.1 Definition of Matrices
2.2 Notation of Matrices
+Standard notation
Column vector notation of a matrix
4. Determinants
4.1 Introduction
4.2 Definition of determinant using Cramer's rule
system using Cramer's rule
+Unique solution of nonhomogeneous system A x = b for nnonsingular A matrix
4.3
+Definition
Minors
Cofactors
+Adjoint Matrix
4.4
Chess-board sign scheme
Cofactors
4.5 Properties of Determinants
properties
4.6 Easy computation of determinants by sweeping columns
5. Matrix Inversion
5.1 Introduction
Identity matrix
Matrix of cofactors
Chess-board pattern
Adjoint matrix
5.2 Definition matrix inverse using the adjoint formula
Definition matrix inverse
Nonsingular or invertable matrix
5.3
Trick to compute inverse of (2 2) matrix
(2 2) matrix
5.4 Inverse of (3 3) matrices
Matrix inverse using the adjoint formula
Inverse of a (3 3) matrix using the adjoint formula
sing elementary row operations
Inverse of a (3 3) matrix using elementary row operations
2. Direct Elimination
3. Gaussian Elimination and Back Substitution
4. Gauss-Jordan Reduction
5. Cramer's Rule
6.3 Geometrical Solution of Square (2
2) Systems
(2 2) systems graphically
n) Systems
Reference
[1]. Introduction to Linear Algebra, Gilbert Strang , Brooks/Cole 2006, Chapter 1, 2
[2]. Advanced Engineering Mathematics, T. Harman e.a., Brooks/Cole 2000, Chapter 2, 3
[3]. Linear Algebra With Applications, Steven J. Leon, Prentice Hall 2006, Chapter1, 2, 4.
[4]. Feedback Control Dynamic Systems, F. Franklin, Pearson Prentice Hall 2009, Appendix C.
1. Objectives
After completion of this chapter, the reader should be able to
1. Define and recognize a matrix and determine its dimensions.
2. Define a row matrix or row vector and a column matrix or column vector.
3. Know the difference between a scalar and a vector.
4. Compute the length (2-norm) and direction angle of a vector. Normalize a vector to unity
length.
5. State the criteria that must be satisfied for two vectors to be added or subtracted.
6. Compute the sum or difference of two applicable vectors.
7. Know when two vectors are perpendicular.
8. Define a square, symmetric and skew symmetric matrix.
9. Define the transpose of a matrix.
10. State the criteria that must be satisfied for two matrices to be added or subtracted.
11. Compute the sum or difference of two applicable matrices.
12. State the criteria that must be satisfied for two matrices to be multiplied together and determine
the size of the product.
13. Compute the product of two applicable matrices.
14. Determine the determinant
determining the determinant of higher-order square matrices.
15. Define a minor and a cofactor.
16. Define the identity matrix.
17. Define the inverse matrix. Identify a singular matrix.
18. Determine the inverse matrix
determining the determinant of higher-order square matrices.
19. Formulate a set of simultaneous linear equations in matrix form and solve for the unknown
vector for the case of two equations with two unknowns or three equations with three unknowns
using the following methods: Matrix inverse, Gaussian elimination, Gauss-Jordan reduction, and
Cramer's rule. Solve two equations with two unknowns graphically and show unique solution, no
solution and infinitly many solutions graphically.
20. Know how to perform bases transformations
21. Know how to find out if a square system of linear equations may have infinitly many solutions
or no solutions at all.
22. Find the solution of a square system of homogeneous equations.
23. Compute the eigenvalues and the eigenvectors of a square matrix.
rows and
The horizontal lines in matrix A are called rows, the vertical lines columns. The element in the i-th row
and the j-th column is denoted by
that is a lower case italic letter with a double subscript. The first
subscript indicates the row, the second subscript the column. The lower case letter usually corresponds
to the upper case letter used for the matrix, here a and A.
Size or Dimension of a Matrix
Matrix A is sometimes written as
to emphasize on the elements, where the symbol c
denotes "for all". To emphasize that matrix A is of size or dimension (m n) we write
that is
where
The column vector notation of a matrix is used in section 3.4 for the column format representation of
a linear system of equations.
Transpose operator
To save (paper) space, column vectors are often written as transposed row vectors, see section 3.2 for
the definition of transposed. Using the transpose opeartor, a column vector with three elements
The elements
form the main diagonal of the square matrix. The other elements are called
the off-diagonal elements.The sum of the main diagonal elements is called the trace of square matrix,
hence
Overview
The notation A =
The rows of matrix
and
and B =
are equal if
m n) and
=
The trace of a square matrix is the sum of the main diagonal elements.
,c
= (m n).
. The symbols and are the scalar elements of the vector. Notice
represent the cartesian coordinates of the point x in a plane
In working with linear systems, it is generally most convenient to represent the solutions in terms of
column vectors or (n
n
matrices of real numbers is called Euclidean
n-space and is usually denoted by
Thus
and are our familiar spaces "line", "plane" and "space". The corresponding column
vectors are called 1-D, 2-D or 3-D vectors, D for dimensional.
Position vector in
We represent (position) vector
in as an arrow from origin O(0, 0) to point P(
) in a
cartesian coordinate system, as in Fig. 1, using standard orthonormal basis vectors
, such that
usually written as
To show that vector a now is a general vector, so
not a specific row or column vector, we use a notation with comma's between the elements. Remember,
row and transposed column vectors are written with spaces between the elements.
y-axis
a , P(a1, a2)
a2
a
e2
O (0,0)
q
e1
a1
x-axis
The length of vector a is the length of the line segment OP and can be computed with Pythagoras as:
and is called Euclidean norm or 2-norm, to indicate that the vector lengths are squared. The length of
a vector is also named magnitude, specially when the vector represents a physical quantity (velocity,
force etc). Similarly, the length of a 3-D vector a =
is
assuming that
is not zero. This unit vector defines the direction of vector a. A nonzero vector
divided by its magnitude is said to be normalized, and has length 1.
In the rest of this chapter we will omit the subscript 2 in
is the only norm we use!
Direction of a vector in
The angle between the positive x-axis and the vector a (taken in anti clockwise direction) determines
the direction (or orientation) of the vector. It is often called the direction angle of the vector, and is
usually measured in radians.
The direction angle for vector a lying in the first and fourth quadrant can be computed with
For vectors in the second quadrant we must add radians while for vectors in the third we must
subtract
Table 2.2 in Chapter 1: Complex Numbers. To be sure, always draw the
vector in
Any two arrows having the same length and the same direction are said to represent the same vector.
Only arrows that start at the origin are called position vectors; all other vectors are so-called free
vectors.
Size of a vector and number of elements
The size of a vector is equal to size of the corresponding column matrix or row matrix. For example,
the size of vector
considered to be a row vector
Addition/subtraction
Elementwise multiplication
All operations are done element wise, hence the vectors hust have the same dimension.
Scalar multiplication
less than 1 shrinks the vector, while a positive value greater that 1
, or sometimes as
(2)
Number (1) is just a definition and (2) can be proven using the law of cosines in a triangle formed with
the vectors a, b and
as sides.
Important comment on the dot product
1. The vector dot product is a scalar ( a number) and is therefore called scalar product. It is also
called inner product.
2. The order of a and b in the dot product makes no difference, so
3. Choosing
4. The length (or 2-norm) of vector a can thus also be determined using the dot product:
5. Knowing the dot product and the vectors we can compute the angle
for
6. The dot product (inner product) can be computed as the product of the vector and its transpose as
follows:
If a and b are column vectors of equal length n , so
transpose operator T,
the inner product
can be computed with
Falk schemes for
and
then
so
Orthogonal vectors
1. If the dot product
2. In
and
For example if
Draw the vectors to check.
hence
a b 5
3. If orthogonal vectors are of unity length they are called orthonormal.
Cauchy-Schwartz Inequality
If a and b are two vectors in either in
or
The equal sign holds only if one of the vectors is the zero vector 0 or if the vectors are colinear, that is
if they are lying on the same carrier.
The inequality follows from the fact that
for vectors that are not pointing in the same or
opposite direction.
Vector projections and distance
The inner product can be used to find the projection vector p of a vector b on another vector a, see Fig.
1b.
y-axis
6
L
d = b Kp
y = 0.5 x
4
a
5.6
p
q
x-axis
4
O (0,0)
2.8
Note that vector p is lying on line L in the direction of vector a, while vector
perpendicular to p.
is
Derivation
For the length of projection vector p we find
= ||b||
The dot product of a and b is
hence, we can express the length of p with the dot product as follows
=
Vector p has the same direction as vector a, so we can write
,
So, using the length of vector p we find for the scalar multiplier
we find
For example if
then
so
The shortest distance of the tip of vector b to the carrier of vector a, that is to the line
the origin is
and
through
and b =
are orthogonal.
and b =
(d). Find the projection vector p of vector b on vector a and the shortest distance of b to the line
through a.
Solution
(a) Length and the direction angle of vector a =
y-axis
a = K3, 4
5
4
a =5
q = 127 +
0,
K4 K3
x-axis
and b =
The dot product is zero while the length of each vector obviously is not zero 0 a
z-axis
y-axis
q = 90 +
b = 6, K2, 1
a = 2, 5, K2
x-axis
(c) Angle between vectors
a=
and b =
=
(smallest angle between a and b )
z-axis
q = 97 +
y-axis
b = 3, K2, 1
a = 1, 2, 0
x-axis
(d). Projection vector p of vector b on vector a and the shortest distance of b to the line through a.
Software help
represent
where
Elementwise operations
These operations can also only be done if the matrices have the sane size, then the elementwise
multiplication is defined by
where
v
Elementwise division and exponentiation is done with the * replaced by / respectively ^, see section 2.3,
where the same is done for vectors.
Thus, for addition, subtraction and elementwise operations, corresponding elements are added ,
subtracted respectively elementwise operated on. The resulting matrix is of the same size as either of
the matrices being combined, thus
Scalar multiplication
If A is a matrix and is a scalar , then is the matrix formed by multiplying each of the elements of A by
thus
A=
The multiplication dot is often omitted when no confusion is possible. Arithmatic operations and
elementwise operations will be illustrated in Example 3.1
Example 3.1 Arithmetic operations and elementwise operations with two matrices
the
Solution
(a).
.The solution is possible because both matrices have the same size. We simply add the
corresponding elements and obtain:
Don't be disturbed by the + sign in the third column. Matrix C has a combination of variables and
constants, so the result will have the same property. If neccessary you could have used some
parenthesis:
(b)
have
If
(c)
. In this case, the elements of B are subtracted from the corresponding elemets of A. We
then
(d)
Software help
Matrix multiplication
Definition of matrix multiplication
Multiplication of two matrices is a bit tricky and requires a little practice. In order for it to be possible,
the number of columns of the first matrix must be equal to the number of rows of the second matrix.
This means that the matrix multiplication is not commutative except in very special cases. In general
Thus, the order of the multiplication is very important. Here, the matrix multiplication operator is again
denoted by a small dot as in A. B , to distinguish it from the scalar multiplication operator denoted by a
somewhat higher dot as in
. Both operators however are often left away when there is no confusion
possible.
Let C represent the product of the two matices A(m n) and B(n
p) , thus we have
A(m n) B(n
p) = C(m p)
Any element in the matrix C can be obtained from the elements of matrices A and B with the
following algorithm:
and
To see what this really means we will visualize the process.
Visualization of matrix multiplication using a Falk-scheme
To form
, the number of columns of A must equal to the number of rows of
called compatible matrices.
To find the
is the dot product of the two vectors found at row i of matrix A and column j of matrix B.
In fact
1j
2j
nj
i1
i2
in
ij
or
where
and
elements.
Find
and
Solution
A(2
The product
3) B(3 2) = C(2
2).
B(3
The product
2) . A(2 3) = C(3
3).
Comment
Notice that
Handcalculation of matrix multiplication is quite involving and cumbersome.
However using the Falk-schema makes live easier, see Example 3.3.
If possible, always use some reliable software to check your hand calculations like Matlab.
Software help
Find
and
Solution
(a). The required Falk-scheme is:
B
To determine
we multiply the first row of the first matrix (A) by the first column of the second
matrix (B) on a element-by-element basis, and then add the results using the scheme above. This
yields
To determine
giving
To determine
Finally, to determine
Notice that in determining the various coefficients, there are always an equal number of elements in the
row of the first matrix being multiplied with the number of elements in the columns of the second
matrix. This is a result of the fact that the number of columns of the first matrix must be equal to he
number of rows of the second matrix.
(b). The required Falk-scheme now is
B
In this case, we need to determine nine different constants, each of which is determined by multiplying
the two elements of a row of B by the two elements of a column of A and adding the products. Using the
scheme below we can easily compute the product.
B
To check your computation you always can use appropriate free software like Wolfram Alpha. Try It!
Software help
and
Find
(a).
and
(b).
while C and D
Solution
(a).
A B=
B A=
Obviously
(b).
Obviously
Software help
Properties
If
is a scalar and
and
are (m
n) matrices then
and
then
Then
, if a and b are
Software help
Two column vectors a and b in can be consideres as (n
can the form the matrix product
or,
more simply, as a real number . The position of the transpose operator and also order of the vectors is
important. Look at the solution of next example to see that
and
do not deliver the dot product
but different 3-by-3 matrices. Do it!
Find
(a). What kind of vectors/matrices are a, b and C?
(b). Determine the inner product
(c). Determine the products,
Solution
(a)
matrix, call it
matrix, call it A.
1) matrix, call it B .
C.
(b)
Falk schemes
and
=F
Comment The result F is a 3-by-1 matrix or column vector as result of a matrixvector product.
(c2)
Vector
, hence
Comment The result G is a 1-by-3 matrix or row vector as result of a vector-matrix product.
Software help
Find if possible
(a). The size , trace and the transpose of A, B and C.
(b).
Solution
(a) The size , trace and the transpose of A, B and C.
trace
transposes
(b)
Falk-scheme for
and
C(
Falk-scheme for
2)
D(
Comment
are both square matrices , but different values and different sizes.
Software help
If
then the matrix is called skew-symmetric. One type of application that leads to symmetric
matrices are problems involving electric networks and skeleton structures. Symmetric matrices have
nice properties, for example they always have real eigenvalues and orthogonal eigenvectors, and
therefore are always diagonalizable.
Some matrices have special structures and properties and are given dedicated names.
Diagonal matrix D : A diagonal matrix D is defined as a symmetric matrix in which all the offdiagonal elements are zero.
Zero matrix O : The square matrix for which all elements are zero is called a zero matrix O.
Identity matrix I : The n
matrix I.
The square zero matrix and the identity matrix play the same role in matrix algebra as the "0" and the
"1" in normal algebra.
Upper/Lower triangular matrix U and L : A matrix is said to be upper triangular if all elements
below the main diagonal are zeros.
orthogonal when
Submatrix A submatrix of A( m n) is the matrix A with certain rows and columns removed.
Block matrix A block matrix or partitioned matrix is a matrix which is broken into submatrices.
Matlab has a group of functions to generate special matrices. We will introduce these functions on need
to know basis.
This system is given in the so-called row format form: each row is precisely one equation. We can
easily solve this system algebraicly by hand using elimination. Multiplying the second equation by 2
and adding it to the first delivers
so ,
and
If we graph the two straight lines the intersection point is indeed the solution:
This point satifies each of the two equations.
x
row 2
x = 0.5 x C1.5
2
K3
1.5
x = 1, x = 2
1
K1
K2
K1
row 1
x = 0.5 $x
1
which is called the column format form. Using this alternative we can represent the linear system as a
vector-matrix equation of the form:
where
see also section 2.2 for the column vector notations of a matrix. Notice that the vectors
are lower case boldface letters with a bold subscript, thus indeed written as vectors.
In fact the right-hand side vector b is a linear combination (see below for the definition) of the column
vectors of matrix A. We already know that
so the linear combination takes the form
x2
0
b=
3
2
K1
2$
K1
2
1K
a2
K1
x1
a1
K1 K
2
1$
K1
where A is the system matrix consisting of the coefficients of the three equations, is the vector of
unknowns and b is the vector of right-hand-side constants. Using this method we can thus represent
the linear system as a matrix-vector equation of the form
Observe that in this particular case the sizes of the A and x match to produce b of the form
A(2
2) . x
1) = b
Notice that we can read the two equations back from the vector-matrix form by simply performing
matrix-vector multiplication. The column format however can best be seen from the linear system's
equations.
Linear combination of vectors
The linear combination of a set of vectors
is defined as follows
If
are vectors in and
linear combination of these vectors if
y=
that is, if y can be written as a sum oof scalar multiples of these vectors
n) =
is a linear combination of the column vectors of matrix A. To show this is right consider the following
2-by-2 case.
)=
Independent vectors
The linear independency of a set of vectors
If
are vectors in
and
is defined as follows
where
We generally think of
Matrix-vector equation
Our goal now is to generalize the scalar equation to the matrix-vector equation
However here
is not equal to 1/A
further elaborate the concept of inverse matrix.
where I is the (n
normal algebra.
n ) identity matrix. The identity matrix plays the same role as the number 1 in
Solution
Using a Falk-scheme we have
Thus
the inverse of square matrix A. Check
identity matrix.
Software help
matrix
Solution
Using a Falk-scheme we have
________________________
Hence
Software help
Given the following system of three linear equations in three unknowns in row-format:
Find
(a). The linear system written in column format. Identify the various scalars, vectors and matrices if
present.
(b). The linear system written in matrix-vector representation. Identify the various scalars, vectors
and matrices if present.
(c). The solution of the system using the matrix inverse of Example 3.9
Solution
(a) Column format
where
where A is the system matrix consisting of the coefficients of the three equations, is the vector of
unknowns and b is the rhs vector of constants.
(c) Solution of the system
Software help
4. Determinants
In this section we use determinants to solve linear systems. First, we use Cramer's rule for solving a 2
on the fly. We also will need
determinants for matrix inversion. So let's start quickly!
4.1 Introduction
The determinant of a matrix can be determined only for a square matrix. Unlike a matrix, a determinant
has a single value. There are two different notations for a determinant. For a matrix A, the determinant
can be represented as
or simply as
There are many "tricks" that appear in mathematics texts to simplify the process. The problem with
some of these tricks is that they work fine when the values in the matrix are "clean" numbers, but the
process becomes more burdensome when the numbers represent "real" data.
With the ready access to such mathematical packages as Maple, Matlab and the free software like
Octave , FreeMat and Scilab but also Wolfram Alpha in the scientific community, there is little reason
or justification for trying to accomplish the chore by hand for anything but the simple case. For that
reason, we will limit our development here to the simple
development of the latter, we will introduce the concept of expansion of minors, which in theory could
be used for any determinant.
The simplest matrix is a trivial 1 x 1 matrix. This is really a scalar, and its determinant is simply its
value. Therefore, we need not consider it any further.
Eliminate
we have
and subtract
Now eliminate
Solving for
and subtract
now delivers
the determinant of matrix A. The solution method used is called Cramer's rule. This rule can be
generalized to more then two dimensions, see section xx.
Example 4.1
Solve the following system of two linear equations using Cramer's rule.
Check the solution by substituting the solution back into the equations.
Solution
Notice the extensive use of paraenthesis in computing the various determinants to avoid sign errors!
Check
Solftware help
Unique solution of nonhomogeneous system
If the system of equations is nonhomogeneous (
only if matrix A is nonsingular, that is if
) and
4.3 Determinant of (
) matrices
Definition
is defined as:
the product of the other two elements. A common error in evaluating determinants is that of keeping the
signs straight, since some of the elements may have negative signs. See also the Hand Calculation
solution of Example 4.1 and Example 4.2.
Example 4.2
Determine the determinant of the matrix
Solution
The determinant is
Notice the cancelation of the minus sign in the second term in this example. It is therefore useful to use
parenthesis around all elements.
Software help
Minors
minor. Let
represent a minor
corresponding to the i-th row and the j-th column of a matrix A. If A is a square matrix of size n n ,
is a determinant of size
by
formed from the matrix by crossing out the i-th row
and the j-th column and evaluating the resulting determinant.
Cofactors
A cofactor will be denoted as
by the relationship
Thus, cofactors are alternaterly equal to the minors or the negatives of the minors. Using a chessboard sign scheme, see section 4.4 and Example 4.4 below, the sign of cofactors can easily be
determined.
The significance of minors and cofactors is that a higher-order determinant can be expanded into the
sum of lower-order determinants. For example a
determinants.We easily can see how the number of smaller determinants can quickly grow as
successive expansion is performed.
Adjoint Matrix
The adjoint matrix is the transpose of the matrix of its cofactors:
The adjoint matrix will be used for calculation the inverse of a square matrix, because it can be shown
that
4.4 Determinants of (
) matrices
Definition
the first row, the determinant is defined as
The individual cofactors can be computed as (notice the red plus and minus signs)
The usage of cofactors and minors will become completely clear in Example 4.3 and Example 4.4
below.
Chess-board sign scheme
Using a chess-board sign scheme, see Example 4.4 below, the sign of cofactors can easily be
determined. Clearly, this is as far as we need to go.
matrix
Solution
Although tedious, the procedure is straightforward. Starting with
row and then repeat the procedure on the second and third rows. The nine minors are calculated as
follows:
Software help
Example 4.4
Determine the cofactors of the nine minors determined in Example 4.3.
Solution
The cofactors are directly related to the minors with only a sign change for alternative values. The
relationship is
Using the chess-board sign scheme below, the cofactors can more easily be formed from the minors:
Chess-board
Minors
Cofactors
Software help
Example 4.5
Determine the determinant of matrix A of Example 4.3 by expansion in cofactors along the
(a). first row of matrix A, and
Solution
(a). Determine
Matrix A
Cofactors
We only need three of the nine minors for detemining the deteminant. However, the other six will be
used later when we calculate the inverse matrix. Substitution of the values from Example 5.4 leads to
=
=
(b). Determine
Since we do not need all minors we simply expand along the first column keeping track of the correct
signs using the check board sign scheme:
=
Using parenthesis around each element and square brackets to group each expansion as shown
This is as far as we go doing handcalculation for deteminants. For determinants greater than
everybody uses software from internet like for instance Wolfran Alpha. Have a look and enjoy!
Software help
n ) matrices A and B :
is changed.
results in
4. Adding a multiple of one row (or column) to another does not change the value of the determinant.
5.
6.
7.
8.
Example 4.6
Determine the determinant of the matrix of Example 4.3 by sweeping the first column with the first
row.
Solution
Sweep the first column, creating two zeros:
add R2 to R1
add 3 times R2 to R3 :
Now, expand along the first column keeping track of the correct sign:
Software help
Example 4.7 Determinants of diagonal, upper triangular and lower triangular matrix
Determine the determinant of the following matrices: diagonal matrix D, upper triangular matrix U and
lower triangular matrix L :
Solution
Expanding along the first row (or column) shows that for all matrices, the determinant is simply the
product of the main diagonal elements:
Software help
Solution
Since the matrix can be written as
Now, expanding
Software help
where
the determinant is
5. Matrix Inversion
5.1 Introduction
We now turn our attention back again to the concept of matrix inversion, which will be one of the last
major matrix manipulations of this chapter. Determination of the inverse of a matrix is one of the most
difficult processes to perform manually but is quite simple to perform with commercial available
software like Maple and Matlab or with the free software alternatives like Octave, FreeMat or Scilab
and also Wolfram Alpha to mention a few.
The inverse of a matrix will be considered here only for the case of a square matrix, which is the
usual application. There is also a concept called the pseudo inverse of a nonsquare matrix, but that is
beyond the scope of the present treatment. Inverses of square matrices will be used to solve systems of
linear equations, see Section 6.
As in the case of determinant calculation, we will limit how far we go with the manual process: we will
only invert 3-by-3 matrices. The matrix to be inverted will be called original matrix. For your
convenience we now repeat some important topics needed for matrix inversion.
Identity matrix
Remember, the identity matrix is to a matrix what the number 1 is to a scalar. It is a square matrix with
the value 1 along the main diagonal and 0 at all other positions. It will be denoted by I and will have the
form
The actual size of the identity matrix I will become clear from the context and can be adjusted for any
particular case as long as the number of rows is equal to the number of columns.
Matrix of cofactors
A matrix of cofactors is a square matrix in which each element of the original matrix is replaced by its
cofactor. It will be denoted by
and can be represented by
where
is the minor found by crossing out the i-th row and the j-th column in the original matrix and
evaluating the determinant.
Chess-board pattern
The plus- and minus signs, according to
, in front of the cofactor definition above, follow a
checkboard pattern with a plus sign in the upper-left corner:
Adjoint matrix
The adjoint matrix is defined as the transpose of the matrix of cofactors. It will be denoted
can be expressed as
and
The adjoint formula looks deceptively simple, but remember that there are quite a few operations
required to obtain the adjoint and the determinant. Note that the determinant in the denominator is a
scalar and all elements of the matrix in the numerator will be divided by the value of this scalar. It is
perfectly clear from the adjoint formula that the inverse of a square matrix only exists if it deteminant is
nonzero.
Nonsingular or invertable matrix
Only a square matrix can have an inverse
If
If
exists.
5.3 Inverse of (
) matrices
Chess-board
signs:
Cofactors:
Matrix of cofactors:
Adjoint matrix:
Determaint:
Inverse:
Solution
Matrix
Determinant
Inverse
Check that
Matrix
Determinant
Inverse
5.4 Inverse of (
) matrices
In this section, we will compute the inverse of a 3-by-3 matrix by using (1) the adjoint formula and (2)
by using elementary row operations.
Matrix Inverse using the Adjoint Formula
Inverse matrix
Determinant
Adjoint matrix
Matrix of cofactors
Determine the inverse matrix of A of Example 4.3 using the adjoint formula and check the result.
Solution
The matrix is repeated here for convenience.
Most of the computations required have already been made in preceeding examples. The
determinant is already determined in Examples 4.5 and 4.6:
The adjoint matrix is determined by taking the transpose of the matrix of cofactors
is determined with
The matrix A above will appear again in Example 6.2 in the next section.
Software help
Matrix Inverse using elementary row operations
Although the adjoint matrix and the determinant can be used to compute the inverse this is however
not generally used in computer solutions. The method using elementary row operations is usually more
efficient for numerical computation and for hand calculation with "easy" numbers.
To find the inverse of a square matrix, we use elementary row operations:
1. Replace a row of the matrix by a nonzero multiple of the row
2. Replace a row by the sum of that row and a multiple of another row
3. Interchange two rows of a matrix
The elementary operations on rows (or on columns, not both) of matrices may be performed because of
the linearity properties of matrices. Elementary row operations are also used for the Gaussian
elimination and the Gauss-Jordan reduction to find the solution of a system of linear equations, see
section 6.2. We now give an example of using elementary operations to find the inverse of a 3-by-3
square matrix.
Solution
Start with
Now manipulate the columns of A and I simultaneously in such a way that matrix A
becomes I, and consequently I becomes
because
Now perform the following elementary row operations simultaneously on both matrices:
(1) Add first row to third row
(5) Finally rearrange columns of left matrix to the identity matrix giving
Check result
This process to find the inverse of a square matrix is known as Gauss-Jordan reduction, see also
section 6.2.
Software help
) known
),
In the following section we will look at some solution methods for square systems only.
where A is the coefficient matrix, x is the vector of unknowns and b is the right-hand-side (rhs) vector
of known constants .
In case there is some confusion about this operation, note that the left-hand-side (lhs) involves an n
matrix multiplied by an n
n
(also a column vector).
Thus, the entire set of equations can now be written in matrix-vector form as
n) equations. When
we have a
The result is surprisingly simple looking, but it obscures the fact that each of the quantities involved is
multidimensional in nature. Nevertheless this type of representation lends itself to the handling of large
quantities of data. We will now show how a square nonhomogeneous system of ( 3 3) equations can
be solved using the following methods:
1. Matrix inversion.
2. Direct Elimination.
3. Gaussian elimination.
4. Gauss-Jordan reduction.
5. Cramer's rule.
We assume that the solution indeed does exist, thus the coefficient matrix A is invertible, so its
determinant
In section 6.4, we will consider the solution of homogeneous systems to be used
for computing eigenvalues and eigenvectors.
1. Matrix Inversion
Now, how do we solve the equation
? If this was an ordinary one-dimensional algebraic
equation like
we would simply write
However with matrix equations such as this, we
premultiply both sides of the equation by the inverse matrix
Performing this operation we have
Note that if we premultiply on the left we must also premultiply on the righ. Now, the product of a
square matrix and its inverse is the identity matrix, that is
Finally, it can readily be shown that the product of the identity matrix times a vector is the vector itself,
that is
Solve the following square 2-by-2 system using the inverse matrix and matrix algebra:
Solution
Matrix notation:
Solution:
Matrix:
Determinant:
Inverse:
Solution:
Check:
Software help
Example 6.2
Given a physical system with three unknown varaibles
three linear equations
Solve for the three unknowns using matrix inversion and check the result.
Solution
The set of equations can be written in matrix-vector form as
where the inverse matrix was already determined in Example 5.2. Therefore we can immediately write
down the solution as
thus,
and
Substituting the solution into the matrix vector equation should result in the rhs vector of constants,
thus
Software help
2. Direct Elimination
Small systems of equations can always be solved by direct elimination. A systematic way of direct
elimination is the method of Gauss. Using this method we transform the square system of equations to
an equivalent triangular system that has the same solution but is easier to solve. During this
transformation we may only use the following basic operations:
(1). Interchange two equations in place.
(2). Multiply an equation by a nonzero number.
Example 6.3
Given The following square system of equations
Find
(a). The solution using the three basic operations mentioned above. Show the used operations, both on
the bracketed equations and on the vector-matrix form.
(b). Check the solution by substituting it into the square system.
Solution
(a).
Step 1 Add -2 times row 1 to row 2 and -3 times row 1 to row 3 to make the elements in the first
column below the main diagonal zero.
Step 2 Add -4/6 times the second row to the third in order to make the elements in the second row
below the main diagonal zero.
The system of equations is now written in so-called upper triangular form. The corresponding upper
triangular A matrix has only zero entries below the main diagonal. The solution to such a triangular
system can easily be found by solving the three equations from bottom to top as follows:
Third equation :
Second equation:
Fist equation:
Done.
Software help
The Gaussian elimination method uses the so-called augmented matrix, which is the coefficient
matrix A augmented (extended) with rhs vector b, thus
Now, we try to change the A matrix augmented matrix into an upper triangular matrix by performing
the following elementary row operations on the complete augmented matrix:
1. Replace a row of the matrix by a nonzero multiple of the row
2. Replace a row by the sum of that row and multiple of another row
3. Interchange two rows
These elementary row operations are in essence the same as the three basic operations used for direct
eliminationen. After applying these elementary row operations, the corresponding augmented matrix is
then converted into a so-called row echelon or staircase form.
After this row echelon matrix is derived a so-called back substitution is performed to find the solution.
We give an example to show the mechanics.
Example 6.4
substitution
Find the solution by Gaussian elimination and back substitution. Check the result.
Solution
Form the augmented matrix and write next to it the elementary row operation to perform.
[A|b] =
Equations
Solution :
4. Gauss-Jordan Reduction
In this case, we try to reduce the matrix A part of the augmented matrix into an identity matrix using
elementary row operations only. Doing the elimination process, the vector b part automatically changes
to the solution. We use the same example to show the mechanics. Gauss-Jordan reduction is sometimes
shortly called row reduction.
Example 6.5
Given
Solution
To solve the given linear system by Gauss-Jordan reduction, we transform the A part of the last matrix
of the previous example, which is in row echelon form, into the identity matrix by the following steps
using elementary row operations only. (next to the matrix we again denote the applied operation):
Step 1
Multiply R3 by
Step 2
Add R3 to R1
Step 3
Add R3 -2 times to R2
Step 4
Divide R3 by 3
Step 5
Add R2 -2 times to R1
Step 6
So, we add 6 Gauss-Jordan reduction steps to the 3 Gaussian elimination steps to arrive at the result.
Notice that we now do not need the backsubstitution process.
Remarks
As we perform elementary row operations, we may encounter a row of the augmented matrix being
transformed to upper triangular form whose first n entries are zero and who's
entry is not zero.
In this case, we can stop our computation and conclude that the given linear system is inconsistent,
and therefore has no solution. We come back to this subject in section 6.4.
In both Gaussian elimination and Gauss-Jordan reduction, we can only use row operations. Do not
try to use any column operations.
Software help
5. Cramer's Rule
Example 6.6
(a). Use Cramer's rule to solve
Solution
(a). Crame
Therefore
Substitution of the solution into the three equations shows that the solution is correct:
Substitute
Substitute
:
and
Cramer's
rule
One of the advantages of Cramer's rule is that we immedaitely can see that the system has no
solution.
Software help
) Systems
If we have equations in
we can try a geometrical solution, using the row format or column format
description of the system, see also section 3.4. We give an example with three sets of equations in
Example 6.7
1.
Find the solution by using matrix inversion and explain the result graphically.
Solution
Use:
With:
|A|=
Ad 1. Unique solution case
Equations
Matrix Equation
Matrix
Determinant
Inverse matrix
Solution:
Grafical interpretation
Row format
One intersection = solution
Column format
Linear combination:
Column format
Row format
x
b
2
2
x = x K2
2
2
a
1.5$a
solution
K1
(1.5, -0,5)
K2
K0.5$a
x =Kx C 1
2
Equations:
Matrix Equation
Matrix:
Determinant:
singular matrix!
Grafical interpretation
Row format
Column format
Linear combination: Impossible since and
(because lying along the same carrier).
Column format
Row format
carrier
x
x
K1
1
b
K1
x =K2$x C1
2
x =K2$x K 0.5
2
Equations:
Matrix Equation
Matrix:
Determinant:
Remark:
singular matrix!
Actually, we only have one equation :
Choosing
Hence x =
Grafical interpretation
Row format
Column format
Infinitly many linear combination possible since
For example
Row format
Column format
carrier
a1
a2
1
K1
b
0.5 1
0
K1
4$x C2$ x = 2
1
2$x Cx = 1
1
Software help
Keeping in mind the definition of rank, we also can say that the system has a unique solution if the
coefficient matrix A and the augmented matrix
both are full rank, that is if
.
However, if the coefficient matrix is singular, so if
then the solution may have infinitly
many solutions. or no solution at all. The system has infinitly many solutions if the coefficient matrix
A and the augmented matrix
are equal but not full rank, that is iff
The system then is still called consistent, however with infinitly many solutions. We can choose
so-called free variables to find an expression for the infinitly many solutions.
On the other hand, the system is inconsistent, hence has no soution, if
and the coefficient
matrix A and the augmented matrix
have different ranks, that is if
Non-homogeneous
n n System
Ax =b
A is singular
det A = 0
rank A = rank A b = r ! n
N solutions
n Kr free variables
consistent system
6.5 Square (
rank A s rank A b
0 solutions
inconsistent system
A is non-singular
det A s 0
1 solution
consistent system
We know from the preceeding section that, a square system has only a unique solution if the
determinant of the coefficient matrix is nonsingular, thus if
Such a system is called
consistent. If however the determinant is singular, thus if
the square system may have no
solution or infinitly many solutions. A system with no solutions is called inconsistent. A system with
infinitly many solutions is also called consistent. We give an example to show how we can find out
what kind of solution we have using the flowchart above and just using Gaussian elimination.
Example 6.8
zero determiant
Given
Find
(a). Check that the determinant of the coefficient matrix A is zero.
(b). Show, that the system is inconsistent with no solutions using the flowchart.
(c). Show, that the system is inconsistent with no solutions using Gaussian elimination.
(d). The rhs vector of known constants is changed to
Repeat part (b) and (c), but now showing that the system has infinitly many solutions.
Show that the solution vector can be written as
Solution
(a). Check that the determinant of the coefficient matrix A is zero.
Expanding the determinant along the first row gives us:
(b). Show, that the system is inconsistent with no solutions using the flowchart.
leads to: 0 solutions.
Maple/Matlab:
Nonhomogeneous n n System
Ax =b
A is singular
det A = 0
rank A = rank A b = r ! n
N solutions
n Kr free variables
consistent system
rank A s rank A b
0 solutions
inconsistent system
A is non-singular
det A s 0
1 solution
consistent system
(c). Show, that the system is inconsistent with no solutions using Gaussian elimination.
Add -3 times R1 to R2
Add -3 times R1 to R3
Add -2 times R2 to R3
Stop
As soon as we have a zero on the main diagonal of the A part of the augmented matrix and a non-zero rhs
The last equation is impossible, hence we have an inconsistent square system with no solutions.
(d). The rhs vector of known constants is changed to
(d1) Show, that the system now has ininitly many solutions using the flowchart.
Maple/Matlab:
Nonhomogeneous n n System
Ax =b
A is singular
det A = 0
rank A = rank A b = r ! n
N solutions
n Kr free variables
consistent system
rank A s rank A b
0 solutions
inconsistent system
A is non-singular
det A s 0
1 solution
consistent system
(d2) Show, that the system has ininitly many solutions using Gaussian elimination.
Show that the solution vector can be written as
Add -3 times R1 to R2
Add -3 times R1 to R3
Add -2 times R2 to R3
Stop
As soon as we have a all zero row, the system has infinitly many solutions.
We now have two equations in three unknows, so one variable can be freely choosen. This variable is
the so-called free variable. Any of the three variables can be picked as free variable. The other two then
can be expressed in the free one. In this case it is convenient to choose as free variable, see also the
Maple and Matlab solutions.
Picking
and
infinitly many solutions because the free variable can have any real value. Look at the Maple and/or
Matlab solution to see why is choosen as free variable in this case.
and is called the general solution. A particular solution is found by selecting a particular value for
Software help
briefly be written as
The homogeneous n n linear system has exactly one solution, namely the trivial solution
when A is nonsingular, that is when
Nontrivial solutions, including the zero vector, only exist when A is singular, that is when
In that case there are infinitly many solutions, depending on (
Notice is the number of variables and is the rank of A .
Recall that the rank of a matrix A equals the number of independent column vectors of A. If all
column vectors of matrix
are independent, we say that the matrix has full rank and
More simply put, the rank of a matrix A is the number of non-zero rows of the with
rref(A)reduced matrix in Matlab or with
in Maple.
The rank can, as expected, conveniently be computed in Matlab with rank(A) and in Maple with
The criteria for the solvability of a homogeneous n
below.
Homogeneous
n n System
Ax =0
A is singular
det A = 0
N solutions
including the trivial solution
n Kr free parameters
A is non-singular
det A s 0
1 solution x=0
(trivial solution)
Solution
and
x1
1
0
0
x2
0
1
0
x3
-0.2
-0.5
0.0
b
0
0
0
non-zero row
non-zero row
zero row
non-pivot row
Comment
Free variable is the one above the non-pivot row , so
Two nonzero rows indicate that rank(A) = 2
If
we choose
Then
And
Software help
Solution
As you can easily verify, the determinant
the trivial solution
Software help
7. Problems
1.
Compute:
(a).
(b).
(c).
(d).
(if possible)
2.
Determine x y and y x
3.
Given the matrices
and y =
Compute if possible:
(a).
(b).
(c).
(d).
(e).
4. Determine the determinant and the inverse matrix of the following matrices using the "Adjoint
Formula":
5. The analysis of the forces in a basic static structural system involve some equilibrium equations:
(a). The algebraic sum of all the forces in any direction is zero.
(b). The algebraic sum of all moments about any pivot point is zero
The equations obtained for a certain two-dimensional system with the forces in Newtons [N] are:
Arrange the equations in matrix-vector form and solve for the three variables using matrix inversion
with software. Compute with minimal 4 decimals accuracy, but give the answer in two decimals.
6. The analysis of the mesh currents in a dc circuit utilizes Kirchhoff's voltage law (KVL), which
states that the algebraic sum of the voltages around each loop is zero. With voltages expressed interms
of three unknown mesh currents
and measured in ampres [A], the KVL equations for a certain
three-mesh electric circuit are:
Arrange the equations in matrix form and solve for the three mesh currents using matrix inversion with
software.
7. The analysis of the node voltages in a dc circuit utilizes Kirchhoff's current law (KCL), which
states that the algebraic sum of the currents leaving each node is zero. With currents expressed in terms
of three node voltages
and
measured in volts [V], the KCL equations for a certain electric
circuit are
Arrange the equations in matrix form and solve for the three node voltages using inversion with
software.
and
measured in newtons
Arrange the equations in matrix form and solve for the three forces using matrix algebra. Check the
result by performing a simple elimination method. Compute with minimal 4 decimals. Write the results
using two decimals accuracy. You may use software for matrix inversion.
10.
Given matrix
(a). Compute
(b). Compute
(c). Explain why
. Is A singular? Why?
and the matrix product
11. Given A =
(a). Compute
. Is A singular? Why?
(b). Compute
and the matrix product
(c). Explain the result.
13. Given the same system as in Problem 12. Find the solution using Gauss-Jordan reduction.
8. Solutions
Compute:
(a).
(b).
(c).
(d).
(if possible)
Solution 1
and y =
Determine x y and y x
Solution 2
3. Given the matrices
Compute if possible:
(a).
(b).
(c).
(d).
(e).
Solution 3
4. Determine the determinant and the inverse matrix of the following matrices using the "Adjoint
Formula":
Solution 4
5. The analysis of the forces in a basic static structural system involve these equilibrium equations:
(a). The algebraic sum of all the forces in any direction is zero.
(b). The algebraic sum of all moments about any pivot point is zero
The equatins obtained for a certain two-dimensional system with the forces in Newtons [N] are:
Arrange the equations in matrix-vector form and solve for the three variables using matrix inversion
with software. Compute with minimal 4 decimals accuracy, but give the answer in two decimals.
Solution 5
6. The analysis of the mesh currents in a dc circuit utilizes Kirchhoff's voltage law (KVL), which
states that the algebraic sum of the voltages around each loop is zero. With voltages expressed interms
of three unknown mesh currents
and measured in ampres [A], the KVL equations for a certain
three-mesh electric circuit are:
Arrange the equations in matrix form and solve for the three mesh currents using matrix inversion with
software.
Solution 6
7. The analysis of the node voltages in a dc circuit utilizes Kirchhoff's current law (KCL), which
states that the algebraic sum of the currents leaving each node is zero. With currents expressed in terms
of three node voltages
and
measured in volts [V], the KCL equations for a certain electric
circuit are
Arrange the equations in matrix form and solve for the three node voltages using matrix inversion with
software.
Solution 7
8. The equations involving a certain steel girder involve three forces
[N], and they are
and
measured in newtons
Arrange the equations in matrix form and solve for the three forces using matrix algebra. Check the
result by performing a simple elimination method. Compute with minimal 4 decimals. Write the results
using two decimals accuracy. You may use software for matrix inversion.
Solution 8
9. Solve, using Cramer's rule the following set of linear equations
(a). Compute
(b). Compute
(c). Explain why
Solution 10
11. Given A =
(a). Compute
. Is A singular?
(b). Compute
and the matrix product
(c). Explain the result.
Solution 11
12. Given the linear system of equations
Solution 13
Solution 14