Top Banner
ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling
53

ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Dec 27, 2015

Download

Documents

Horatio Moore
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

ENM 503 Block 2Lesson 7 ndash Matrix Methods

Everything you would want to know about The Matrix and

then somehellip

this way

Narrator Charles Ebeling

Applications Solving systems of linear equations Regression analysis Markov processes Linear programming Nonlinear optimization Queuing Reliability Inventory ndash MRP systems

These only begin to show the potential

of the matrix

Matrix and Vectors

A matrix is a rectangular array of elements which are operated on as a single object The elements are often numbers but could be any mathematical object provided that it can be added and multiplied with acceptable properties

Vectors are strongly related to matrices they can be considered as a matrix having only a single row (row vector) or a single column (column vector)

Examples

1

2

3

11 12 13

21 22 23

31 32 33

34 65

12 23

8 0

y

a b c d y

y

a a a

a a a

a a a

X Y

A B

X is a 1 x 4 row vector Y is a 3 x 1 column vector

A is a 3 x 3 matrix and B is a 3 x 2 matrix

An m x n Matrix

11 1

1

n

ij

m mn

a a

a

a a

A

Vector Matrix Operations Vectors and matrices can be added (or subtracted) and

multiplied when their dimensions are in agreement

To add or subtract two vectors or two matrices having the same dimensions just add their corresponding elements

A plusmn B = aij plusmn bij

To multiply two vectors multiply corresponding elements and add The result is a scalar (dot product) Both vectors must have the same number of elements

1

n

i ii

x y

XY

Vector Example

3 8 2 7 3 6 1 2

3 8 2 7 3 6 1 2 6 14 3 9

3 3 8 6 2 1 7 2 73x x x x

X Y

X Y

X Y

Example Matrix Addition and scalar multiplication

5 6 0 6 7 1

2 1 5 0 2 3

9 0 3 0 3 2

11 13 1

2 3 8

0 3 1

5 6 0

2 5

9 0 3

A B

A B B A

A scalar multiplication

Matrix Multiplication If A is an m x n matrix and B is an n x p matrix

then C = A x B is an m x p matrix where

The ij element of C is found by multiplying the ith row of A times the jth column of B (equivalent to a vector multiplication)

1

n

ij ik kjk

c a b

Example Matrix Multiplication

3 52 1 4

2 13 0 2

4 2

2 3 3 2

6 2 16 10 1 8 24 17

9 0 8 15 0 4 1 11

x x

x

A B

A B

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 2: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Applications Solving systems of linear equations Regression analysis Markov processes Linear programming Nonlinear optimization Queuing Reliability Inventory ndash MRP systems

These only begin to show the potential

of the matrix

Matrix and Vectors

A matrix is a rectangular array of elements which are operated on as a single object The elements are often numbers but could be any mathematical object provided that it can be added and multiplied with acceptable properties

Vectors are strongly related to matrices they can be considered as a matrix having only a single row (row vector) or a single column (column vector)

Examples

1

2

3

11 12 13

21 22 23

31 32 33

34 65

12 23

8 0

y

a b c d y

y

a a a

a a a

a a a

X Y

A B

X is a 1 x 4 row vector Y is a 3 x 1 column vector

A is a 3 x 3 matrix and B is a 3 x 2 matrix

An m x n Matrix

11 1

1

n

ij

m mn

a a

a

a a

A

Vector Matrix Operations Vectors and matrices can be added (or subtracted) and

multiplied when their dimensions are in agreement

To add or subtract two vectors or two matrices having the same dimensions just add their corresponding elements

A plusmn B = aij plusmn bij

To multiply two vectors multiply corresponding elements and add The result is a scalar (dot product) Both vectors must have the same number of elements

1

n

i ii

x y

XY

Vector Example

3 8 2 7 3 6 1 2

3 8 2 7 3 6 1 2 6 14 3 9

3 3 8 6 2 1 7 2 73x x x x

X Y

X Y

X Y

Example Matrix Addition and scalar multiplication

5 6 0 6 7 1

2 1 5 0 2 3

9 0 3 0 3 2

11 13 1

2 3 8

0 3 1

5 6 0

2 5

9 0 3

A B

A B B A

A scalar multiplication

Matrix Multiplication If A is an m x n matrix and B is an n x p matrix

then C = A x B is an m x p matrix where

The ij element of C is found by multiplying the ith row of A times the jth column of B (equivalent to a vector multiplication)

1

n

ij ik kjk

c a b

Example Matrix Multiplication

3 52 1 4

2 13 0 2

4 2

2 3 3 2

6 2 16 10 1 8 24 17

9 0 8 15 0 4 1 11

x x

x

A B

A B

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 3: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Matrix and Vectors

A matrix is a rectangular array of elements which are operated on as a single object The elements are often numbers but could be any mathematical object provided that it can be added and multiplied with acceptable properties

Vectors are strongly related to matrices they can be considered as a matrix having only a single row (row vector) or a single column (column vector)

Examples

1

2

3

11 12 13

21 22 23

31 32 33

34 65

12 23

8 0

y

a b c d y

y

a a a

a a a

a a a

X Y

A B

X is a 1 x 4 row vector Y is a 3 x 1 column vector

A is a 3 x 3 matrix and B is a 3 x 2 matrix

An m x n Matrix

11 1

1

n

ij

m mn

a a

a

a a

A

Vector Matrix Operations Vectors and matrices can be added (or subtracted) and

multiplied when their dimensions are in agreement

To add or subtract two vectors or two matrices having the same dimensions just add their corresponding elements

A plusmn B = aij plusmn bij

To multiply two vectors multiply corresponding elements and add The result is a scalar (dot product) Both vectors must have the same number of elements

1

n

i ii

x y

XY

Vector Example

3 8 2 7 3 6 1 2

3 8 2 7 3 6 1 2 6 14 3 9

3 3 8 6 2 1 7 2 73x x x x

X Y

X Y

X Y

Example Matrix Addition and scalar multiplication

5 6 0 6 7 1

2 1 5 0 2 3

9 0 3 0 3 2

11 13 1

2 3 8

0 3 1

5 6 0

2 5

9 0 3

A B

A B B A

A scalar multiplication

Matrix Multiplication If A is an m x n matrix and B is an n x p matrix

then C = A x B is an m x p matrix where

The ij element of C is found by multiplying the ith row of A times the jth column of B (equivalent to a vector multiplication)

1

n

ij ik kjk

c a b

Example Matrix Multiplication

3 52 1 4

2 13 0 2

4 2

2 3 3 2

6 2 16 10 1 8 24 17

9 0 8 15 0 4 1 11

x x

x

A B

A B

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 4: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Examples

1

2

3

11 12 13

21 22 23

31 32 33

34 65

12 23

8 0

y

a b c d y

y

a a a

a a a

a a a

X Y

A B

X is a 1 x 4 row vector Y is a 3 x 1 column vector

A is a 3 x 3 matrix and B is a 3 x 2 matrix

An m x n Matrix

11 1

1

n

ij

m mn

a a

a

a a

A

Vector Matrix Operations Vectors and matrices can be added (or subtracted) and

multiplied when their dimensions are in agreement

To add or subtract two vectors or two matrices having the same dimensions just add their corresponding elements

A plusmn B = aij plusmn bij

To multiply two vectors multiply corresponding elements and add The result is a scalar (dot product) Both vectors must have the same number of elements

1

n

i ii

x y

XY

Vector Example

3 8 2 7 3 6 1 2

3 8 2 7 3 6 1 2 6 14 3 9

3 3 8 6 2 1 7 2 73x x x x

X Y

X Y

X Y

Example Matrix Addition and scalar multiplication

5 6 0 6 7 1

2 1 5 0 2 3

9 0 3 0 3 2

11 13 1

2 3 8

0 3 1

5 6 0

2 5

9 0 3

A B

A B B A

A scalar multiplication

Matrix Multiplication If A is an m x n matrix and B is an n x p matrix

then C = A x B is an m x p matrix where

The ij element of C is found by multiplying the ith row of A times the jth column of B (equivalent to a vector multiplication)

1

n

ij ik kjk

c a b

Example Matrix Multiplication

3 52 1 4

2 13 0 2

4 2

2 3 3 2

6 2 16 10 1 8 24 17

9 0 8 15 0 4 1 11

x x

x

A B

A B

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 5: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

An m x n Matrix

11 1

1

n

ij

m mn

a a

a

a a

A

Vector Matrix Operations Vectors and matrices can be added (or subtracted) and

multiplied when their dimensions are in agreement

To add or subtract two vectors or two matrices having the same dimensions just add their corresponding elements

A plusmn B = aij plusmn bij

To multiply two vectors multiply corresponding elements and add The result is a scalar (dot product) Both vectors must have the same number of elements

1

n

i ii

x y

XY

Vector Example

3 8 2 7 3 6 1 2

3 8 2 7 3 6 1 2 6 14 3 9

3 3 8 6 2 1 7 2 73x x x x

X Y

X Y

X Y

Example Matrix Addition and scalar multiplication

5 6 0 6 7 1

2 1 5 0 2 3

9 0 3 0 3 2

11 13 1

2 3 8

0 3 1

5 6 0

2 5

9 0 3

A B

A B B A

A scalar multiplication

Matrix Multiplication If A is an m x n matrix and B is an n x p matrix

then C = A x B is an m x p matrix where

The ij element of C is found by multiplying the ith row of A times the jth column of B (equivalent to a vector multiplication)

1

n

ij ik kjk

c a b

Example Matrix Multiplication

3 52 1 4

2 13 0 2

4 2

2 3 3 2

6 2 16 10 1 8 24 17

9 0 8 15 0 4 1 11

x x

x

A B

A B

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 6: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Vector Matrix Operations Vectors and matrices can be added (or subtracted) and

multiplied when their dimensions are in agreement

To add or subtract two vectors or two matrices having the same dimensions just add their corresponding elements

A plusmn B = aij plusmn bij

To multiply two vectors multiply corresponding elements and add The result is a scalar (dot product) Both vectors must have the same number of elements

1

n

i ii

x y

XY

Vector Example

3 8 2 7 3 6 1 2

3 8 2 7 3 6 1 2 6 14 3 9

3 3 8 6 2 1 7 2 73x x x x

X Y

X Y

X Y

Example Matrix Addition and scalar multiplication

5 6 0 6 7 1

2 1 5 0 2 3

9 0 3 0 3 2

11 13 1

2 3 8

0 3 1

5 6 0

2 5

9 0 3

A B

A B B A

A scalar multiplication

Matrix Multiplication If A is an m x n matrix and B is an n x p matrix

then C = A x B is an m x p matrix where

The ij element of C is found by multiplying the ith row of A times the jth column of B (equivalent to a vector multiplication)

1

n

ij ik kjk

c a b

Example Matrix Multiplication

3 52 1 4

2 13 0 2

4 2

2 3 3 2

6 2 16 10 1 8 24 17

9 0 8 15 0 4 1 11

x x

x

A B

A B

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 7: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Vector Example

3 8 2 7 3 6 1 2

3 8 2 7 3 6 1 2 6 14 3 9

3 3 8 6 2 1 7 2 73x x x x

X Y

X Y

X Y

Example Matrix Addition and scalar multiplication

5 6 0 6 7 1

2 1 5 0 2 3

9 0 3 0 3 2

11 13 1

2 3 8

0 3 1

5 6 0

2 5

9 0 3

A B

A B B A

A scalar multiplication

Matrix Multiplication If A is an m x n matrix and B is an n x p matrix

then C = A x B is an m x p matrix where

The ij element of C is found by multiplying the ith row of A times the jth column of B (equivalent to a vector multiplication)

1

n

ij ik kjk

c a b

Example Matrix Multiplication

3 52 1 4

2 13 0 2

4 2

2 3 3 2

6 2 16 10 1 8 24 17

9 0 8 15 0 4 1 11

x x

x

A B

A B

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 8: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Example Matrix Addition and scalar multiplication

5 6 0 6 7 1

2 1 5 0 2 3

9 0 3 0 3 2

11 13 1

2 3 8

0 3 1

5 6 0

2 5

9 0 3

A B

A B B A

A scalar multiplication

Matrix Multiplication If A is an m x n matrix and B is an n x p matrix

then C = A x B is an m x p matrix where

The ij element of C is found by multiplying the ith row of A times the jth column of B (equivalent to a vector multiplication)

1

n

ij ik kjk

c a b

Example Matrix Multiplication

3 52 1 4

2 13 0 2

4 2

2 3 3 2

6 2 16 10 1 8 24 17

9 0 8 15 0 4 1 11

x x

x

A B

A B

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 9: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Matrix Multiplication If A is an m x n matrix and B is an n x p matrix

then C = A x B is an m x p matrix where

The ij element of C is found by multiplying the ith row of A times the jth column of B (equivalent to a vector multiplication)

1

n

ij ik kjk

c a b

Example Matrix Multiplication

3 52 1 4

2 13 0 2

4 2

2 3 3 2

6 2 16 10 1 8 24 17

9 0 8 15 0 4 1 11

x x

x

A B

A B

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 10: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Example Matrix Multiplication

3 52 1 4

2 13 0 2

4 2

2 3 3 2

6 2 16 10 1 8 24 17

9 0 8 15 0 4 1 11

x x

x

A B

A B

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 11: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Properties of Matrix Operations

A (BC) = (AB) C

A (B+C) = AB + AC

(B+C) A = BA + CA

however A B B A (both are defined only if A and Bare n x n matrices)

and A A = A2 (only if a square matrix ie dimension n x n)

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 12: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

An interesting sidelight

A B = 0 does not necessarily imply that A = 0 or B = 0

For example1 1 1 1 0 0

2 2 1 1 0 0

Yes that is really

interesting

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 13: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

The Transpose

If A = ajk then At = akj

Each row of A becomes a column of At

2 32 1 4

1 03 0 2

4 2

2 4 7 2 4 7

4 8 1 4 8 1

7 1 5 7 1 5

t

t

A A

A A

If A = At then Ais a symmetric matrixie aij = aji

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 14: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Properties of the Transpose

(At)t = A

(A + B)t = At + Bt

(kA)t = k At

(AB)t = Bt At

Quick student exercise Show that AtA is symmetric using the above properties

Quick student exercise Create an example to illustrate each property

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 15: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Some Special Matrices1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 0 0 0 0 0 0 0 0 0

1 0

0 0 0 0 0 1 0 0 0 0 0 0

I Ο

The Identity Matrix (n x n) The Null Matrix

AI = IA = A OA = AO = O

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 16: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

More Special Matrices

11 12 1 11

22 21 22

33 33

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

n

nn mn nn

a a a a

a a a

a a

a a a

A B

Upper triangular Lower Triangular

all zeros

Now ainrsquot that special

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 17: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

The Diagonal Matrix

11

22

33

0 0 0 0 0

0 0 0 0 0

0

0

0 0 0 0 0 nn

a

a

a

a

A

main diagonal

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 18: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

The Determinant

For a square (n x n) matrix A the determinant is defined as a scalar computed from the sum of n terms of the form ( a1i a2j hellip anr) the sign alternating and depending upon the permutation

11

1 2all nterms

1

( )

in

i j nr

n nn

a a

a a a

a a

A

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 19: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

A 2 x 2 Determinant

det( ) | |

5 45 3 4 2 7

2 3

a bad bc

c d

A A

5 4

2 3

a b

c d

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 20: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

A 3 x 3 determinant

11 12 13

21 22 23

31 32 33

11 22 33 12 23 31 13 32 21

31 22 13 21 12 33 11 23 32

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

11 12 13

21 22 23

31 32 33

a a a

a a a

a a a

+

-

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 21: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Properties of Determinants1 |A| = |At|

2 If ajk = 0 for all k or for all j |A| = 0

3 Interchange any 2 rows Arsquo |A| = - |Arsquo|

4 For scalar k |kA| = k |A|

5 If there are 2 identical rows or columns |A| = 0

6 |AB| = |A| |B|

7 If A is triangular 1

n

jjj

a

A

Quick student exercise Create an example to illustrate each property

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 22: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Cofactors Minor ndash determinant of order (n-1) obtained

by removing the jth row and kth column of A

Cofactor (-1)j+k Minorjk = Ajk

Cofactor matrix - A matrix with elements that are the cofactors term-by-term of a given square matrix ndash [Ajk]

Adjoint Matrix = transpose of the cofactor matrix ndash [Ajk]t

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 23: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Example Cofactor Matrix

11 12 13

21 22 23

31 32 33

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

4 5 0 5 0 424 5 4

0 6 1 6 1 0

2 3 1 3 1 212 3 2

0 6 1 6 1 0

2 3 1 3 1 22 5 4

4 5 0 5 0 4

A A A

A A A

A A A

A

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 24: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

The Adjoint Matrix

1 2 3 24 5 4

0 4 5 cofactor matrix 12 3 2

1 0 6 2 5 4

24 12 2

Adjoint 5 3 5

4 2 4

t

jk

jk

A A

A

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 25: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Expansion by Cofactors (2 x 2)

1

n

jk jkk

a A

A

11 12 2 311 22 12 21

21 22

11 22 21 12

( 1) | | ( 1) | |a a

a a a aa a

a a a a

I call this technique the Laplace expansion

Pierre-Simon LaplaceBorn 23 March 1749 in Normandy FranceDied 5 March 1827 in Paris France

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 26: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

11 12 13

21 22 23

31 32 33

2 3 422 23 21 23 21 2211 12 13

32 33 31 33 31 32

1 1 1

a a a

a a a

a a a

a a a a a aa a a

a a a a a a

Quick student exercise Complete the example below(ie express algebraically)

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 27: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Example Expansion by Cofactors (3x3)

1

n

jk jkk

a A

A

1 2 33 1 2 1 2 3

2 3 1 1 2 31 2 3 2 3 1

3 1 2

1(5) 2(1) 3( 7) 18

Expanding about row 1

Quick student exercise Expand about column 2and show that the sameresult is obtained

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 28: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Matrix Inverse

A square matrix A may have an inverse matrix A-1 such that

If such a matrix exists then A is said to be nonsingular or invertible The inverse matrix A-1 will be unique

A square matrix A is said to be singular if |A| = 0If |A| 0 then A is said to be nonsingular

-1 -1AA A A I

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 29: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

The Necessary Example3 2 5 5

then1 2 25 75

3 2 5 5 1 0since

1 2 25 75 0 1

-1

-1

A A

AA

How did you ever find A-1 A lucky guess or somethin

Quick student exercise

Show A-1 A = I for thisexample

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 30: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

(we will come back to this problemand solve it shortly)

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 31: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Properties of Inverses

1 1 1

11

1 1 tt

AB B A

A A

A A

How much more of this

can I absorb

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 32: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Finding Inverses Method 1 ndash Adjoint Matrix

Method 2 ndash Gauss-Jordan Elimination Method Elementary Row Operations (ERO)

define an augment matrix [AI] where I is an n x n identity matrix

Perform ERO on [AI] to obtain [IA-1]

1

t

jk A

AA

Did you know If |A| = 0 then A-1 does not exist

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 33: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Method 1 The Adjoint Method

1

1 2 3 24 12 2

0 4 5 Adjoint 5 3 5 22

1 0 6 4 2 4

24 12 2

5 3 5109 5454 0909

4 2 42273 1363 2273

221818 0909 1818

A

A A

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 34: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Method 2 ndash The Gauss-Jordan Way

Carl Friedrich Gauss1777-1855

Wilhelm Jordan 1838-1922

This is our way of doing it

We do it with elementary row

operations

Gaussian Elimination

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 35: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Elementary Row Operations (ERO)

1) Interchange ith and jth row Ri Rj

2) Multiply the ith row by a nonzero scalar

Ri kRi

3) Replace the ith row by k times the jth row plus the ith row

Ri kRj + Ri

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 36: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

The Augmented Matrix

[ A I ]

[ I A-1]

EROrsquos

need an example

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 37: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

The Example2 2 3 1 0 0 1 1 3 2 1 2 0 0

1 3 1 0 1 0 1 3 1 0 1 0

4 1 2 0 0 1 4 1 2 0 0 1

1 1 3 2 1 2 0 0 1 1 3 2 1 2 0 0

0 2 1 2 1 2 1 0 0 2 1 2 1 2 1 0

4 1 2 0 0 1 0 3 4 2 0 1

1 1 3 2 1 2 0 0 1 0 7 4 3 4 1 2 0

0 1 1 4 1 4 1 2 0

0 3 4 2 0 1

0 1 1 4 1 4 1 2 0

0 0 19 4 11 4 3 2 1

1 0 7 4 3 4 1 2 0 1 0 0 519 119 7 19

0 1 1 4 1 4 1 2 0 0 1 0 2 19 819 119

0 0 1 1119 6 19 4 19 0 0 1 1119 6 19 4 19

2 2 3

1 3 1

4 1 2

A 1

5 1 71

2 8 119

11 6 4

A

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 38: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Matrices and Systems of Linear Equations

11 12 1 1 1

21 22 2 2 2

1 2

n

n

m n n m

a a a x b

a a a x b

a a a x b

A x b

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

Ax = b

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 39: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

The Augmented Matrix

Ax = b

[ A I b ]

[ I A-1 brsquo ]

x = brsquo

EROrsquos

-1 -1

xΑΙ b

0

xI A A b b

0

Did you know implied in A-1 are all the EROrsquos (arithmetic) to go from A to A-1

need an example

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 40: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

An Example3 5 1 0 1

1 2 0 1 2

1 5 3 1 3 0 1 3

1 2 0 1 2

1 5 3 1 3 0 1 3

0 1 3 1 3 1 5 3

1 5 3 1 3 0 1 3

0 1 1 3 5

1 0 2 5 8

0 1 1 3 5

R1 R1 3

R2 R2 ndash R1

R2 3 R2

R1 R1 ndash (53)R2

3 5 1

2 2

x y

x y

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 41: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Solving systems of linear eqs using the matrix inverse

11 1 12 2 1 1

21 1 22 2 2 2

1 1 2 2

n n

n n

m m mn n m

a x a x a x b

a x a x a x b

a x a x a x b

11

2

mn

xb

x

bx

X b

11 1

1

n

m mn

a a

a a

A

Matrix solutionAX = bA-1 (AX) = (A-1A)X = IX =X = A-1b

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 42: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Example System or Eqs

3 5 1 3 5 1

2 2 1 2 2

2 5

1 3

2 5 1 8

1 3 2 5

x y x

x y y

x

y

-1

-1

A

x A b

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 43: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Cramerrsquos Rule for solving systems of linear equations

Gabriel CramerBorn 31 July 1704 in Geneva SwitzerlandDied 4 Jan 1752 in Bagnols-sur-Cegraveze France

Given AX = bLet Ai = matrix formed by replacing the ith column with b then

1 2ix i n iA

A

I do it with determinants

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 44: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

An Example of Cramerrsquos Rule

2 3 7 2 319

3 5 1 3 5

7 3 2 738 19

1 5 3 1

38 192 1

19 19

x y

x y

x y

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 45: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Cramer solving a 3 x 3 system2 3 2 1 1

1 1 1 1

2 3 4 1 2 3

( 6) (1) (2) ( 1) ( 3) ( 4) 5

3 1 1 2 3 1 2 1 3

1 1 1 10 1 1 1 5 1 1 1 0

4 2 3 1 4 3 1 2 4

10 5 02 1 0

5 5 5

x y z

x y z

x y z

x y z

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 46: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Finding A-1 for a 2 x 2

1 0

0 1

1

0

0

1

a b x y

c d z w

ax bz

ay bw

cx dz

cy dw

solve for x y z and w in terms of a b c and d

Letrsquos use Cramerrsquos rule

A rare moment ofinspiration among agroup of ENM students

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 47: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

1

0

b

d dx

a b ad bc

c d

1

0

a

c cz

a b ad bc

c d

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 48: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Finding A-1 for a 2 x 2

1

0

0

1

ax bz

cx dz

ay bw

cy dw

0

1

b

d by

a b ad bc

c d

0

1

a

c aw

a b ad bc

c d

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 49: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Finding A-1 for a 2 x 2

1

a bA

c d

d b

x y c aA

z w ad bc

I get it To find the inverse you swap the

two diagonal elements change the sign of the

two off-diagonal elements and divide by

the determinant

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 50: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

A Numerical Example

1

2 4

1 3

3 4

3 41 2

1 26 4

A

d b

c aA

ad bc

1 2 4 3 4 1 0

1 3 1 2 0 1AA

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 51: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Properties of Triangular Matrices

Triangular matrices have the following properties (prefix ``triangular with either ``upper or ``lower uniformly) The inverse of a triangular matrix is a triangular

matrix The product of two triangular matrices is a

triangular matrix The determinant of a triangular matrix is the

product of the diagonal elements A matrix which is simultaneously upper and lower

triangular is diagonal The transpose of a upper triangular matrix is a

lower triangular matrix and vice versa

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 52: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Determinants by Triangularization

4 1 1

5 2 0 16 0 15 0 10 0 21

0 3 2

4 1 1 4 1 1 4 1 1

5 2 0 0 3 4 5 4 0 3 4 5 4

0 3 2 0 3 2 0 0 7

4 1 1

0 3 4 5 4 (4)(3 4)(7) 21

0 0 7

Rrsquo2 -54 R1 + R2 Rrsquo3 -4 R2 + R3

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip

Page 53: ENM 503 Block 2 Lesson 7 – Matrix Methods Everything you would want to know about The Matrix and then some… this way Narrator: Charles Ebeling.

Solving Systems of Equations the Easy Way

There must be an easier way

Why not use Excel with

VBA

to Excel with VBAhellip