1
LECTURE 4
MATRICES
INTRODUCTION
Consider the problem of solving the system of equations
𝑥 − 2𝑦 = 1 (1)
−2𝑥 + 3𝑦 = −2 (2)
We can do this easily using substitution: use equation (1) to write 𝑥 = 1 + 2𝑦, and
then substitute this expression into equation (2) to get
−2(1 + 2𝑦) + 3𝑦 = −2 ,
Which is easily solved to find 𝑦 = 0. Now substitute 𝑦 = 0 into the equation 𝑥 =
1 + 2𝑦 to find 𝑥 = 1. Therefore, the solution to the system of equations is 𝑥 = 1 and
𝑦 = 0.
This works fine for this small system of two equations. What about something
larger, say
We could again use substitution, but the problem is quite a bit harder (and
messier) this time — try it! The situation gets worse the more equations we have. We
would like a more systematic and organized approach to solving such problems, and
fortunately, there is one. The system (3) can be expressed in the form
Each of the rectangular structures and
ME223 – ADVANCED MATHEMATICS FOR MECHANICAL ENGINEERS
Engr. Dennis E. Ganas
Mechanical Engineering Department MECHANICAL ENGINEERING
2
There are methods of manipulating them to efficiently solve the system of
equations. Our main focus will be the application of matrices (the plural of matrix) to
solving systems of equations, but it should note that matrices arise in many areas of
science, economics and computing.
TERMINOLOGY AND NOTATION
Matrices are denoted using bold uppercase letters. For example, let
Here A is a matrix of 3 rows and 3 columns, and we say A has size 3 × 3. The
size of a matrix is always stated as rows × columns, that is, rows first, columns second.
The entries or elements of A are the numbers. These are denoted by their
position:
aij = entry in row i and column j of A
For example, in our matrix A, a31 = 5 since the entry in row 3 and column 1 is 5.
Notice again, when referring to position of entries: rows first, columns second. Similarly,
a23 = 1 is the entry in row 2 column 3. Also notice how we have used the lowercase
letter “a” in aij to correspond with our choice of uppercase “A” used to represent the
matrix. If instead we used B to represent our matrix, we would use bij to refer to the
individual entries.
Now that we have some notation, let’s state the formal definition of a matrix:
Definition: A rectangular array of numbers consisting of m horizontal rows and n vertical
columns
is called an m × n matrix or matrix of size m × n. For entry aij, i is the row subscript, while
j is the column subscript.
A general matrix is sometimes denoted [aij]m×n .
ME223 – ADVANCED MATHEMATICS FOR MECHANICAL ENGINEERS
Engr. Dennis E. Ganas
Mechanical Engineering Department MECHANICAL ENGINEERING
3
Example: Let
The size of B is 2 × 3. A couple of entries of B are
b23 = 3 b21 = 1/2
Example: Let P = [3 -4 π]
P is called a row matrix or row vector. Here p11 = 3, p12 = −4 and p13 = π.
Example: Let
Q is called a column matrix or column vector. Here q11 = 0, p21 = 2 and p31 = e.
TRANSPOSE OF A MATRIX
Suppose A is an m × n matrix. The transpose of A, denoted AT, is the matrix of size n
× m obtained by interchanging the rows and columns of A. For example, if
Then
Example: Let
Then
ME223 – ADVANCED MATHEMATICS FOR MECHANICAL ENGINEERS
Engr. Dennis E. Ganas
Mechanical Engineering Department MECHANICAL ENGINEERING
4
Using this last example, notice that
This turns out to be true in general: for any matrix A, (AT )T = A
SOME SPECIAL MATRICES
Zero Matrix. The m × n zero matrix is the m × n matrix with all entries zero. For
example, the 2 × 3 zero matrix is
Square Matrix. A matrix with the same number n of rows and columns is called a
square matrix of order n. For example,
Here the entries a11 = 1, a22 = 3, and a33 = −3 (reading from upper-left to lower-
right) form the main diagonal of A.
Diagonal Matrix. A square matrix [aij]n×n with all entries not on the main diagonal equal
to zero is called a diagonal matrix. That is, aij = 0 if i ≠ j. For example
is a diagonal matrix, however
is not.
Upper Triangular Matrix. A square matrix is called upper triangular if all entries below
the main diagonal are zero, for example
ME223 – ADVANCED MATHEMATICS FOR MECHANICAL ENGINEERS
Engr. Dennis E. Ganas
Mechanical Engineering Department MECHANICAL ENGINEERING
5
Lower Triangular Matrix. A square matrix is called lower triangular if all entries
above the main diagonal are zero, for example
Triangular Matrix. A matrix which is either upper or lower triangular.
MATRIX ADDITION AND SCALAR MULTIPLICATION
Matrices inherit many of the properties of ordinary real numbers, including some of the
operations of arithmetic. Here we define two of these operations: addition of matrices,
and the multiplication of a matrix by a number, called scalar multiplication.
MATRIX ADDITION
Let A = [aij]m×n and B = [bij]m×n. Then,
A + B = [aij + bij]m×n
That is, provided A and B are the same size, the matrix C = A + B is simply the m × n
matrix formed by adding the corresponding entries of A and B: c ij = aij + bij .
Example: Let
Then
Example: Let
ME223 – ADVANCED MATHEMATICS FOR MECHANICAL ENGINEERS
Engr. Dennis E. Ganas
Mechanical Engineering Department MECHANICAL ENGINEERING
6
Then A + 03×2 = A as one would expect.
This last example generalizes: matrices inherit the addition properties of the real
numbers: for matrices A, B, C and 0m×n each of size m × n:
1. A + B = B + A.
2. A + (B + C) = (A + B) + C.
3. A + 0m×n = A.
4. (A + B)T = AT + BT.
SCALAR MULTIPLICATION
Let A = [aij]m×n be a matrix and let k be a real number (a scalar). Then C = kA is the
matrix with entry cij = kaij. For example, for
Multiplication by the scalar 1/2 gives
Example: Let
Then
Like matrix addition, scalar multiplication inherits many of the multiplication rules
of the ordinary real numbers. In the following, let k, k 1 and k 2 be scalars, and A and B
be matrices of size m × n:
ME223 – ADVANCED MATHEMATICS FOR MECHANICAL ENGINEERS
Engr. Dennis E. Ganas
Mechanical Engineering Department MECHANICAL ENGINEERING
7
1. k(A + B) = kA + kB.
2. (k 1 + k 2 )A = k 1A + k 2A.
3. k 1(k 2A) = (k 1k 2 )A.
4. 0A = 0m×n.
5. k0m×n = 0m×n.
6. (kA)T = kAT .
MATRIX SUBTRACTION
Now that we have clearly defined matrix addition and scalar multiplication, the
operation of subtraction can be stated simply: if A and B are matrices of size m × n,
then we define
A − B = A + (−1) B
Here are a few examples to put this all together:
Example: Solve for
Solution:
Therefore
ME223 – ADVANCED MATHEMATICS FOR MECHANICAL ENGINEERS
Engr. Dennis E. Ganas
Mechanical Engineering Department MECHANICAL ENGINEERING
8
Example: Compute 2(3C − A) + 2B.
Solution:
First, notice that A, B and C are all the same size, 2 × 3 in this case, so addition is
defined. So
ASSIGNMENT: (DUE DATE: OCTOBER 9, 2020 5PM)
1. Given:
Find:
a. 2A + 3(B + C) c. (B − 2AT)T
1
b. ( ) A − 2(B + 2C) d. −3(B − 2 02×2) + 0 B
2
2. Solve for x and y:
3. Solve for x and y:
4. Solve for x, y, and z
ME223 – ADVANCED MATHEMATICS FOR MECHANICAL ENGINEERS
Engr. Dennis E. Ganas
Mechanical Engineering Department MECHANICAL ENGINEERING