unit 1. linear algebra (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/unit 1/linear...

49
UNIT 1. LINEAR ALGEBRA (3 credits) February 1, 2002

Upload: others

Post on 30-Jul-2020

16 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

UNIT 1.LINEAR ALGEBRA

(3 credits)

February 1, 2002

Page 2: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

Contents

Linear Algebra 11 Linear Systems. Method of Elimination . . . . . . . . . . . . . 1

1.1 Systems of Linear Equations or Linear Systems . . . . 11.2 Method of Elimination . . . . . . . . . . . . . . . . . . 4

2 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.1 Definition of a Matrix . . . . . . . . . . . . . . . . . . 112.2 Matrix Addition . . . . . . . . . . . . . . . . . . . . . 142.3 Scalar Multiplication . . . . . . . . . . . . . . . . . . . 14

3 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . 163.1 Product of a Row Matrix and a Column Matrix . . . . 163.2 Product of Two Matrices . . . . . . . . . . . . . . . . . 163.3 Identity Matrix . . . . . . . . . . . . . . . . . . . . . . 193.4 Properties of Matrix Operations . . . . . . . . . . . . . 20

4 Solutions of Linear Systems of Equations . . . . . . . . . . . . 214.1 Matrix Representation of a System of Linear Equations 214.2 Reduced Row Echelon Form of a Matrix . . . . . . . . 224.3 Solving Linear Systems . . . . . . . . . . . . . . . . . . 23

5 The Inverse of a Matrix . . . . . . . . . . . . . . . . . . . . . 275.1 Definition of the Inverse of a Matrix . . . . . . . . . . 275.2 A Practical Method for Finding the Inverse . . . . . . 285.3 Solving a Linear System Using Inverses . . . . . . . . . 30

6 Determinants . . . . . . . . . . . . . . . . . . . . . . . . . . . 326.1 Determinant of a 2× 2 Matrix . . . . . . . . . . . . . . 326.2 Determinant of a 3× 3 Matrix . . . . . . . . . . . . . . 33

7 Cofactor Expansion and Applications . . . . . . . . . . . . . . 357.1 Cofactors . . . . . . . . . . . . . . . . . . . . . . . . . 357.2 Cofactor Expansion . . . . . . . . . . . . . . . . . . . . 367.3 The Inverse of a Matrix . . . . . . . . . . . . . . . . . 377.4 Properties of Determinants . . . . . . . . . . . . . . . . 38

8 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

i

Page 3: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

CONTENTS ii

8.1 Vectors in the Plane . . . . . . . . . . . . . . . . . . . 408.2 n-Vectors . . . . . . . . . . . . . . . . . . . . . . . . . 43

Linear Algebra - Exercises 479 Linear Systems. Method of Elimination . . . . . . . . . . . . . 4710 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

10.1 Homework Problems . . . . . . . . . . . . . . . . . . . 5210.2 Answers to Homework Problems . . . . . . . . . . . . . 53

11 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . 5411.1 Homework Problems . . . . . . . . . . . . . . . . . . . 5611.2 Answers to Homework Problems . . . . . . . . . . . . . 56

12 Solutions of Linear Systems of Equations . . . . . . . . . . . . 5712.1 Homework Problems . . . . . . . . . . . . . . . . . . . 6012.2 Answers to Homework Problems . . . . . . . . . . . . . 61

13 The Inverse of a Matrix . . . . . . . . . . . . . . . . . . . . . 6213.1 Homework Problems . . . . . . . . . . . . . . . . . . . 6413.2 Answers to Homework Problems . . . . . . . . . . . . . 64

14 Determinants . . . . . . . . . . . . . . . . . . . . . . . . . . . 6514.1 Homework Problems . . . . . . . . . . . . . . . . . . . 6614.2 Answers to Homework Problems . . . . . . . . . . . . . 66

15 Cofactor Expansion and Applications . . . . . . . . . . . . . . 6715.1 Homework Problems . . . . . . . . . . . . . . . . . . . 7015.2 Answers to Homework Problems . . . . . . . . . . . . . 71

16 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7216.1 Homework Problems . . . . . . . . . . . . . . . . . . . 7416.2 Answers to Homework Problems . . . . . . . . . . . . . 74

An Example of Exam 1 75

Page 4: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

Linear Algebra

1 Linear Systems. Method of Elimination

1.1 Systems of Linear Equations or Linear Systems

An equation of the typeax = b,

where a and b are constants (real numbers) and x is a variable, is called alinear equation. Similarly, the equation

a1x1 + a2x2 + · · ·+ anxn = b,

where a1, a2, . . . , an and b are constants and x1, x2, . . . , xn are variables arecalled a linear equation. We call x1, x2, . . . , xn unknowns.

Example 1. Examples of linear equations:a) 2x = 3;b) 5x− 6y = 0.5;c) x1 + 2x2 + 1

2x3 =

13.

A solution to a linear equation

a1x1 + a2x2 + · · ·+ anxn = b (1)

is a sequence of n numbers s1, s2, . . . , sn which has the property that (1.1) issatisfied when

x1 = s1, x2 = s2, . . . , xn = sn

are substituted in (1.1). This means that

a1s1 + a2s2 + · · ·+ ansn = b.

Example 2. Determine whethera) x = 2, y = 3

1

Page 5: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 2

b) x = −2, y = 1are solutions to the linear equation

2x+ 3y = −1.

Solution.a) We substitute x = 2, y = 3 in the equation and obtain

2 · 2 + 3 · 3 = −1.

Since13 6= −1

we conclude that x = 2, y = 3 is not a solution.b) We substitute x = −2, y = 1 in the equation and obtain

2 · (−2) + 3 · 1 = −1,−1 = −1.

Therefore, x = −2, y = 1 is a solution to the given equation.Example 3. The equation 2x = 1 has the unique solution x = 1

2.

Example 4. We consider the equation

x− y = 5.

Thenx = 5, y = 0

is a solution to the given equation. But this solution is not unique. Thefollowing pairs of numbers are also solutions:

x = 6, y = 1,

x = 7, y = 2,

x = 0, y = −5,x = −1, y = −6.

This equation has infinitely many solutions. We may describe the generalsolution in the following way:

x = 5 + y,

where y is any real number.

Page 6: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 3

A system of m linear equations in n unknowns, or simply a linearsystem, is a set of m linear equations, each in n unknowns. We write alinear system in the following way:

a11x1 + a12x2 + · · ·+ a1nxn = b1,a21x1 + a22x2 + · · ·+ a2nxn = b2,

...

am1x1 + am2x2 + · · ·+ amnxn = bm.

(2)

Here a11, . . . amn and b1, . . . bm are constants and x1, x2, . . . , xn are variables.A solution to a linear system (1.2) is a sequence of n numbers s1, s2, . . . , sn

which has the property that each equation in (1.2) is satisfied when

x1 = s1, x2 = s2, . . . , xn = sn

are substituted in (1.2).

Example 5. Consider the linear system

2x + 3y = 1,x + y = 0.

Determine ifa) x = −1, y = 1b) x = 2, y = −1

are solutions to the system.Solution.a) We substitute x = −1, y = 1 in the first equation

2 · (−1) + 3 · 1 = 11 = 1

and in the second equation

(−1) + 1 = 00 = 0.

Both equations are satisfied, so x = −1, y = 1 is a solution.b) We substitute x = 2, y = −1 in the first equation

2 · 2 + 3 · (−1) = 11 = 1

Page 7: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 4

and in the second equation

2 + (−1) = 01 6= 0.

The second equation is not satisfied and therefore x = 2, y = −1 is not asolution to the given system.

1.2 Method of Elimination

A linear system can be solved using different methods. We will describe themethod of elimination. This method is appropriate for solving systemswith many equations and many unknowns.

Example 6. Consider the linear system

x − 3y = −3,2x + y = 8.

We want to eliminate some of the unknowns by adding a multiple of oneequation to another eqation. We start with the unknown x. Let us justconsider the coefficients with x in the given equations.in Equation 1: xin Equation 2: 2x

We want to obtain 0 · x in Equation 2. We do the following:Equation 2 − 2·Equation 1.

The resulting equation is

(2− 2 · 1)x+ (1− 2 · (−3))y = 8− 2 · (−3),

that is,0 · x+ 7y = 14,

or7y = 14.

Therefore, the systemx − 3y = −3,2x + y = 8

is, using the operation

Equation 2 − 2·Equation 1

Page 8: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 5

transfered intox − 3y = −3,

7y = 14.

Now, from Equation 2, we compute

y = 2.

We substitute y = 2 into Equation 1:

x− 3 · 2 = −3,

which givesx− 6 = −3,

x = 6− 3,x = 3.

Therefore, we obtained the solution

x = 3,

y = 2.

To check that x = 3, y = 2 is a solution to the given system, we substitutex = 3, y = 2 into given equations:

3− 3 · 2 = −3,−3 = −3

and2 · 3 + 2 = 8,

8 = 8.

Example 7. Consider the linear system

2x + y + z = 2,x + 2y + z = 0,x + y = 1.

We start the elimination with the unknown x. Let us consider the coefficientswith x in the given equations.in Equation 1: 2xin Equation 2: xin Equation 3: x

We want to have x in Equation 1. This can be done in two ways:

Page 9: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 6

1. Multiplying Equation 1 by 12.

2. Interchanging two equations.

We interchange Equation 1 and Equation 2, to obtain

x + 2y + z = 0,2x + y + z = 2,x + 3y = 1.

Now, we havein Equation 1: xin Equation 2: 2xin Equation 3: x

We want to obtain 0·x in Equation 2 and in Equation 3. We do the following:Equation 2 −2·Equation 1Equation 3 − Equation 1

Equation 2 −2·Equation 1 is equal to(2− 2 · 1)x+ (1− 2 · 2)y + (1− 2 · 1)z = 2− 2 · 0

that is,−3y − z = 2.

Equation 3 − Equation 1 is equal to(1− 1)x+ (3− 2)y + (0− 1)z = 1− 0

that is,y − z = 1.

Therefore, the system

x + 2y + z = 0,2x + y + z = 2,x + y = 1,

is transfered intox + 2y + z = 0,− 3y − z = 2,

y − z = 1.

Now, Equation 2 and Equation 3 contain only two unknowns: y and z. Wecontinue elimination and consider only Equation 2 and Equation 3. Thevariable to eliminate is y.

Page 10: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 7

in Equation 2: −3yin Equation 3: y

To obtain y in Equation 2, we interchange Equation 2 and Equation 3. Now,the system is

x + 2y + z = 0,y − z = 1,

− 3y − z = 2.

in Equation 2: yin Equation 3: −3y

We want to obtain 0 · y in Equation 3. We do the following:Equation 3 +3 · Equation 2

Equation 3 +3 · Equation 2 is equal to(−3 + 3 · 2)y + (−1 + 3 · (−1))z = 2 + 3 · 1

that is,−4z = 5.

Now, the system isx + 2y + z = 0,

y − z = 1,− 4z = 5.

>From Equation 3, we compute

z = −54.

We substitute z = −54into Equation 2:

y − (−54) = 1,

which gives

y = −14.

We substitute y = −14and z = −5

4into Equation 1:

x+ 2 · (−14) + (−5

4) = 0,

which gives

x =7

4.

Page 11: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 8

Therefore, the solution is

x =7

4,

y = −14,

z = −54.

Page 12: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 9

Method of elimination consists of repeatedly performing the followingoperations

1. Interchange two equations.

2. Multiply an equation by a nonzero constant.

3. Add a multiple of one equation to another.

Example 8. Consider the linear system

2x + y = 2,−4x − 2y = −3.

We solve it by the method of elimination.12· Equation 1

x + 12y = 1

−4x − 2y = −3Equation 2 + 4 · Equation 1

x + 12y = 10 = 1

In Equation 2, we have 0 = 1, which is impossible. This means that thesystem has no solution. We say that the system is inconsistent.

Example 9. Consider the linear system

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

We solve it by the method of elimination.

Equation 2 − 2 · Equation 1x + 2y − 3z = −4,− 3y + 3z = 12.

−13· Equation 2

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

>From Equation 2, we read the solution

y = z − 4,

Page 13: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 10

where z is any real number. We substitute y = z + 4 into Equation 1 andobtain

x+ 2 · (z − 4)− 3z = −4x+ 2z − 8− 3z = −4

x− z − 8 = −4x = z + 8− 4x = z + 4.

Therefore, the general solution to the system is

x = z + 4

y = z − 4where z is any real number. This means that the system has infinitely manysolutions.Every time we assign a value to z, we obtain another solution to the

system. Thus, if z = 0, thenx = 4

y = −4z = 0

is a solution. If z = −2, thenx = 2

y = −6z = −2

is another solution.

These examples suggest that a linear system may have

1. one solution (a unique solution),

2. no solution, or

3. infinitely many solutions.

Page 14: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 11

2 Matrices

2.1 Definition of a Matrix

An m×n matrix A is a rectangular array of mn real (or complex) numbersarranged in m horizontal rows and n vertical columns:

A =

a11 a12 · · · a1na21 a22 · · · a2n...

......

a11 a12 · · · a1n

The ith row of A is

Rowi =£ai1 ai2 · · · ain

¤(1 ≤ i ≤ m);

the jth column A is

Colj =

a1ja2j...amj

(1 ≤ j ≤ n).

We shall say that A ism by n (written as m×n). We also say that the sizeof A is m× n. We refer to the number

aij

which is in the ith row and jth column of A as the i, jth element of A orthe (i, j) entry of A. We often write A as

A = [aij ].

Example 1.

A =

·1 −1 23 0 4

¸is a 2× 3 matrix, because it has 2 rows and 3 columns. Then

Row1 =£1 −1 2

¤, Row2 =

£3 0 4

¤Col1 =

·13

¸, Col2 =

·−10

¸, Col3 =

·24

¸,

Page 15: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 12

a13 = 2, a22 = 0.

Example 2.

B =

0 4 2 −11 1 −0.5 2−3 0 1 12 1 −1 3

is a 4× 4 matrix. Then

Row3 =£−3 0 1 1

¤, Col2 =

4101

, b23 = −0.5

Example 3. Let

C =£1 −3 −2¤ , D =

23−1

.Then C is a 1× 3 matrix and D is a 3× 1 matrix.If A is an n × n matrix, that is, if the number of rows of A is equal to

the number of columns of A, we say that A is a square matrix of order nand that the numbers

a11, a22, . . . , ann

form the diagonal of A. The position of the diagonal entries in the matrixis illustrated below:

A =

a11

a22. . .

ann

Example 4. The matrix

A =

1 −13 00 −2

is not square (it is 3× 2). The matrices

B =

·2 03 −1

¸, C =

1 2 −10 −1 03 3 3

Page 16: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 13

are square matrices. B is of order 2 and the diagonal of B is

2, −1.

C is of order 3 and the diagonal of C is

1, −1, 3.

Two matrices are said to be equal if they have the same size and ifcorresponding elements are equal. More precisely, let

A = [aij ], 1 ≤ i ≤ m, 1 ≤ j ≤ n,B = [bij ], 1 ≤ i ≤ m, 1 ≤ j ≤ n.

Then A = B ifaij = bij , 1 ≤ i ≤ m, 1 ≤ j ≤ n.

Example 5. Let

A =

·1 0−3 −1

¸, B =

·1 0−3 1

¸Then A and B are not equal (we write A 6= B), because a22 6= b22.

Page 17: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 14

2.2 Matrix Addition

If A = [aij ] and B = [bij] are m × n matrices, then the sum of A and B isthe m× n matrix C = [cij ] defined by

cij = aij + bij, 1 ≤ i ≤ m, 1 ≤ j ≤ n.

That is, C is obtained by adding corresponding elements of A and B. Notethat A+B is defined only if A and B are of the same size.

Example 6. Let

A =

·3 −1 02 −2 3

¸, B =

·1 0 0−2 5 1

¸, C =

·2 11 2

¸.

Then

A+B =

·3 + 1 −1 + 0 0 + 0

2 + (−2) −2 + 5 3 + 1

¸=

·4 −1 00 3 4

¸.

A+ C is not defined, because A and C are not of the same size.

2.3 Scalar Multiplication

A scalar is a number. Scalar multiplication is the multiplication of amatrix by a number, and is defined in the following way:

If A = [aij ] is an m×n matrices and c is a real number, then the productcA is the m× n matrix B = [bij] defined by

bij = c · aij , 1 ≤ i ≤ m, 1 ≤ j ≤ n.

That is, B is obtained by multiplying each element of A by c.

Example 7. Let

A =

1 3−2 50 1

.Then

3A =

3 · 1 3 · 33 · (−2) 3 · 53 · 0 3 · 1

= 3 9−6 150 3

If A and B are m×n matrices, we write A+(−B) as A−B and call this

the difference of A and B.

Page 18: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 15

Example 7. Let

A =

2 0−2 50 3

, B =

1 −10 31 2

.Then

A−B = 2− 1 0− (−1)−2− 0 5− 30− 1 3− 2

= 1 1−2 2−1 1

.

Page 19: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 16

3 Matrix Multiplication

3.1 Product of a Row Matrix and a Column Matrix

LetA =

£a1 a2 · · · an

¤be an 1× n matrix (a row matrix) and

B =

b1b2...bn

be an n×1 matrix (a column matrix). Then the product AB is the number

AB = a1b1 + a2b2 + · · ·+ anbn.Note that the number of columns of A (n) is equal to the number of rows ofB. Otherwise, the product AB is not defined.

Example 1. Let

A =£2 −1 0 3

¤, B =

13−2

, C =

51−1−1

.Then AB is not defined,

AC = 2 · 5 + (−1) · 1 + 0 · (−1) + 3 · (−1) = 10− 1 + 0− 3 = 6.

3.2 Product of Two Matrices

If A = [aij] is an m × p matrix and B = [bij] is a p × n matrix, then theproduct of A and B, denoted by AB, is the m× n matrix C = [cij ] definedby

cij = Rowi(A)Colj(B),

1 ≤ i ≤ m, 1 ≤ j ≤ n. Note that every element of the product AB iscomputed by multiplying a row of the matrix A with a column of the matrixB. The number of columns of A (p) is equal to the number of rowsof B. Otherwise, the product AB is not defined. Obsereve that thesize of AB is m× n:

A B = ABm× p p× n m× n

Page 20: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 17

Example 2. Let

A =

·1 2 03 −1 2

¸, B =

1 04 20 3

.Let us compute C = AB. First, determine the size of C.

A B = C2× 3 3× 2 2× 2

Therefore, C is a 2× 2 matrix. Write C as a blank 2× 2 matrix

C =

· ¸and compute, one by one, the elements of C.

c11 = Row1(A)Col1(B) =£1 2 0

¤140

= 1 · 1 + 2 · 4 + 0 · 0 = 9,so

C =

·9

¸

c12 = Row1(A)Col2(B) =£1 2 0

¤023

= 1 · 0 + 2 · 2 + 0 · 3 = 4,so

C =

·9 4

¸

c21 = Row2(A)Col1(B) =£3 −1 2

¤140

= 3 · 1 + (−1) · 4 + 2 · 0 = −1,so

C =

·9 4−1

¸

c22 = Row2(A)Col2(B) =£3 −1 2

¤023

= 3 · 0 + (−1) · 2 + 2 · 3 = 4,so

C =

·9 4−1 4

¸

Page 21: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 18

Therefore, ·1 2 03 −1 2

¸1 04 20 3

= · 9 4−1 4

¸.

The technique for calculating the product of two matrices described aboveis something you have to learn to do "in head", not on the paper. Giventwo matrices, you first determine the size of the product and write a blankmatrix: ·

1 2 03 −1 2

¸1 04 20 3

= · ¸.

Then you compute, one by one, the elements of the product matrix and fillin the blank matrix: ·

1 2 03 −1 2

¸1 04 20 3

= · 9 4−1 4

¸.

Example 2. Let

A =

1 30 −1−1 23 0

, B =

1 1−2 32 −10 1

, C =

·2 0 13 1 0

¸

Then the product AB is not defined because the sizes do not match:

A B = AB4× 2 4× 2 not defined

For AC, we haveA C = AC4× 2 2× 3 4× 3

so the product AC is defined. We write AC as a blank 4× 3 matrix:1 30 −1−1 23 0

·2 0 13 1 0

¸=

We compute, one by one, the elements of the product matrix and fill in theblank matrix:

1 30 −1−1 23 0

·2 0 13 1 0

¸=

11 3 1−3 −1 04 2 −16 0 3

Page 22: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 19

Example 3. Let

A =

·1 2−1 3

¸, B =

·2 10 1

¸.

Then

AB =

·1 2−1 3

¸ ·2 10 1

¸=

·2 3−2 2

¸BA =

·2 10 1

¸ ·1 2−1 3

¸=

·1 7−1 3

¸Thus AB 6= BA.

3.3 Identity Matrix

The identity matrix of order n is the matrix

In =

1 0 · · · 00 1 · · · 0....... . .

...0 0 · · · 1

We also denote In simply by I.

Example 4.

I2 =

·1 00 1

¸, I3 =

1 0 00 1 00 0 1

, I4 =

1 0 0 00 1 0 00 0 1 00 0 0 1

Example 4. Let

A =

·1 −2 52 0 3

¸.

Let us compute the product of A and the identity matrix:

AI =

·1 −2 52 0 3

¸1 0 00 1 00 0 1

= ·1 −2 52 0 3

¸= A

Similarly,

IA =

·1 00 1

¸ ·1 −2 52 0 3

¸=

·1 −2 52 0 3

¸= A

This holds for any matrix: if A is an m× n matrix, thenAIn = ImA = A.

Page 23: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 20

3.4 Properties of Matrix Operations

We will list some basic properties of the matrix operations.

1. Let A, B and C be m× n matrices. Then(a) A+B = B +A

(b) A+ (B + C) = (A+B) + C

2. (a) If A, B and C are of the appropriate sizes, then

A(BC) = (AB)C

(b) If A, B and C are of the appropriate sizes, then

A(B + C) = AB +AC

(c) If A, B and C are of the appropriate sizes, then

(A+B)C = AC +BC

(d) Generally,AB 6= BA

3. If c and d are real numbers and A and B are matrices, then

(a) c(dA) = (cd)A

(b) (c+ d)A = cA+ dA

(c) c(A+B) = cA+ cB

(d) A(cB) = c(AB) = (cA)B

Page 24: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 21

4 Solutions of Linear Systems of EquationsThe systematic approach of the method of elimination for solving systems oflinear equations provides another method of solution that involves a simpli-fied notation using matrices.

4.1 Matrix Representation of a System of Linear Equa-tions

Example 1. The linear system

2x + 3y = 1,x + y = 0.

can be represented by a following matrix

A =

·2 31 1

¯̄̄̄10

¸We call A the augmented matrix of the given system.

Example 2. Suppose that

A =

1 0 00 1 00 0 1

¯̄̄̄¯̄ 2−13

is the augmented matrix representing a linear system in three variables x, yand z. Then we read from the matrix

1 · x + 0 · y + 0 · z = 2,0 · x + 1 · y + 0 · z = −1,0 · x + 0 · y + 1 · z = 3,

that isx = 2,

y = −1,z = 3.

Therefore, the augmented matrix is in the form which represents the solution.The system has the unique solution.

Example 3. Suppose that

A =

1 0 −10 1 20 0 0

¯̄̄̄¯̄ 340

Page 25: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 22

is the augmented matrix representing a linear system in three variables x, yand z. Then we read from the matrix

1 · x + 0 · y + (−1) · z = 3,0 · x + 1 · y + 2 · z = 4,0 · x + 0 · y + 0 · z = 0,

that isx− z = 3y + 2z = 4

0 = 0.

We conclude that the system has infinitely many solutions. The generalsolution is

x = 3 + z

y = 4− 2z,where z is any real number.

4.2 Reduced Row Echelon Form of a Matrix

For solving a linear system, we transform the augmented matrix into a formfrom which the solution can easily be found (see Examples 2 and 3).

A first nonzero entry in a row is called the pivot.

Example 4. Let

A =

2 1 −10 0 −30 0 0

ThenThe pivot in Row1 is 2The pivot in Row2 is -3There is no pivot in Row3

An m × n matrix is said to be in reduced row echelon form when itsatisfies the following properties:

1. All pivots are equal to 1.

2. All entries above and below a pivot are zero.

3. The pivot in each row after the first row appears to the right of thepivot in any row above.

Page 26: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 23

4. All rows consisting entirely of zeros, if any, are at the bottom of thematrix.

Example 5. Determine which of the following matrices are in reduced rowechelon form:

A =

1 0 30 1 20 0 0

¯̄̄̄¯̄ −120

A is in reduced row echelon form.

B =

·3 0 10 1 2

¸B is not in reduced row echelon form because the pivot in Row1 is not equalto 1.

C =

·0 1 21 0 3

¯̄̄̄50

¸C is not in reduced row echelon form because the pivot in Row2 is not to theright of the pivot in Row1.

D =

1 2 00 0 10 0 0

D is in reduced row echelon form.

E =

1 2 10 1 00 0 0

E is not in reduced row echelon form because not all the entries above thepivot in Row2 are zero.

4.3 Solving Linear Systems

To solve a linear system, we transform the augmented matrix in reduced rowechelon form, by performing the following row operations

1. Interchange two rows.

2. Multiply a row by a nonzero constant.

3. Add a multiple of one row to another.

Page 27: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 24

Recall that each row represents an equation. Row operations are equivalent,respectively, to interchanging two equations, multiplying an equation by anonzero constant and adding a multiple of one equation to another. Whenreduced row echelon form of the augmented matrix is obtained, we can readthe solution.

Steps for solving a linear system

Step 1. Form the augmented matrix of the system.

Step 2. Using row operations, transform the matrix to reduced rowechelon form.

Step 3. Read the solution.

This method is called the Gauss-Jordan reduction.

Example 6. Solve the system

2x + 3y = 1,x + y = 0.

by Gauss-Jordan reduction.Solution. The augmented matrix of the system is·

2 31 1

¯̄̄̄10

¸The pivot in Row1 is 2. To obtain the pivot in Row1 to be equal 1, weinterchange Row1 and Row2: ·

1 12 3

¯̄̄̄01

¸In reduced row echelon form, all entries above and below the pivot are zero.·

pivot →transform to 0 →

1 12 3

¯̄̄̄01

¸To obtain 0 below the pivot, we replace Row2 with Row2 − 2 ·Row1

Row2 − 2 ·Row1·

1 12− 2 · 1 3− 2 · 1

¯̄̄̄0

1− 2 · 0¸=

·1 10 1

¯̄̄̄01

¸Now, the pivot in Row2 is 1 and it is to the right of the pivot in Row1. Inreduced row echelon form, all entries above and below the pivot are zero.·

1 transform to 0 → 10 pivot → 1

¯̄̄̄01

¸

Page 28: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 25

To obtain 0 above the pivot, we replace Row1 with Row1 −Row2Row1 −Row2

·1− 0 1− 10 1

¯̄̄̄0− 11

¸=

·1 00 1

¯̄̄̄ −11

¸The matrix ·

1 00 1

¯̄̄̄ −11

¸is in reduced row echelon form and we read the solution

x = −1y = 1.

Example 7. Solve the system

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

by Gauss-Jordan reduction.Solution. The augmented matrix of the system is·

1 2 −32 1 −3

¯̄̄̄ −44

¸.

The pivot in Row1 is 1. To obtain 0 below the pivot, we replace Row2 withRow2 − 2 ·Row1

Row2 − 2 ·Row1·

1 2 −32− 2 · 1 1− 2 · 2 −3− 2 · (−3)

¯̄̄̄ −44− 2 · (−4)

¸=

·1 2 −30 −3 3

¯̄̄̄ −412

¸.

The pivot in Row2 is −3. To obtain 1, we multiply Row2 by −13.

−13Row2

·1 2 −30 1 −1

¯̄̄̄ −4−4¸.

To obtain 0 above the pivot, we replace Row1 with Row1 − 2 ·Row2Row1 − 2 ·Row2

·1 0 −10 1 −1

¯̄̄̄4−4¸.

The matrix is in reduced row echelon form. We read the equations:

x− z = 4y − z = −4

Page 29: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 26

Therefore, the general solution to the system is

x = z + 4

y = z − 4where z is any real number. This means that the system has infinitely manysolutions.

Example 8. Solve the system

x + y + 3z = 3,−x + y − z = 1,2x + 4z = 1

by Gauss-Jordan reduction.Solution. The augmented matrix of the system is 1 1 3

−1 1 −12 0 4

¯̄̄̄¯̄ 311

.The pivot in Row1 is 1. To obtain 0 below the pivot, we do the following

Row2 +Row1Row3 − 2 ·Row1

1 1 30 2 20 −2 −2

¯̄̄̄¯̄ 34−5

The pivot in Row2 is 2. To obtain 1, we multiply Row2 by 1

2.

12Row2

1 1 30 1 10 −2 −2

¯̄̄̄¯̄ 32−5

To obtain zeros above and below the pivot, we do the following

Row1 −Row2

Row3 + 2 ·Row2

1 0 20 1 10 0 0

¯̄̄̄¯̄ 12−1

We read from Row3

0 · x+ 0 · y + 0 · z = −1,that is,

0 = −1.We conclude that the given linear system has no solution.

Page 30: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 27

5 The Inverse of a Matrix

5.1 Definition of the Inverse of a Matrix

Let A be an n× n matrix. An n× n matrix B is is called an inverse of A ifAB = BA = In.

If an inverse of matrix A exists, it is unique and we denote it by A−1. There-fore,

AA−1 = A−1A = In.

Example 1. Let

A =

·2 10 1

¸.

Show that

B =

·12−12

0 1

¸is the inverse of A.Solution. We have to show that

AB = BA = I.

We multiply AB and obtain

AB =

·2 10 1

¸ ·12−12

0 1

¸=

·1 00 1

¸Similarly,

BA =

·12−12

0 1

¸ ·2 10 1

¸=

·1 00 1

¸Example 2. Find the inverse of the matrix

A =

·3 12 1

¸.

Solution. Assuming that A has the inverse, denote it by

X =

·x1 x2x3 x4

¸.

ThenAX = I,

Page 31: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 28·3 12 1

¸ ·x1 x2x3 x4

¸=

·1 00 1

¸.

Performing the multiplication on the left yields·3x1 + x3 3x2 + x42x1 + x3 2x2 + x4

¸=

·1 00 1

¸.

This matrix equation can be written as the following system of four equationsin four unknowns

3x1 + x3 = 12x1 + x3 = 0

3x2 + x4 = 02x2 + x4 = 1

(3)

By solving the system, we find the solution

x1 = 1, x2 = −1, x3 = −2, x4 = 3.

Thus the inverse of A is

A−1 =·1 −1−2 3

¸.

5.2 A Practical Method for Finding the Inverse

We will use Example 2 to describe a practical method for finding A−1. Thesystem (1.3) of four equations in four unknowns can be written as two systems

(a)

(3x1 + x3 = 1

2x1 + x3 = 0b)

(3x2 + x4 = 0

2x2 + x4 = 1

The augmented matrices are

(a)

·3 12 1

¯̄̄̄10

¸(b)

·3 12 1

¯̄̄̄01

¸The matrix A appears in both (a) and (b). We can solve systems (a) and (b)simultaneously, by performing Gauss-Jordan reduction on the matrix·

3 12 1

¯̄̄̄1 00 1

¸Note that this is the matrix [A|I]. Let us do Gauss-Jordan reduction.

13Row1

·1 1

3

2 1

¯̄̄̄130

0 1

¸

Page 32: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 29

Row2 − 2 ·Row1·1 1

3

0 13

¯̄̄̄13

0−231

¸

3 ·Row2·1 1

3

0 1

¯̄̄̄13

0−2 3

¸Row1 − 1

3Row2

·1 00 1

¯̄̄̄1 −1−2 3

¸The matrix is in reduced row echelon form and we read

A−1 =·1 −1−2 3

¸.

Steps for finding the inverse of a matrix

Step 1. Write the augmented matrix [A|I].Step 2. Using Gauss-Jordan reduction, transform [A|I] to reduced row

echelon form.

Step 3. If the resulting matrix is of the form [I|B], then B is the inverseof A. Otherwise, A has no inverse.

Example 3. Find the inverse of the matrix A, if it exists.

A =

·1 23 6

¸Solution. As in Example 2, we form the matrix

[A|I] =·1 23 6

¯̄̄̄1 00 1

¸and perform Gauss-Jordan reduction.

Row2 − 3Row1·1 20 0

¯̄̄̄1 0−3 1

¸The zeros in Row2 tell us we cannot get the identity matrix. Therefore, thematrix A have no inverse.

Example 4. Find the inverse of the matrix A, if it exists.

A =

2 1 11 2 11 1 0

Page 33: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 30

Solution. We form the matrix

[A|I] =2 1 11 2 11 1 0

¯̄̄̄¯̄ 1 0 00 1 00 0 1

and perform Gauss-Jordan reduction.First, we interchange Row1 and Row2.

Row2Row1

1 2 12 1 11 1 0

¯̄̄̄¯̄ 0 1 01 0 00 0 1

Row2 − 2Row1Row3 −Row1

1 2 10 −3 −10 −1 −1

¯̄̄̄¯̄ 0 1 01 −2 00 −1 1

−Row3Row2

1 2 10 1 10 −3 −1

¯̄̄̄¯̄ 0 1 00 1 −11 −2 0

Row1 − 2Row2

Row3 + 3Row2

1 0 −10 1 10 0 2

¯̄̄̄¯̄ 0 −1 20 1 −11 1 −3

12Row3

1 0 −10 1 10 0 1

¯̄̄̄¯̄ 0 −1 20 1 −112

12−32

Row1 +Row3Row2 −Row3

1 0 00 1 00 0 1

¯̄̄̄¯̄

12−12

12−1

212

12

12

12−32

Reduced row echelon form is of the type [I|B] and we read

A−1 = B =

12−12

12−1

212

12

12

12−32

5.3 Solving a Linear System Using Inverses

Leta11x1 + a12x2 + · · ·+ a1nxn = b1,a21x1 + a22x2 + · · ·+ a2nxn = b2,

...

am1x1 + am2x2 + · · ·+ amnxn = bm.

(4)

Page 34: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 31

be a system of linear equation. We define the following matrices

A =

a11 a12 · · · a1na21 a22 · · · a2n...

... · · · ...am1 am2 · · · amn

, X =

x1x2...xn

, B =

b1b2...bm

.Then the system (1.4) can be written as a matrix equation

AX = B.

Suppose that m = n. Then A is a square matrix of order n. If A−1 exists,then the system (1.4) have the unique solution

X = A−1B.

Example 5. Consider the system

2x + y + z = 3,x + 2y + z = 2,x + y = 1.

Let

A =

2 1 11 2 11 1 0

, X =

xyz

, B =

321

.Then the system can be written as

AX = B.

According to Example 4, A has the inverse and

A−1 =

12−12

12−1

212

12

12

12−32

.Therefore, the system has the unique solution

X = A−1B,xyz

= 1

2−12

12−1

212

12

12

12−32

321

=101

.The solution is

x = 1, y = 0, z = 1.

Page 35: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 32

6 DeterminantsLet A be an n×n matrix. Then the determinant of A, denoted by det(A),is a number associated to the matrix A. You may find the definition ofthe determinant in a Linear Algebra textbook. We will describe how thedeterminant can be computed for 2× 2 matrices and 3× 3 matrices.

6.1 Determinant of a 2× 2 MatrixLet

A =

·a11 a12a21 a22

¸be a 2× 2 matrix. Then the determinant of A is the number

det(A) =

¯̄̄̄a11 a12a21 a22

¯̄̄̄= a11a22 − a12a21

Observe that we introduce double notation for the determinant:

det(A)

as well as ¯̄̄̄a11 a12a21 a22

¯̄̄̄denote the number

a11a22 − a12a21For memorizing the formula, note that a11a22 is the product of elements onthe diagonal

a11 a12&

a21 a22

and a12a21 is the product of elements on the second diagonal

a11 a12.

a21 a22

Example 1. Let

A =

·1 32 −4

¸.

Compute det(A).

Page 36: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 33

Solution.det(A) = 1 · (−4)− 3 · 2 = −4− 6 = −10

Example 2. Compute ¯̄̄̄−2 1−1 3

¯̄̄̄.

Solution. ¯̄̄̄−2 1−1 3

¯̄̄̄= −2 · 3− 1 · (−1) = −6 + 1 = −5.

6.2 Determinant of a 3× 3 MatrixLet

A =

a11 a12 a13a21 a22 a23a31 a32 a33

be a 3× 3 matrix. Then the determinant of A is the number

det(A) =

¯̄̄̄¯̄a11 a12 a13a21 a22 a23a31 a32 a33

¯̄̄̄¯̄ = a11a22a33 + a12a23a31 + a13a21a32

−a11a23a32 − a12a21a33 − a13a22a31For memorizing the formula, rewrite, next to the matrix A, the first and thesecond column: a11 a12 a13

a21 a22 a23a31 a32 a33

a11 a12a21 a22a31 a32

Then, det(A) is the sum of the products of elements on diagonals¯̄̄̄¯̄̄̄¯̄a11 a12 a13

& &a21 a22 a23

&a31 a32 a33

¯̄̄̄¯̄̄̄¯̄

a11 a12&

a21 a22& &

a31 a32

a11a22a33 + a12a23a31 + a13a21a32

minus products of elements on second diagonals¯̄̄̄¯̄̄̄¯̄a11 a12 a13

.a21 a22 a23

. .a31 a32 a33

¯̄̄̄¯̄̄̄¯̄

a11 a12. .

a21 a22.

a31 a32

Page 37: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 34

−a13a22a31 − a11a23a32 − a12a21a33Example 3. Let

A =

3 −1 02 1 04 −2 1

.Compute det(A).

Solution.

det(A) =

¯̄̄̄¯̄3 −1 02 1 04 −2 1

¯̄̄̄¯̄ 3 −12 14 −2

We use the scheme described above: det(A) is the sum of the products ofelements on diagonals¯̄̄̄

¯̄̄̄¯̄3 −1 0& &

2 1 0&

4 −2 1

¯̄̄̄¯̄̄̄¯̄

3 −1&

2 1& &

4 −23 · 1 · 1 + (−1) · 0 · 4 + 0 · 2 · (−2)

minus products of elements on second diagonals¯̄̄̄¯̄̄̄¯̄3 −1 0

.2 1 0. .

4 −2 1

¯̄̄̄¯̄̄̄¯̄

3 −1. .

2 1.

4 −2−0 · 1 · 4− 3 · 0 · (−2)− (−1) · 2 · 1det(A) = 3 + 0 + 0− 0− 0 + 2 = 5

Example 4. Evaluate the following determinant¯̄̄̄¯̄ 2 0 11 3 2−1 0 1

¯̄̄̄¯̄ .

Solution. ¯̄̄̄¯̄ 2 0 11 3 2−1 0 1

¯̄̄̄¯̄ 2 01 3−1 0

= 6 + 0 + 0− (−3)− 0− 0 = 9

Page 38: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 35

7 Cofactor Expansion and ApplicationsIn previous section, we described how to compute determinants of 2× 2 and3 × 3 matrices. Using cofactor expansion, we can compute determinants ofhigher order.

7.1 Cofactors

Let A = [aij ] be an n×n matrix. LetMij be the (n− 1)× (n− 1) submatrixof A obtained by deleting the ith row and jth column of A. The cofactorAij of aij is defined as

Aij = (−1)i+jdet(Mij).

Example 1. Let

A =

3 −1 24 5 67 1 2

Compute cofactors A11 and A23.

Solution. To compute A11, we first have to find the matrix M11. It is thematrix obtained by deleting the first row and the first column of A,

M11 =

·5 61 2

¸.

Now,

A11 = (−1)1+1det(M11) =

¯̄̄̄5 61 2

¯̄̄̄= 5 · 2− 6 · 1 = 10− 6 = 4.

Similarly,

A23 = (−1)2+3det(M23) = −¯̄̄̄3 −17 1

¯̄̄̄= −10.

Page 39: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 36

7.2 Cofactor Expansion

Let A = [aij] be an n× n matrix. Then for each 1 ≤ i ≤ n,det(A) = ai1Ai1 + ai2Ai2 + · · ·+ ainAin

(expansion of det(A) about Rowi) and for each 1 ≤ j ≤ n,det(A) = a1jA1j + a2jA2j + · · ·+ anjAnj

(expansion of det(A) about Colj).

Example 2. Let

A =

2 −3 42 1 30 −2 3

The determinant of A can be computed using the formula for 3× 3 determi-nant, but we will compute it using cofactor expansion about Col1.

det(A) = a11A11 + a21A21 + a31A31

= 2 · (−1)1+1¯̄̄̄1 3−2 3

¯̄̄̄+ 2 · (−1)2+1

¯̄̄̄−3 4−2 3

¯̄̄̄+ 0

= 2 · 9 + (−2) · (−1) = 20

Using cofactor expansion, we can compute determinants of higher order.Example 3. Let

A =

4 1 0 00 1 2 0−1 0 0 20 1 1 3

We will compute det(A) using cofactor expansion about Row1.

det(A) = a11A11 + a12A12 + a13A13 + a14A14

= 4 · (−1)1+1 ·¯̄̄̄¯̄1 2 00 0 21 1 3

¯̄̄̄¯̄+ 1 · (−1)1+2 ·

¯̄̄̄¯̄ 0 2 0−1 0 20 1 3

¯̄̄̄¯̄+ 0 + 0

We compute two 3× 3 determinants separately, and obtain¯̄̄̄¯̄1 2 00 0 21 1 3

¯̄̄̄¯̄ = 2,

¯̄̄̄¯̄ 0 2 0−1 0 20 1 3

¯̄̄̄¯̄ = 6.

Thendet(A) = 4 · 2− 1 · 6 = 2.

Page 40: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 37

7.3 The Inverse of a Matrix

Let A = [aij] be an n× n matrix. The adjoint matrix of A

adjA =

A11 A21 · · · An1A12 A22 · · · An2...

... · · · ...A1n A2n · · · Ann

is the matrix whose i, jth element is the cofactor Aji of aij.The matrix A has the inverse if and only if det(A) 6= 0 and the inverse

can be computed by the formula

A−1 =1

det(A)adjA.

Example 4. Let

A =

·1 −13 1

¸Then

det(A) = 4,

so A has the inverse. Let us compute it by the formula

A−1 =1

det(A)adjA.

First, we have to compute all cofactors.

A11 = (−1)1+1 · 1 = 1 A12 = (−1)1+2 · 3 = −3A21 = (−1)2+1 · (−1) = 1 A22 = (−1)2+2 · 1 = 1.

Then

adjA =

·A11 A21A12 A22

¸=

·1 1−3 1

¸and

A−1 =1

det(A)adjA =

1

4

·1 1−3 1

¸=

·14

14−3

414

¸

Page 41: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 38

7.4 Properties of Determinants

Let A and B be n× n matrices.1. det(AT ) = det(A)

2. det(AB) = det(A)det(B)

3. det(In) = 1

4. If det(A) 6= 0, then A has the inverse and

A−1 =1

det(A)adjA.

5. We say that A is a diagonal matrix, if every term off the main diag-onal is zero,

A =

a11 0 0 · · · 00 a22 0 · · · 00 0 a33 · · · 0...

......

. . ....

0 0 0 · · · ann

.If A is a diagonal matrix, then the determinant of A is the product ofelements on the diagonal,

det(A) = a11a22a33 · · · ann.6. If two rows (columns) of A are equal, then det(A) = 0.

7. If a row (column) of A consists entirely of zeros, then det(A) = 0.

8. If B is obtained from A by multiplying a row (column) of A by a realnumber c, then

det(B) = c · det(A).9. If the matrix B obtained from A by interchanging two rows (columns)of A, then

det(B) = −det(A).10. If the matrix B is obtained from A by adding a multiple of one row to

another, thendet(B) = det(A).

Similarly, if the matrix B is obtained from A by adding a multiple ofone column to another, then

det(B) = det(A).

Page 42: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 39

Example 5. Compute determinants of the following matrices:a)

A =

2 0 00 −3 00 0 1

This is a diagonal matrix, so we may compute det(A) by rule 5:

det(A) = 2 · (−3) · 1 = −6.

b)

B =

1 7 151 7 152 31 1

Two rows of B are equal, so by rule 6:

det(B) = 0.

c)

C =

8 7 0 151 12 0 −152 31 0 11−33 2 0 3

A column of C consists entirely of zeros, so by rule 7:

det(C) = 0.

d)

D =

1 2 33 6 92 1 1

By rule 8,

det(D) = 3

¯̄̄̄¯̄1 2 31 2 32 1 1

¯̄̄̄¯̄ = (rule 6) = 0.

Page 43: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 40

8 Vectors

8.1 Vectors in the Plane

We define a coordinate system in the plane in the following way: we fixtwo perpendicular lines, which we call x-axis and y-axis. The point ofintersection is called the origin and denoted by O. At each of axes, we fixthe unit of the length. If P is a point in the plane, we associate to it anordered pair of real numbers (x, y) in a usual way. We call x and y thecoordinates of P and write P (x, y).

y

2_ _ _ _ _ _ _ _ _ _ _ _ _ P(3,2)

1_

| | | O 1 2 3 x

Figure 1.

The set of all ordered pairs of real numbers is denoted by R2. There-fore, by choosing a coordinate system, we define one-to-one correspondencebetween the points in the plane and R2.

A 2-vector u is a 2× 1 matrix

u =

·xy

¸.

If u =·xy

¸is a 2-vector, we may represent it in the plane by the directed

line segment with the initial point at the origin O(0, 0) and terminal pointat P (x, y). The directed line segment from O to P is denoted by ~OP ; O iscalled its tail and P its head. (See Figure 2.)

Page 44: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 41

y

2 _ P(3,2)

1 _ u

| | | O 1 2 3 x

Figure 2. Representing the vector u =·32

¸in the plane

as the directed line segment ~OP .

If P (x1, y1) and Q(x2, y2) are points in the plane, then the directed linesegment ~PQ corresponds to the vector

u =

·x2 − x1y2 − y1

¸y Q(2,3)

2 _ u

1 _ P (-1, 1)

| | | O 1 2 3 x

Figure 3. Representing the vector u =·32

¸in the plane

as the directed line segment ~PQ, where P (−1, 1), Q(2, 3).

Example 1. Let P (2,−2), Q(3, 1). Then

~PQ =

·3− 2

1− (−2)¸=

·13

¸

Let u =·xy

¸be a 2-vector. The length or magnitude of u is

||u|| =px2 + y2.

Page 45: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 42

If P (x1, y1) and Q(x2, y2) are points in the plane, then the length of ~PQ is

|| ~PQ|| =p(x2 − x1)2 + (y2 − y1)2.

Example 2. Let P (2,−2), Q(3, 1). Then

|| ~PQ|| =p(3− 2)2 + (1− (−2))2 =

√10.

Vectors in the plane are defined as 2 × 1 matrices and vector additionand scalar multiplication are defined as addition and scalar multiplicationfor matrices. More precisely, if

u =

·x1y1

¸, v =

·x2y2

¸are 2-vectors, then

u+ v =

·x1 + x2y1 + y2

¸.

If c is a scalar (a real number), then

cu =

·cx1cy1

¸.

Example 3. Let

u =

·−32

¸, v =

·5−1¸.

Then

u+ v =

·−3 + 52− 1

¸=

·21

¸,

5u =

·−1510

¸.

If u and v are 2-vectors, then the dot product of u and v is the number

u · v = uTv,

where uT is the transpose of u. More precisely, if u =·x1y1

¸, v =

·x2y2

¸,

then

u · v = uTv = £x1 y1¤ ·x2y2

¸= x1x2 + y1y2.

Page 46: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 43

Therefore,u · v = x1x2 + y1y2.

Example 3. Let u =·1−1¸, v =

·3−2¸. Then

u · v = 1 · 3 + (−1)(−2) = 5.

Let u and v be 2-vectors. Let ϕ be the angle between u and v. Then

cos(ϕ) =u · v

||u|| ||v||

Example 4. Find the angle between vectors u =·05

¸, v =

·33

¸.

Solution.u · v = 15,

||u|| = √0 + 25 = 5,||v|| = √9 + 9 =

√18 = 3

√2.

Thencos(ϕ) =

u · v||u|| ||v|| =

15

5 · 3√2 =1√2,

soϕ =

π

4.

8.2 n-Vectors

A n-vector u is an n× 1 matrix

u =

u1u2...un

.Vector addition and scalar multiplication are defined as addition and scalarmultiplication for matrices. More precisely, if

u =

u1u2...un

, v =

v1v2...vn

Page 47: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 44

are 2-vectors, then

u+ v =

u1 + v1u2 + v2...

un + vn

.If c is a scalar (a real number), then

cu =

cu1cu2...cun

.

Example 5. Let

u =

2−310

, v =

1−12−3

.Then

u+ v =

3−43−3

, 4u =

8−1240

.

Let u =

u1u2...un

be a n-vector. The length or magnitude of u is

||u|| =qu21 + u

22 + · · ·+ u2n.

Example 6. Let

u =

15−1−2

.Then

||u|| =p12 + 52 + (−1)2 + (−2)2 = √1 + 25 + 1 + 4 =

√31.

Page 48: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 45

If u and v are n-vectors, then the dot product of u and v is the number

u · v = uTv,

where uT is the transpose of u. More precisely, if u =

u1u2...un

, v =

v1v2...vn

,then

u · v = uTv = £u1 u2 · · · un¤v1v2...vn

= u1v1 + u2v2 + · · ·+ unvn.Therefore,

u · v = u1v1 + u2v2 + · · ·+ unvn.

Example 6. Let

u =

2−13

, v =

−230

.Then

u · v = 2 · (−2) + (−1) · 3 + 3 · 0 = −4− 3 = −7.

Let u and v be n-vectors. The angle between u and v is defined as theunique real number ϕ, 0 ≤ ϕ ≤ π, such that

cos(ϕ) =u · v

||u|| ||v||

Example 7. Find the cosine of the angle between vectors u =

0511

and

v =

3−301

.Solution.

u · v = −14,

Page 49: UNIT 1. LINEAR ALGEBRA (3 credits)mapmf.pmfst.unist.hr/~vlasta/mathematics/Unit 1/Linear algebra.pdf · Contents Linear Algebra 1 1 LinearSystems.MethodofElimination..... 1 1.1 Systems

LINEAR ALGEBRA 46

||u|| = √0 + 25 + 1 + 1 =√27,

||v|| = √9 + 9 + 1 =√19.

Thencos(ϕ) =

u · v||u|| ||v|| =

−14√27 ·√19 = −0.618.