Lecture Notes Sengineering
Lecture Notes Sengineering
1
ASTU
Applied Mathematics program
Contents
1
Chapter 1
Vectors
Introduction
2
Chapter 2
The size of a matrix is a description of the numbers of rows and columns it has. A matrix is called m×n (pronounced
" m by n") if it has m rows and n columns.
A 1 × m matrix is called a row matrix (or row vector), and an n × 1 matrix is called a column matrix (or
column vector).
A general m × n matrix A has the form
a11 a12 . . . a1n
a21 a22 . . . a2n
A= .
.. .. ..
.. . . .
am1 am2 . . . amn
The diagonal entries of A are a11 , a22 , a33 , . . . , and if m = n (that is, if A has the same number of rows as columns),
then A is called a square matrix. A square matrix whose nondiagonal entries are all zero is called a diagonal
matrix. A diagonal matrix all of whose diagonal entries are the same is called a scalar matrix. If the scalar on
the diagonal is 1, the scalar matrix is called an identity matrix.
For example let
2 0 0 1 0 0
2 4 5 3 1
A= , B= , C = 0 6 0 , D = 0 1 0
0 3 4 4 5
0 0 4 0 0 1
The diagonal entries of A are 2 and 3, but A is not square; B is a square matrix of size 2 × 2 with diagonal entries
3 and 5; C is a diagonal matrix; D is a 3 × 3 identity matrix. The n × n identity matrix is denoted by In (or simply
I if its size is understood).
Remark 2.1.1. Two matrices are equal if they have the same size and if their corresponding entries are equal. Thus,
if A = [aij ]m×n and B = [bij ]r×s , then A = B if and only if m = r and n = s and aij = bij for all i and j.
A + B = aij + bij
3
Example 2.1.1. Let
1 4 0 3 1 −1 4 3
A= , B= and C =
−2 6 5 3 0 2 2 1
Then
−2 5 −1
A+B =
1 6 7
but neither A + C nor B + C is defined.
If A is an m × n matrix and c is a scalar, then the scalar multiple cA is the m × n matrix obtained by multiplying
each entry of A by c.
cA = c[aij ] = [caij ]
Example 2.1.2. For matrix A in Example 1.1.1
1
2 8 0 1 2 0 −1 −4 0
2A = , A=A= 2 5 , (−1)A = A =
−4 12 10 2 −1 3 2 2 −6 −5
The matrix (−1)A is written as −A and called the negative of A. As with vectors, we can use this fact to define
the difference of two matrices: If A and B are the same size, then
A − B = A + (−B)
column j b1j
b2j
B ..
(r × m) .
brj
cij = ai1 b1j + ai2 b2j + · · · + ain bnj
Note 1. For AB to exist, the number of columns of A must equal the number of rows of B.
A B = AB
m×n n×r m×r
same
size of AB
ASTU
4 APPLIED MATHEMATICS PROGRAM
Remark 2.2.1. If A is an m × n matrix and B is an n × r matrix, then AB will be an m × r matrix.
1 3 5 0 1
Example 2.2.1. Let A = and B = . Determine AB and BA, if the product exists.
2 0 3 −2 6
Solution. A has two columns and B has two rows; thus AB exists. Interpret A in terms of its rows and B in terms
of its columns and multiply the rows by the columns. We find that
1 3 5 0 1 14 −6 19
AB = =
2 0 3 −2 6 10 0 2
BA does not exist because B has three columns and A has two rows.
We see that the order in which two matrices are multiplied is important. Unlike multiplication of real numbers,
matrix multiplication is not commutative. In general, for two matrices A and B, AB 6= BA. J
Matrix multiplication implies that the columns of the product are AB1 , AB2 , . . . , ABr . We can write
AB = AB1 AB2 . . . ABr
2 0 4 1 3
For example, suppose A = and B = . Then
1 5 0 2 −1
2 0 4 2 0 1 2 0 3 8 2 6
AB = =
1 5 0 1 5 2 1 5 −1 4 11 −2
Theorem 1
Let A, B and C be matrices and r and s be scalars. Assume that the sizes of the matrices are such that the
operations can be performed.
Properties of Matrix Addition and Scalar Multiplication
1. A + B = B + A
2. A + (B + C) = (A + B) + C
3. A + 0 = 0 + A = A (where 0 is the appropriate zero matrix)
4. r(A + B) = rA + rB
5. (r + s)C = rC + sC
6. r(sC) = (rs)C
Properties of Matrix Multiplication
1. A(BC) = (AB)C
2. A(B + C) = AB + AC
3. (A + B)C = AC + BC
4. AI = IA = A (where I is the appropriate identity matrix)
ASTU
5 APPLIED MATHEMATICS PROGRAM
5. r(AB) = (rA)B = A(rB)
Note 2. AB 6= BA in general. Multiplication of matrices is not commutative.
Example 2.2.2. Compute the product ABC of the following three matrices.
4
1 2 0 1 3
A= , B= , C = −1
3 −1 −1 0 −2
0
Solution. Let us check to see if the product ABC exists before we start spending time multiplying matrices. We
get The product exists and will be a 2 × 1 matrix. Since matrix multiplication is associative, the matrices in the
A B C = ABC
2×2 2×3 3×1 2×1
match match
size of product is 2 × 1
product ABC can be grouped together in any manner for multiplying, as long as the order is maintained. Let us
use the grouping (AB)C. This is probably the most natural. We get
1 2 0 1 3 −2 1 −1
AB = =
3 −1 −1 0 −2 1 3 11
and
4
−2 1 −1 −9
(AB)C = −1 =
1 3 11 1
0
J
Exercise 2. Compute each of the following expressions for
2 0 −1 1 3 4
A= , B= , C=
−1 5 2 4 0 2
1. A − 3B 2
2. A2 B + 2C 3
The process of applying elementary row operations to bring a matrix into row echelon form, called row reduction,
is used to reduce a matrix to echelon form.
Example 2.3.2. Reduce the following matrix to echelon form:
1 2 −4 −4 5
2 4 0 0 2
2 3 2 1 5
−1 1 3 6 5
ASTU
7 APPLIED MATHEMATICS PROGRAM
Solution.
R2 − 2R1
−4 5 R3 − 2R1 1 2 −4 −4 5
1 2 −4
2 4 0 0 2 R4 + R1 0 0 8 8 −8
−→
2 3 2 1 5 0 −1 10 9 −5
−1 1 3 6 5 0 3 −1 2 10
1 2 −4 −4 5
R2 ←→R3 0 −1 10 9 −5
−→
0 0 8 8 −8
0 3 −1 2 10
1 2 −4 −4 5
R4 +3R2 0 −1 10 9 −5
−→
0 0 8 8 −8
0 0 29 29 −5
1 2 −4 −4 5
1
8
0 −1 10 9 −5
−→
0 0 1 1 −1
0 0 29 29 −5
1 2 −4 −4 5
R4 −29R3 0 −1 10 9 −5
−→
0 0 1 1 −1
0 0 0 0 24
With this final step, we have reduced our matrix to echelon form. J
Definition 2.3.3. Matrices A and B are row equivalent if there is a sequence of elementary row operations that
converts A into B.
The matrices in example 1.3.2
1 2 −4 −4 5 1 2 −4 −4 5
2
4 0 0 2 0
and −1 10 9 −5
2 3 2 1 5 0 0 1 1 −1
−1 1 3 6 5 0 0 0 0 24
Definition 2.3.4. The rank of a matrix is the number of non-zero rows in its row echelon form.
Definition 2.3.5. A matrix is in reduced row echelon form if it satisfies the following properties:
1. It is in row echelon form.
2. The leading entry in each non-zero row is a 1 (called a leading 1 ).
ASTU
8 APPLIED MATHEMATICS PROGRAM
1 0 1 7 0 1 0
0 1 3 0
a. 0 0 3 b. 0 1 −1 4 c.
0 0 0 1
0 1 0 0 0 0 0
0 0 0 1 0 3 −4 0 0 0 1
d. 0 0 0 e. 0 0 0 0 0 f. 0 1 0
0 0 0 0 1 5 0 1 1 0 0
1 2 3
1 0 0
g.
0
1 1
0 0 1
Theorem 1
Proof. Let B and C be inverses of A. Thus AB = BA = In and AC = CA = In . Multiply both sides of the
equation AB = In by C and use the algebraic properties of matrices.
C(AB) = CIn
(CA)B = C
In B = C
B=C
A−1 = X1 X2 . . . Xn and In = e1 e2 . . . en
We shall find A−1 by finding X1 , X2 , . . . , Xn . Write the equation AA−1 = In in the form
A X1 X2 . . . Xn = e1 e2 . . . en
ASTU
9 APPLIED MATHEMATICS PROGRAM
Using the column form of matrix multiplication,
AX1 AX2 . . . AXn = e1 e2 ... en
Thus
AX1 = e1 , AX2 = e2 , . . . , AXn = en
Therefore X1 , X2 , . . . , Xn are solutions to the system AX1 = e1 , AX2 = e2 , . . . , AXn = en , all of which have the
same matrix of coefficients A. Solve these systems by using Gauss Jordan elimination on the large augmented
matrix A : e1 e2 . . . en . Since the solutions X1 , X2 , . . . , Xn are unique(they are the columns of A−1 ),
A : e1 e2 . . . en ≈ · · · ≈ In : X1 X2 . . . Xn
Thus, when A−1 exists,
[A : In ] ≈ · · · ≈ [In : B] where B = A−1
On the other hand, if the reduced echelon form of [A : In ] is computed and the first part is not of the form In then
A has no inverse.
Example 2.4.2. Find the inverse of
1 2 −1
2 2 4
1 3 −3
if it exists.
Solution. Gauss-Jordan elimination produces
1 2 −1 1 0 0
[A|I] = 2 2 4 0 1 0
1 3 −3 0 0 1
R2 − 2R1
R3 − R1 1 2 −1 1 0 0
−→ 0 −2 6 −2 1 0
0 1 −2 −1 0 1
−1 1 2 −1 1 0 0
2 R2 −1
−→ 0 1 −3 1 2 0
0 1 −2 −1 0 1
1 2 −1 1 0 0
R3 −R2 −1
−→ 0 1 −3 1 2 0
1
0 0 1 −2 2 1
R1 + R3 1
R2 + 3R3 1 2 0 −1 2 1
−→ 0 1 0 −5 1 3
1
0 0 1 −2 2 1
−3
1 0 0 9 2 −5
R1 −2R2
−→ 0 1 0 −5 1 3
1
0 0 1 −2 2 1
Therefore,
−3
9 2 −5
A−1 = −5 1 3
1
−2 2 1
(You should always check that AA−1 = I by direct multiplication.) J
Example 2.4.3. Determine the inverse of the matrix
1 −1 −2
2 −3 −5
−1 3 5
ASTU
10 APPLIED MATHEMATICS PROGRAM
Exercise 2. Find the inverse of
2 1 −4
−4 −1 6
−2 2 −2
if it exists.
Solution. Using the elements of the first row and their corresponding cofactors we get
Theorem 1
The determinant of a square matrix is the sum of the products of the elements of any row or column and their
cofactors.
ith row expansion: |A| = ai1 Ci1 + ai2 Ci2 + · · · + ain Cin
j th column expansion: |A| = a1j C1j + a2j C2j + · · · + anj Cnj
There is a useful rule that can be used to give the sign part, (−1)i+j , of the cofactors in these expansions. The rule
is summarized in the following array
+ − + − ...
− + − + . . .
+ − + − . . .
..
.
Example 2.5.4. Find the determinant of the following matrix using the second row.
1 2 −1
A = 3 0 1
4 2 1
0 1 0 −3
ASTU
12 APPLIED MATHEMATICS PROGRAM
Computing Determinants of 2 × 2 and 3 × 3 Matrices
The determinants 2 × 2 and 3 × 3 matrices can be found quickly using diagonals. For a 2 × 2 matrix the ac-
tual diagonals are used while in the case of a 3 × 3 matrix the diagonals of an array consisting of the matrix
with the two first columns added to the right are used. A determinant is equal to the sum of the diagonal prod-
ucts that go from left to right minus the sum of the diagonal products that go from right to left, as follows.
3×3 matrix A
+ + + − − −
2×2 matrix A
+ − a1 b1 c1 a1 b1
a 1 b1 a2 b2 c2 a2 b2
a 2 b2 a3 b3 c3 a3 b3
2 × 2 matrix: |A| = a1 b2 − a2 b1
3 × 3 matrix: |A| = a1 b2 c3 + b1 c2 a3 + c1 a2 b3 − c1 b2 a3 − a1 c2 b3 − b1 a2 c3
(diagonal products from left to right) (diagonal products from right to left)
B
A − − −
+ + +
+ − 1 2 3 1 2
For example:
2 3 4 0 1 4 0
4 1 5 2 6 5 2
|A| = 2 − 12 = −10 |B| = 0 + 10 + 24 − 0 − 2 − 48
There are no such short cuts for computing determinants of larger matrices.
a. If a matrix B is obtained from A by multiplying the elements of a row (column) by c then |B| = c|A|
b. If a matrix B is obtained from A by interchanging two rows (columns) then |B| = −|A|
c. If a matrix B is obtained from A by adding a multiple of one row (column) to another row (column), then
|B| = |A|
Theorem 4
ASTU
13 APPLIED MATHEMATICS PROGRAM
b. two rows (columns) are equal.
c. two rows (columns) are proportional.
[Note that (b) is a special case of (c), but we list it to give it special emphasis.]
Solution. (a) All the elements in column 2 of A are zero. Thus |A| = 0.
(b) Observe that every element in row 3 of B is twice the corresponding element in row 2. We write
(row 3) = 2(row 2)
Theorem 5
2 4 1 2 4 1 2 4 1
−2 −5 4 = 0 −1 5 = 0 −1 5 = 2 × (−1) × 13 = −26
R3 +R2
4 9 10 R2 + R1 0 1 8 0 0 13
R3 − 2R1
2 1 3 1
−2 3 −1 2
2 1 2 3
−4 −2 0 −1
ASTU
14 APPLIED MATHEMATICS PROGRAM
Definition 2.5.5. Let A be an n × n matrix and Cij be the cofactor of aij . The matrix whose (i, j)th element is
Cij is called the matrix of cofactors of A. The transpose of this matrix is called the adjoint of A and is denoted
adj(A).
C11 C12 . . . C1n C11 C21 . . . Cn1
C21 C22 . . . C2n C12 C22 . . . Cn2
.. .. .. .. .. ..
. . . . . .
Cn1 Cn2 . . . Cnn C1n C2n . . . Cnn
matrix of cofactors adjoint matrix
Theorem 9
Example 2.5.8. Use the formula for the inverse of a matrix to compute the inverse of the matrix
2 0 3
A = −1 4 −2
1 −3 5
ASTU
15 APPLIED MATHEMATICS PROGRAM
Let A be an invertible n × n matrix. Then the components of the unique solution x to Ax = b are given by
det(Ai )
xi = for i = 1, 2, . . . , n
det(A)
Example 2.6.1. Use Cramer’s Rule to find the solution to the system
3x1 + x2 = 5
−x1 + 2x2 + x3 = −2
−x2 + 2x3 = −1
We have
5 1 0 3 5 0 3 1 5
A1 = −2 2 1 , A2 = −1 −2 1 , A3 = A = −1 2 −2
−1 −1 2 0 −1 2 0 −1 −1
Computing determinants gives us det(A) = 17, det(A1 ) = 28, det(A2 ) = 1 and det(A3 ) = −8. Therefore, by
Cramer’s Rule, the solution to Ax = b is
det(A1 ) 28 det(A2 ) 1 det(A3 ) −8
x1 = = , x2 = = , x3 = =
det(A) 17 det(A) 17 det(A) 17
J
Gaussian Elimination
1. Write the augmented matrix of the system of linear equations.
2. Use elementary row operations to reduce the augmented matrix to row echelon form.
3. Using back substitution, solve the equivalent system that corresponds to the row-reduced matrix.
2x2 + 3x3 = 8
2x1 + 3x2 + x3 = 5
x1 − x2 − 2x3 = −5
The augmented matrix is now in row echelon form, and we move to step 3. The corresponding system is
x1 − x2 − 2x3 = −5
x2 + x3 = 3
x3 = 2
Gauss-Jordan Elimination
1. Write the augmented matrix of the system of linear equations.
2. Use elementary row operations to reduce the augmented matrix to reduced row echelon form.
3. If the resulting system is consistent, solve for the leading variables in terms of any remaining free variables
Theorem 2
Let AX = Y be a system of n linear equations in n variables. If A−1 exists, the solution is unique and is
given by X = A−1 Y
Example 2.6.4. Solve the following system of equations using the inverse of the matrix of coefficients.
x1 − x2 − 2x3 = 1
2x1 − 3x2 − 5x3 = 3
−x1 + 3x2 + 5x3 = −2
ASTU
17 APPLIED MATHEMATICS PROGRAM
Solution. This system can be written in the following matrix form,
1 −1 −2 x1 1
2 −3 −5 x2 = 3
−1 3 5 x3 −2
This inverse has already been found in Example 1.4.3 Using that result we get
−1
x1 0 1 1 1
x2 = 5 −3 −1 −2
x3 −3 2 1 1
ASTU
18 APPLIED MATHEMATICS PROGRAM