0% found this document useful (0 votes)
32 views23 pages

Linear Algebra Notes Part 1

notes

Uploaded by

arutfb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views23 pages

Linear Algebra Notes Part 1

notes

Uploaded by

arutfb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Introduction to Linear Algebra MATH140 1

LINEAR EQUATIONS AND MATRICES

1. Introduction to Systems of Linear Equations

. Example 1: Consider the following system of two linear equations in two unknowns (variables):

x−y = 1 (1)
E:
2x + 3y = 7 (2)

By a solution of the system (if there is one) is meant a pair of numbers, x and y, which satisfy both
equations in E. It is easy to verify that x = 2 and y = 1 is a solution. Two obvious questions arise:

(a) How can we find such a solution?

(b) Are there any other solutions?

Both questions are answered by the method of elimination (of one of the variables). If we choose to
eliminate x we obtain the following system:

x−y = 1 (1)
E0 :
5y = 5 (2a) = (2) − 2.(1)

Note that if x and y satisfy E then they satisfy E 0 . (We subtracted the numbers 2(x − y) and 2, which
are equal by (1), from the left hand and right hand sides respectively of (2)). Conversely if x and y
satisfy E 0 then they must satisfy the original system E. (Replacing (2a) by itself plus twice (1) would
get us back to system E). E and E 0 are examples of equivalent systems.

Definition: Let E and E 0 be two systems of linear equations in the same variables. If every solution
of E is a solution of E 0 and vice versa then we call E and E 0 equivalent systems.

Clearly the following system is equivalent to E 0 (and to E):

x−y = 1 (1)
E 00 :
y = 1 (2b) = 51 .(2a)

So the only solution of E 00 , and hence of the original system E, is y = 1 and x = 2. /

. Example 2:
x−y+z = 2 (1)
E: −2x − 3y + z = −3 (2)
5x − 20y + 14z = 8 (3)
is a system of three equations in three variables. Eliminating x from (2) and (3) yields the equivalent
system:
x−y+z = 2 (1)
E0 : −5y + 3z = 1 (2a) = (2) + 2.(1)
−15y + 9z = −2 (3a) = (3) − 5.(1)
Introduction to Linear Algebra MATH140 2

This is equivalent to

x−y+z = 2 (1)
00
E : −5y + 3z = 1 (2a)
0y + 0z = −5 (3b) = (3a) − 3.(2a)

Equation (3b) is obviously false. Thus system E 00 , and hence the original system E, has no solutions.
A system having no solutions is said to be inconsistent. /

Finally, here is an example of a system which has many solutions:


. Example 3:
−y + 3z = −5 (1)
E: x + y + 2z = 6 (2)
−x + y − 8z = 4 (3)
Clearly interchanging (1) and (2) will not alter the solutions of the system. Therefore E is equivalent
to
x + y + 2z = 6 (1a) = (2)
0
E : −y + 3z = −5 (2a) = (1)
−x + y − 8z = 4 (3)
If we eliminate x from (3) we obtain the equivalent system:

x + y + 2z = 6 (1a)
00
E : −y + 3z = −5 (2a)
2y − 6z = 10 (3a) = (3) + (1)

which in turn is equivalent to

x + y + 2z = 6 (1a)
E 000 : −y + 3z = −5 (2a)
0y + 0z = 0 (3b) = (3a) + 2.(2a)

Now (3b) holds for all y and z. Equations (2a) and (1a) may then be used to express y and x
respectively in terms of z: y = 5 + 3z and x = 1 − 5z. This means that we can choose any z and
use these equations to find corresponding x and y values. The system therefore has infinitely many
solutions. Such a system is called an underdetermined system. We describe all solutions as follows:

x = 1 − 5t , y = 5 + 3t , z=t where t ∈ R.

This is referred to as the general solution of E. A particular solution is obtained by assuming a specific
value for t, for example, if t = −1 then

x=6 , y=2 , z = −1 .

Remarks:
(a) Our examples illustrate the general fact that a system of linear equations may have a unique
solution, or no solutions, or infinitely many solutions. These are in fact the only solution pos-
sibilities. It is not possible, for example, for a system to have precisely two different solutions.
We shall prove this later (§6).

(b) We have also seen that the following elementary operations change a system of linear equations
into an equivalent system:
Introduction to Linear Algebra MATH140 3

(i) Interchanging two equations.


(ii) Multiplying an equation by a non–zero constant.
(iii) Replacing an equation by the sum of itself and any multiple of another equation.

These are the only operations we may use.

2. Gaussian Elimination

In the early 19th century German mathematician Karl Friedrich Gauss (see biography on web site)
developed a systematic procedure that could be used to solve any system of linear equations. It is an
efficient method particularly for large systems. We illustrate it here via a couple of examples.

. Example 1: Solve the following system of linear equations

3x + y − 2z = 4
4x + 5y + 6z = 24
x + 2y + 3z = 9

To save time when solving systems of linear equations, we may omit the variables (they do not change)
and the equal signs, and simply work with the coefficients of the variables and the constants on the
right of the equations. The above system would then be stored in the following rectangular array
containing (horizontal) rows and (vertical) columns:
 
3 1 −2 4
 4 5 6 24 
 
1 2 3 9

Rectangular arrays of numbers, such as the above, are called matrices. This in particular is called the
augmented matrix of the system (more on matrices later). (The line between the final two columns
serves as a reminder of the equal signs in the equations). Now the basic idea behind the Gaussian
elimination procedure is as follows: Using elementary row operations reduce the augmented matrix to
row echelon form (or reduced form).

Definitions:

(a) The following operations on a system of linear equations are called elementary row operations
(cf. elementary operations on equations, above):

(i) Interchanging two rows.


(ii) Multiplying a row by a non–zero constant.
(iii) Replacing a row by the sum of itself and any multiple of another row.

Two matrices are called row equivalent if one has been obtained from the other by means of
elementary row operations, and row equivalence is denoted by “∼” (read “is equivalent to”).

(b) A matrix is in row echelon form if

(i) any rows consisting entirely of zeros appear as the final rows, and
(ii) the first non–zero number in each non–zero row is a 1 (the “leading 1”), and
Introduction to Linear Algebra MATH140 4

(iii) the leading 1 in any row appears in a column to the right of the leading 1 in any row above
it.

Once the augmented matrix is in row echelon form the system is easily solvable.

Recall that the augmented matrix of our system is:


 
3 1 −2 4 R1
4 5 6 24  R2
 

1 2 3 9 R3

In order to reduce this to echelon form we perform the following steps:

Step 1: Obtain a 1 in the top left hand corner. This is most easily achieved by interchanging rows 1
and 3, so we have
   
3 1 −2 4 R1 1 2 3 9 R1a = R3
4 5 6 24  R2 ∼ 4 5 6 24  R2
   
 
1 2 3 9 R3 3 1 −2 4 R3a = R1

Step 2: By adding suitable multiples of the first row to the second and third rows, obtain zeros under
the 1 in the first row, first column position, i.e.
   
1 2 3 9 R1a 1 2 3 9 R1a
 4 5 6 24  R2 ∼  0 −3 −6 −12  R2a = R2 − 4.R1a
   
3 1 −2 4 R3a 0 −5 −11 −23 R3b = R3a − 3.R1a

Step 3: Obtain (if possible) a 1 in the second row, second column position, so
   
1 2 3 9 R1a 1 2 3 9 R1a
 0 −3 −6 −12  R2a ∼  0 1 2 4  R2b = − 13 .R2a
   
0 −5 −11 −23 R3b 0 −5 −11 −23 R3b

Step 4: Add suitable multiples of the second row to the third row (but not to the first row) to obtain
a zero below the 1 in the second row, second column position, hence
   
1 2 3 9 R1a 1 2 3 9 R1a
 0 1 2 4  R2b ∼  0 1 2 4  R2b
   
0 −5 −11 −23 R3b 0 0 −1 −3 R3c = R3b + 5.R2b

Step 5: Obtain (if possible) a 1 in the third row, third column position. We then have
   
1 2 3 9 R1a 1 2 3 9 R1a
 0 1 2 4  R2b ∼  0 1 2 4  R2b
   
0 0 −1 −3 R3c 0 0 1 3 R3d = −1.R3c

The matrix is now in row echelon form. We then solve using back substitution, i.e. from the bottom
upwards, to obtain:

z=3 , y + 2z = 4 so y = −2 , x + 2y + 3z = 9 so x = 4 .

The unique solution is thus x = 4, y = −2 and z = 3. /


Introduction to Linear Algebra MATH140 5

Remarks:

(a) Of course if we had more equations, and hence more rows in the augmented matrix, we would
require more steps in our solution. The general method, however, remains the same, i.e. obtain
(if possible) a leading 1 in a row and create zeros below this leading 1.

(b) Note that at each step only elementary row operations may be used.

. Example 2: Solve the following system using Gaussian elimination:

x1 + x2 + 3x3 + 4x4 = 2
x1 + x2 + 5x3 + 6x4 = 0
2x1 + 2x2 + 4x3 + 7x4 = −1

The augmented matrix of the system is


 
1 1 3 4 2 R1
 1 1 5 6 0  R2
 
2 2 4 7 −1 R3

Now we already have a 1 in the first row, first column position. Obtaining zeros below this results in
   
1 1 3 4 2 R1 1 1 3 4 2 R1
1 1 5 6 0  R2 ∼ 0 0 2 2 −2  R2a = R2 − R1
   
 
2 2 4 7 −1 R3 0 0 −2 −1 −5 R3a = R3 − 2.R1

At this point notice that it is not possible to obtain a 1 in the second row, second column position.
In this case obtain, if possible, a 1 in the second row, third column position and create zeros below
this 1. So we have
   
1 1 3 4 2 R1 1 1 3 4 2 R1
0 0 2 2 −2  R2a ∼ 0 0 1 1 −1  R2b = 12 .R2a
   
 
0 0 −2 −1 −5 R3a 0 0 −2 −1 −5 R3a
 
1 1 3 4 2 R1
∼  0 0 1 1 −1  R2b
 
0 0 0 1 −7 R3b = R3a + 2.R2b

The matrix is now in row echelon form. Solving using back substitution gives: x4 = −7, x3 = 6 and
x1 + x2 = 12. The general solution may be stated as

x1 = 12 − t , x2 = t , x3 = 6 , x4 = −7 where t ∈ R.

We can eliminate the need for back substitution by adopting a modified form of Gaussian elimination,
called Gauss–Jordan elimination. This procedure requires us to transform the augmented matrix to
reduced row echelon form (or completely reduced form).

Definition: A matrix is in reduced row echelon form if, in addition to the three conditions for row
echelon form (P3–4), it also satisfies the following condition:

(iv) the leading 1 in a row has zeros elsewhere in its column.


Introduction to Linear Algebra MATH140 6

. Example 3: Solve by completely reducing the system

x1 − 2x2 + 3x3 = 11
2x1 − x2 + 3x3 = 10
4x1 + x2 + 4x3 = 4

The idea is as follows: Obtain (if possible) a leading 1 in a row and create zeros above as well as below
the leading 1. We therefore have
   
1 −2 3 11 R1 1 −2 3 11 R1
 2 −1 3 10  R2 ∼  0 3 −3 −12  R2a = R2 − 2.R1
   
4 1 4 4 R3 0 9 −8 −40 R3a = R3 − 4.R1
 
1 −2 3 11 R1
∼  0 1 −1 −4  R2b = 13 .R2a
 
0 9 −8 −40 R3a
 
1 0 1 3 R1a = R1 + 2.R2b
∼  0 1 −1 −4  R2b
 
0 0 1 −4 R3b = R3a − 9.R2b
 
1 0 0 7 R1b = R1a − R3b
∼  0 1 0 −8  R2c = R2b + R3b
 
0 0 1 −4 R3b

The matrix is now in reduced row echelon form and the solution may be easily read off: x1 = 7,
x2 = −8, x3 = −4 /

If the constant on the right hand side of every equation in a system is zero the system is called
homogeneous (otherwise it is non–homogeneous).

. Example 4: Solve the following homogeneous system

x1 + x2 − 2x3 = 0
x1 + 2x2 − 3x3 = 0
2x1 − 3x2 + x3 = 0

Such a system always has the trivial solution, i.e. taking all the variables to be zero. However, non–
trivial solutions will sometimes exist. The last column of the augmented matrix of a homogeneous
system, consisting of zeros only, will remain unchanged by elementary row operations, and so may be
omitted. If we completely reduce the matrix the solution would proceed as follows:
   
1 1 −2 R1 1 1 −2 R1
 1 2 −3  R2 ∼  0 1 −1  R2a = R2 − R1
   
2 −3 1 R3 0 −5 5 R3a = R3 − 2.R1
 
1 0 −1 R1a = R1 − R2a
∼  0 1 −1  R2a
 
0 0 0 R3b = R3a + 5.R2a

The given system is thus equivalent to: x1 − x3 = 0, x2 − x3 = 0. Taking x3 = t (t ∈ R), the general
solution is: x1 = t, x2 = t, x3 = t. /
Introduction to Linear Algebra MATH140 7

3. Matrices

A matrix is, as we have seen, simply a rectangular array of numbers arranged into (horizontal) rows
and (vertical) columns. If a matrix has m rows and n columns it is called an m × n matrix or is said
to have dimensions (or order) m × n (read “m by n”).

. Example 1:
 
1 3 !
−1 2 1 0
 4 0  is a 3 × 2 matrix and is a 2 × 4 matrix.
 
0 0 0 0
2 −1
/

A matrix consisting of a single row, i.e. a 1 × n matrix, is called a row vector and a matrix having a
single column, i.e. an m × 1 matrix, is a column vector.

. Example 2: !
  1
0 1 0 is a row vector and is a column vector.
0
/

A matrix having the same number of rows as columns, i.e. an n × n matrix for some n ∈ N, is called
a square matrix. The m × n matrix whose entries are all zero is known as the m × n zero matrix and
is denoted O.

We write a general m × n matrix A as:


 
a11 a12 . . . a1n

 a21 a22 . . . a2n 

 . . . 
A=
 
. . .

 
 
 . . . 
am1 am2 . . . amn
where aij is the entry in the ith row and the j th column (i = 1, 2, . . . , m and j = 1, 2, . . . , n) of the
matrix A. As a shorthand notation we often write matrix A as: A = (aij ).

. Example 3: Consider the (square) matrix


 
2 −3 −5
 0 1 4 
 
−1 7 6
Then a12 = −3, a21 = 0, a33 = 6, etc. . . /

Two matrices A = (aij ) and B = (bij ) are equal if and only if they have the same dimensions, i.e. are
both m × n matrices for some m, n ∈ N, and the corresponding entries are equal, i.e. aij = bij for
i = 1, 2, . . . , m, j = 1, 2, . . . , n. Note then that matrices such as
! !
1 2 1 2 0
and
3 4 3 4 0
are not equal.
Introduction to Linear Algebra MATH140 8

Remark: In the previous section we stored, for example, the system

3x + y − 2z = 4
4x + 5y + 6z = 24
x + 2y + 3z = 9

in the augmented matrix  


3 1 −2 4
 4 5 6 24  .
 
1 2 3 9
This is called an augmented matrix since it is the coefficient matrix of the system:
 
3 1 −2
 4 5 6 
 
1 2 3

(i.e. the matrix consisting of the coefficients of the variables) augmented by the column vector
 
4
 24 
 
9

consisting of the constants on the right of the equations.

4. Scalar Multiplication and Addition of Matrices

Definition (Scalar Multiplication): If A = (aij ) is an m × n matrix and α is a scalar then the


product αA is
αA = (αaij )
i.e. αA is the m × n matrix whose entries are obtained by multiplying every entry of A by α.

. Example 1:    
2 0 −1 6 0 −3
If A =  −4 1 3  then 3A =  −12 3 9 
   
5 −2 8 15 −6 24
 
0 0 0
and 0A =  0 0 0  , the 3 × 3 zero matrix.
 
0 0 0
/

Definition (Addition): If A = (aij ) and B = (bij ) are both m × n matrices then

A + B = (aij + bij )

i.e. A + B is the m × n matrix obtained by adding entries in corresponding positions.

. Example 2: ! ! !
1 0 −7 −4 2 −3 −3 2 −10
+ =
−2 3 5 6 −8 −5 4 −5 0
Introduction to Linear Algebra MATH140 9
! !
1 2 −1 1 0
but + is not defined as the matrices have different dimensions.
3 4 0 2 0
/

Using addition and scalar multiplication we can also define the difference of two matrices as:
A − B = A + (−1)B, provided that A and B are matrices of the same order.

Properties of Addition and Scalar Multiplication: Let A, B and C be m × n matrices. Then

(a) A + O = A, 0A = O where O is the m × n zero matrix.

(b) 1A = A

(c) commutative law: A + B = B + A

(d) associative law: (A + B) + C = A + (B + C)

(e) distributive laws: α(A + B) = αA + αB,


(α + β)A = αA + βA where α, β ∈ R.

To prove the above (as well as other matrix properties) we must verify that

(i) the dimensions of the matrix on each side is the same, and

(ii) the ij th entry on the left hand side equals the ij th entry on the right hand side.

. Example 3: Prove that α(A + B) = αA + αB for α ∈ R.

Let A = (aij ) and B = (bij ) both be m × n matrices.

(i) A + B is m × n, and hence so is α(A + B).


αA and αB are both m × n, and hence so is αA + αB.
Therefore the dimensions on the lhs = the dimensions on the rhs.

(ii) If we denote the ij th entry of α(A + B) as [α(A + B)]ij then we have:

[α(A + B)]ij = α [A + B]ij (definition of scalar multiplication


= α{aij + bij }
= αaij + αbij (distributive law for real numbers)
= [αA]ij + [αB]ij
= [αA + αB]ij (definition of matrix addition)

Therefore the ij th entry on the lhs = the ij th entry on the rhs. /


Introduction to Linear Algebra MATH140 10

TUTORIAL 1

1. Suppose that each of the following matrices has been obtained by performing elementary row
operations on the augmented matrix of a system of linear equations. Find the solution(s), if any,
of these systems:
   
1 2 −4 2 1 0 3 1
(a)  0 1 −2 −1  (b)  0 1 2 4 
   
0 0 1 2 0 0 0 0
   
1 0 0 3 2 1 2 0 0
(c)  0 1 0 −1 4  (d)  0 0 1 0 
   
0 0 1 1 2 0 0 0 1
   
1 −7 5 5 1 5 −4 0 −7 −5
(e)  0 1 3 2  (f)  0 0 1 1 7 3 
   
0 0 0 0 0 0 0 1 4 2

2. Which of the matrices in Q1 are completely reduced?

3. Solve each of the following systems (by reduction of the augmented matrix to either echelon or
completely reduced form):

x + 2y + 3z = 9
3x − y = 2
(a) (b) 2x + y − z = 0
x + 3y = 5
3x − 4y − 2z = 4

5x + 3y − 4z = 2 x + 2y − 3z = 6
(c) 3x − y + 2z = 7 (d) 2x − y + 4z = 2
x + 2y − 3z = −1 4x + 3y − 2z = 14

x − 3y + 4z − 2w = 5 x + 2y = 1
(e) 2y + 5z + w = 2 (f) −x + 3y = 2
y − 3z = 4 x + 7y = 4

4. For which values of c will the following systems have (i) no solutions, (ii) infinitely many solu-
tions, and (iii) a unique solution?

x + 2y − 3z = 4 x + 4y − 2z = c
(a) 3x − y + 5z = 2 (b) 3x + 5y = 5
4x + y + (c2 − 14)z = c + 2 2x + 15y − 10z = 5

5. For what value(s) of c do the following systems have non–trivial solutions?

x−y+z = 0
(c − 2)x + y = 0
(a) (b) 3x + y + 4z = 0
x + (c − 2)y = 0
4x + 12y + cz = 0
Find all solutions for these values of c and check your answers by substitution.
 
1 2 1
6. Evaluate the matrices 3A, − 12 B, A + B and A − 2B when A =  0 2 1  and
 
0 0 2
Introduction to Linear Algebra MATH140 11
 
1 −1 1
B= 2 0 0 .
 
1 −1 2

TUTORIAL 1
ANSWERS

1. (a) x1 = 4, x2 = 3, x3 = 2
(b) x1 = 1 − 3t, x2 = 4 − 2t, x3 = t (t ∈ R)
(c) x1 = 2 − 3t, x2 = 4 + t, x3 = 2 − t, x4 = t (t ∈ R)
(d) no solutions
(e) x1 = 19 − 26t, x2 = 2 − 3t, x3 = t (t ∈ R)
(f) x1 = −1 − 5s − 5t, x2 = s, x3 = 1 − 3t, x4 = 2 − 4t, x5 = t (s, t ∈ R)
11 13
3. (a) x = 10 , y= 10
(b) x = 2, y = −1, z = 3
(c) no solutions
(d) x = 2 − t, y = 2 + 2t, z = t (t ∈ R)
(e) x = 17 157 3 26 t 6
11 t + 11 , y = − 11 t + 11 , z = − 11 − 11 , w = t (t ∈ R)
OR (neater) x = 5 − 17t, y = 4 + 3t, z = t, w = −6 − 11t (t ∈ R)
(f) x = − 15 , y = 3
5

4. (a) (i) c = −4 (ii) c = 4 (iii) any c 6= ±4


(b) (i) any c 6= 2 (ii) c = 2 (iii) no value of c

5. (a) c = 1 or 3
(b) c = 8
   
3 6 3 −1 1
− 12
 2 2
6. (a)  0 6 3  (b)  −1 0 0 
  
0 0 6 − 12 1
2 −1
   
2 1 2 −1 4 −1
(c)  2 2 1  (d)  −4 2 1 
   
1 −1 4 −2 2 −2
Introduction to Linear Algebra MATH140 12

5. Matrix Multiplication

Definition: Let A = (aij ) be an m × n matrix and B = (bij ) be an n × p matrix. Then the matrix
product AB is the m × p matrix whose ij th entry is
n
X
aik bkj = ai1 b1j + ai2 b2j + . . . + ain bnj
k=1

Remarks:

(a) AB is only defined if the number of columns of A equals the number of rows of B.

(b) AB has the same number of rows as A and the same number of columns as B.
Symbolically: (m × n)(n × p) = m × p.

. Example 1: ! !
1 2 4 −2 0
If A = and B = then
−1 3 −3 5 6
! !
(1)(4) + (2)(−3) (1)(−2) + (2)(5) (1)(0) + (2)(6) −2 8 12
AB = = ,
(−1)(4) + (3)(−3) (−1)(−2) + (3)(5) (−1)(0) + (3)(6) −13 17 18
but BA is not defined since B has 3 columns while A has only 2 rows. /

. Example 2: ! !
−2 1 0 −3
If A = and B = then
3 −1 8 −6
! !
(−2)(0) + (1)(8) (−2)(−3) + (1)(−6) 8 0
AB = = ,
(3)(0) + (−1)(8) (3)(−3) + (−1)(−6) −8 −3
! !
(0)(−2) + (−3)(3) (0)(1) + (−3)(−1) −9 3
but BA = = .
(8)(−2) + (−6)(3) (8)(1) + (−6)(−1) −34 14
Thus even though AB and BA do both exist here, they are not equal. /

. Example 3: !
  4
If A = 1 3 and B = then
−1
   
AB = (1)(4) + (3)(−1) = 1 (a 1 × 1 matrix)
! !
(4)(1) (4)(3) 4 12
but BA = = (a 2 × 2 matrix).
(−1)(1) (−1)(3) −1 −3
/

As the above examples demonstrate, in general AB 6= BA, i.e. matrix multiplication is non–commutative.
It does, however, possess other desirable properties.
Introduction to Linear Algebra MATH140 13

Properties of Matrix Multiplication: Provided that the products involved are defined, we have
(a) (αA)B = α(AB) = A(αB) where α ∈ R
(b) associative law: A(BC) = (AB)C
(c) distributive laws: A(B + C) = AB + AC
(B + C)A = BA + CA

To prove the above properties we again need to show that the dimensions of the matrix on each side
is the same and that the ij th entry of the matrix on each side is the same.

. Example 4: If A = (aij ) is an m × n matrix and B = (bij ) and C = (cij ) are n × p matrices, prove
that A(B + C) = AB + AC.

Proof:
(i) A is m × n and B + C is n × p, so A(B + C) is m × p.
AB and AC are both m × p, so AB + AC is m × p.
Therefore the dimensions on the lhs = the dimensions on the rhs.
(ii) The ij th entry of B + C is [B + C]ij = bij + cij . So, using the definition of matrix multiplication,
we have
n
X
[A(B + C)]ij = aik [B + C]kj
k=1
Xn
= aik {bkj + ckj }
k=1
Xn
= {aik bkj + aik ckj } (distributive law for real numbers)
k=1
Xn n
X
= aik bkj + aik ckj (rearranging the order of the terms)
k=1 k=1
= [AB]ij + [AC]ij (definition of matrix multiplication)
= [AB + AC]ij

Therefore the ij th entry on the lhs = the ij th entry on the rhs. /

. Example 5: If A = (aij ) is an m × n matrix, B = (bij ) is an n × p matrix and C = (cij ) is a p × q


matrix, prove that A(BC) = (AB)C.

Proof:
(i) A is m × n and BC is n × q, so A(BC) is m × q.
AB is m × p and C is p × q, so (AB)C is m × q.
Therefore the dimensions on the lhs = the dimensions on the rhs.
p
X
(ii) The ij th entry of BC is [BC]ij = bil clj . So we have
l=1
n
X
[A(BC)]ij = aik [BC]kj
k=1
Introduction to Linear Algebra MATH140 14
n
( p )
X X
= aik bkl clj
k=1 l=1
Xn X p
= aik bkl clj (distributive law for real numbers)
k=1 l=1
Xp X n
= aik bkl clj (rearranging the order of the terms)
l=1 k=1
Xp (X n
)
= aik bkl clj (distributive law for real numbers)
l=1 k=1
Xp
= [AB]il clj
l=1
= [(AB)C]ij

Therefore the ij th entry on the lhs = the ij th entry on the rhs. /

6. Matrices and Linear Equations

Consider the general system of m linear equations in n variables x1 , x2 , . . . , xn :

a11 x1 + a12 x2 + . . . + a1n xn = c1


a21 x1 + a22 x2 + . . . + a2n xn = c2
. .
E:
. .
. .
am1 x1 + am2 x2 + . . . + amn xn = cm

The m × n coefficient matrix of the system is


 
a11 a12 . . . a1n

 a21 a22 . . . a2n 

 . . . 
A = (aij ) = 
 
. . .

 
 
 . . . 
am1 am2 . . . amn

We now write the variables x1 , x2 , . . . , xn and the constants on the right hand side of the system c1 ,
c2 , . . . , cm as column vectors, i.e. n × 1 and m × 1 matrices respectively:
   
x1 c1

 x2 


 c2 

 .   . 
X=  and C =  .
   
 .   . 
   
 .   . 
xn cm
Introduction to Linear Algebra MATH140 15

Then system E may be written in matrix form as


    
a11 a12 . . . a1n x1 c1

 a21 a22 . . . a2n 
 x2  
  c2 

 . . .  .   . 
=
    
. . . . .
  
    
    
 . . .  .   . 
am1 am2 . . . amn xn cm
or simply as
AX = C.

. Example 1: The system

2x1 + 3x2 + 5x3 = 7


3x1 + 4x2 + 8x3 = 9
x1 + x2 + 2x3 = 1

may be written in matrix form as


    
2 3 5 x1 7
 3 4 8   x2  =  9 
    
1 1 2 x3 1
    
2 3 5 −5 7
and since  3 4 8   4  =  9  ,
    
1 1 2 1 1
x1 = −5, x2 = 4, x3 = 1 is a solution of the above system. /

Using properties (a) and (b) of matrix multiplication we now prove the result, mentioned in §1, that
a system of linear equations which has more than one solution must in fact have an infinite number
of solutions.

. Theorem: A system of linear equations has either


(a) no solutions or

(b) a unique solution or

(c) an infinite number of solutions.


Proof: We have seen by examples that cases (a) and (b) can occur. Suppose then that the system
AX = C has two distinct solutions, X 0 and X 00 say, i.e that

AX 0 = C and AX 00 = C (1)

with X 0 6= X 00 . We show that kX 0 + (1 − k)X 00 is also a solution of AX = C for every value of the
number k:

A kX 0 + (1 − k)X 00 = A(kX 0 ) + A (1 − k)X 00


 
(property (c))
0 00
= kAX + (1 − k)AX (property (a))
= kC + (1 − k)C (by (1))
= C
Introduction to Linear Algebra MATH140 16

i.e. the system has infinitely many solutions. /

7. Linear Transformations

Definition: If A = (aij ) is an m × n matrix then the linear transformation Y = AX transforms the


n × 1 vector  
x1
 x2 
 
 . 
X=
 
 . 

 
 . 
xn
into the m × 1 vector
   
y1 a11 x1 + a12 x2 + . . . + a1n xn

 y2  
  a21 x1 + a22 x2 + . . . + a2n xn 

 .   . 
Y = = .
   
 .   . 
   
 .   . 
ym am1 x1 + am2 x2 + . . . + amn xn

Now if B = (bij ) is an l × m matrix then the linear transformtaion Z = BY transforms the above
vector Y into the l × 1 vector
   
z1 b11 y1 + b12 y2 + . . . + b1m ym

 z2  
  b21 y1 + b22 y2 + . . . + b2m ym 

 .   . 
Z= = .
   
 .   . 
   
 .   . 
zl bl1 y1 + bl2 y2 + . . . + blm ym

We can then express Z directly in terms of X as follows:

Z = BY = B(AX)
= (BA)X (associative law of matrix multiplication)

i.e. the matrix of two successive linear transformations is just the product, in the correct order, of the
matrices of each. (The definition of matrix multiplication is in fact chosen in order that this be true).

. Example 1: If Y = AX and Z = BY where


! !
2 1 0 1 3
A= and B =
−1 2 3 2 −1

then Z = (BA)X where


! ! !
1 3 2 1 0 −1 7 9
BA = = .
2 −1 −1 2 3 5 0 −3
Introduction to Linear Algebra MATH140 17

Hence z1 and z2 may be expressed in terms of x1 , x2 and x3 as:

z1 = −x1 + 7x2 + 9x3


z2 = 5x1 − 3x3

8. The Identity Matrix and the Inverse of a Matrix

Definition (Identity Matrix): The m × m identity matrix is the matrix


 
1 0 0 . . . 0
0 1 0 . . . 0
 
 
0 0 1 . . . 0
 
 
 
Im =
 . . . . . . . 


 . . . . . . . 

. . . . . . .
 
 
0 0 0 . . . 1

i.e. all entries on the main diagonal are 1 and all other entries are 0. The m × m identity matrix may
be written more compactly as: Im = (δij ) where δij is the Kronecker–delta and is defined as
(
0 if i 6= j
δij =
1 if i = j

for i, j = 1, 2, . . . , m.

Properties of the Identity Matrix: If A = (aij ) is an m × n matrix then

(a) Im A = A

(b) AIn = A.

So the identity matrix plays a role analogous to that of the number 1 in scalar multiplication.

. Proof of (a):

(i) Im A and A are both m × n matrices. Therefore the dimensions on the lhs = the dimensions on
the rhs.

(ii) The ij th entry of Im A is


m
X
[Im A]ij = δik akj
k=1
= δii aij (since all terms in the sum with k 6= i are 0)
= 1.aij
= aij

Therefore the ij th entry on lhs = the ij th entry on the rhs. /


Introduction to Linear Algebra MATH140 18

If the context makes the size of the identity matrix clear, we simply denote it by I. (Note that I must
always be square). We therefore have: AI = IA = A for any m × n matrix A.

Definition (Inverse of a Matrix): Given a square (m × m) matrix A = (aij ). If there exists an


m × m matrix B = (bij ) such that
AB = BA = I
then B is called the inverse of A and is denoted A−1 . Thus AA−1 = A−1 A = I . Furthermore A is
called an invertible matrix.

Remarks:
(a) For A, B both m × m matrices it can be shown that if one of the equations AB = I or BA = I
holds, then so does the other. Of course A is then invertible and A−1 = B.
(b) A square matrix may not be invertible.
! !
1 1 a b
. Example 1: If A = and B = then AB = I if and only if
1 1 c d
! !
a+c b+d 1 0
= , which is impossible. /
a+c b+d 0 1

(c) If A−1 does exist, it is unique.


. Proof: Suppose AB = BA = I and also AC = CA = I. Then
C(AB) = (CA)B (associative law)
⇐⇒ CI = IB
⇐⇒ C = B
i.e. the inverse is unique. /

Finding the Inverse: Suppose that matrix A is square and that A−1 exists. Now consider the
system of linear equations (or the transformation)
AX = Y (2)
Multiplying both sides on the left by A−1 (remember that matrix multiplication is non–commutative)
we obtain:
A−1 (AX) = A−1 Y
⇐⇒ (A−1 A)X = A−1 Y (associative law)
−1
⇐⇒ IX = A Y
−1
⇐⇒ X = A Y (3)
Thus A−1 , if it exists, can be found as the coefficient matrix of the system (3) obtained by solving
system (2) for the x’s in terms of the y’s. We demonstrate this procedure via the following example:
!
1 2
. Example 2: Consider A = . The system corresponding to (2) is then
2 3
x1 + 2x2 = y1
2x1 + 3x2 = y2
Introduction to Linear Algebra MATH140 19

which may be solved using Gauss–Jordan elimination to get x1 and x2 in terms of y1 and y2 . Rather
than write out y1 and y2 each time in this reduction, it is more convenient to regard the above system
as

1x1 + 2x2 = 1y1 + 0y2


2x1 + 3x2 = 0y1 + 1y2

and work with the augmented matrix !


1 2 1 0
2 3 0 1
Applying Gauss–Jordan elimination we have
! !
1 2 1 0 R1 1 2 1 0 R1

2 3 0 1 R2 0 −1 −2 1 R2a = R2 − 2.R1
!
1 2 1 0 R1

0 1 2 −1 R2b = −1.R2a
!
1 0 −3 2 R1a = R1 − 2.R2b

0 1 2 −1 R2b

The final augmented matrix here tells us that x1 , x2 satisfy (2) if and only if

x1 = −3y1 + 2y2
x2 = 2y1 − y2

or in matrix form ! ! !
x1 −3 2 y1
=
x2 2 −1 y2
corresponding to (3). Thus !
−1 −3 2
A = .
2 −1
As a check verify that:
! ! ! ! !
−3 2 1 2 1 0 1 2 −3 2
= = .
2 −1 2 3 0 1 2 3 2 −1

In general, then, we have the following method for finding inverses: Given the m × m matrix A,
form the augmented matrix (A|Im ) and completely reduce this (if possible), i.e. using Gauss-Jordan
elimination, to the form (Im |B) . Then B = A−1 . If it is not possible to completely reduce A to Im ,
i.e. if we obtain a row (or column) of zeros during the reduction, then A is not invertible.
 
1 0 2
. Example 3: If A =  2 1 3  find A−1 if it exists.
 
4 1 8
Introduction to Linear Algebra MATH140 20

   
1 0 2 1 0 0 R1 1 0 2 1 0 0 R1
 2 1 3 0 1 0  R2 ∼  0 1 −1 −2 1 0  R2a = R2 − 2.R1
   
4 1 8 0 0 1 R3 0 1 0 −4 0 1 R3a = R3 − 4.R1
 
1 0 2 1 0 0 R1
∼  0 1 −1 −2 1 0  R2a
 
0 0 1 −2 −1 1 R3b = R3a − R2a
 
1 0 0 5 2 −2 R1a = R1 − 2.R3b
∼  0 1 0 −4 0 1  R2b = R2a + R3b
 
0 0 1 −2 −1 1 R3b
 
5 2 −2
Thus A−1 =  −4 0 1 .
 
−2 −1 1
/

Now if A−1 exists then the system AX = Y may be solved at once for any Y using (3), i.e. X = A−1 Y .

. Example 4: Solve the system

x1 + 2x3 = −3
2x1 + x2 + 3x3 = 2
4x1 + x2 + 8x3 = −1

Now the coefficient matrix of this system is the matrix A from Example 3 above. We have found its
inverse, so the unique solution of the system is given by
        
x1 −3 5 2 −2 −3 −9
−1 
x = A 2 = −4 0 1 2   11 
=
       
 2     
x3 −1 −2 −1 1 −1 3

or x1 = −9, x2 = 11 and x3 = 3. /
Introduction to Linear Algebra MATH140 21

TUTORIAL 2

1. Find AB and/or BA (when defined) when


! !
1 1 0 1 2
(a) A, B are as in Q6(tutorial 1) (b) A = , B=
2 0 1 2 1
     
! 1 2 3 0 0 3 2
1 1 0
(c) A = , B= 2 1  (d) A =  0 1 0 , B =  1 1 
     
2 0 1
1 1 0 0 2 −1 0
   
1 1 0 −2 !
  4 5 −1
(e) A = 2 3 −1 , B= 0  (f) A =  2 1 3 , B =
   
2 0 3
2 4 −2 0
   
1 2 −1
(g) A =  −2 , B =  4 3 
   
3 −3 2
 
! −1 0 1
2 0 −1
2. Verify the associative law A(BC) = (AB)C when A = , B =  2 −3 −1 
 
−1 −2 2
3 0 −1
 
−1
and C =  1 
 
2

3. If A and B are m × n matrices and C is an n × p matrix prove that (A + B)C = AC + BC.


! !
1 −2 4 −2
4. (a) By considering A = and B = , show that the matrix equation
−2 4 2 −1
AB = 0 can hold without A or B being the zero matrix. [Note that if a, b are real numbers
and ab = 0, we must have either a = 0 or b = 0 (or both)].
Find also BA for these values of A and B. [Note then that AB = 0 does not imply BA = 0].
(b) If A and B are m × m matrices with AB = 0, is it true that (A + B)2 = A2 + B 2 ? (Give
proof or counterexample).

5. Find A−1 , if it exists, for


 
! 1 1 0
1 2
(a) A = (b) A =  0 1 −1 
 
2 1
−1 0 1
   
2 3 −1 2 1 2
(c) A =  1 −1 1  (d) A =  1 3 2 
   
1 14 −8 −1 1 0

Check your answer, where applicable, by finding AA−1 .

6. Use appropriate results from Q5 to solve:


Introduction to Linear Algebra MATH140 22
 
2x + y + 2z = 1 
 x+y = 2 

(a) x + 3y + 2z = 6 (b) y − z = −1 (be careful!)
−x + y x − z = −4 
 
= 4 
! !
1 2 1 −3 −1
(c) AX = B, where A = and B =
2 1 2 0 1

7. If A and B are m × m invertible matrices, show that AB is invertible by verifying that B −1 A−1
is its inverse. (Note then that (AB)−1 = B −1 A−1 ).

y1 = x1 − 2x2 + 3x3 − x4  )
 z1 = 2y1 + y2 − y3
8. If y2 = 2x1 − x3 + x4 and ,
 z2 = y1 − 2y3
y3 = x1 + 2x2 + 3x4 
use matrix multiplication to express z1 and z2 in terms of x1 , x2 , x3 and x4 .

TUTORIAL 2
ANSWERS

1. (Where no answer is given, the product is not defined)


   
6 −2 3 1 0 2 !
5 1 2
(a) AB =  5 −1 2 , BA =  2 4 2  (b) BA =
   
4 2 1
2 −2 4 1 0 4
   
! 5 1 2 9 6
3 3
(c) AB = , BA =  4 2 1  (d) AB =  1 1 
   
3 5
3 1 1 −2 0
 
2 3 −1 !
  10 7 7
(e) AB = 0 , BA =  0 0 0  (f) BA =
 
14 −6 −4
4 6 −2
!
11
2. A(BC) = (AB)C =
1
!
8 −16
4. (a) BA = (b) false
4 −8

5. (Where no answer is given, the inverse does not exist)


 
1
! − 12 − 12
− 13 2
3
2
1 1 1
(a) (b) 
 
2
− 13 2 2 2 
1
3
2 − 12 1
2
 
−1 1 −2
(d)  −1 1 −1 
 
3 5
2 −2 2
Introduction to Linear Algebra MATH140 23
       
x −3 x −1
  25 
6. (a)  y  =  1  (b)  y  =  2 
    
7
z 3 z 2
!
1 1 1
(c) X =
0 −2 −1

8. z1 = 3x1 − 6x2 + 5x3 − 4x4 , z2 = −x1 − 6x2 + 3x3 − 7x4

You might also like