University of Palestine Gaza Strip Civil Engineering College Numerical Analysis CIVL 3309 Dr. Suhail Lubbad
University of Palestine Gaza Strip Civil Engineering College Numerical Analysis CIVL 3309 Dr. Suhail Lubbad
Gaza Strip
2
If the System A x = 0;
Has the trivial solution, then
The system A x = B has also one solution
3
No proofs are required
Take it as a BONUS
4
Determine whether
the matrix of coefficient A is invertible; If so, find the inverse.
[ 1 2
−1 3 ][ ] [ ]
x
y
=
3
2
[ Solve for X using the basic definition of the inverse, that is by equating
corresponding entries on the two sides.]
A matrix is invertible,
if its determinant ≠ 0
5
−1 −1
From the definition, A A = A A = I
thus
[
−1 3 ] [ ]
1 2 −1 1 0
A =
0 1
Let A −1 =
[ ]
a b
c d
, then
[ 1 2
−1 3 ][ ] [ ]
a b
c d
=
1 0
0 1
1 3
Solving These equations, eq 1 -eq 3 gives 5c=1 . c= , and a=
5 5
1 2
Solving These equations, eq 2 -eq 4 gives 5d=1. d= , and b=−
5 5 6
A Method for Inverting Matrices
inverse
HOW?
HOW?
Write the Augmented matrix [A | In]
Perform a sequence of row operation to reduce A to In,
what results in the place of In is A-1
Consider an example
8
Using Row Operations to Find A−1
9
EXAMPLE
10
EXAMPLE A matrix that is Not Invertible
[ ]
1 6 4
A= 2 4 −1
−1 2 5
11
Solving Linear Systems by Invertible Matrices
BESIDES
solving linear systems by Gauss–Jordan elimination or Gaussian elimination
there is
a one third way to solve n equations in n unknowns:
Use the inverse of the matrix of coefficients, if it is invertible.12
The procedure is given by the following theorem
THEOREM
If Ax = b
then left multiplication of both sides by A-1
A-1Ax = I x = x = A-1 b where x is the solution
13
-1
EXAMPLE Solution of a Linear System Using A
14
Solving linear Systems with a common coefficient Matrix
ALL at once
16
17
Example Solution of two systems at once
see last slide by matrix inversion
[ ]
−40 16 9
−1
A = 13 −5 −3
5 −2 −1
[ ][ ∣ ]
−40 16 9 4 1
[ x1 ∣ x2] = A
−1
[ b1 ∣ b2 ] = 13 −5 −3 5 6
5 −2 −1 9 −6
[ ]
1 2
[ x1 ∣ x2 ] = 0 1
1 −1
18
A matrix can have at most 1 inverse
that is, either none or exactly one
19
THEOREM
20
A Fundamental Problem
22
23
24
25
Theorem to compute the inverses of 2x2 matrices.
[ ] [ ]
−1 −1
3 1 6 4
Find and
5 2 −2 −1
26
Question: find the inverse of the equation :
[ cos 2 sin 2
−sin 2 cos 2 ]
Theorem 1.4.5 helps us compute the inverse as
1
2
[
cos 2 −sin 2
2
cos021 -sin 021 sin 2 cos 2 ]
27
[ ]
3 1
5 2
28
Use the inverse method to find the unique solution of the given
linear system.
3x −2x =−1
1 2
4x -5x =3
1 2
[ ][ ] [ ]
3 −2 x −1 A-1 A x = A-1b
= 1
x=A-1b
4 5 x 3 2
30
Use the inversion algorithm to find the inverse of the given
matrix, if the inverse exists.
[ ]
1 0 1
0 1 1
1 1 0
write the matrix as : [ M nn∣I n ] and perform operation on M so to reach In on left,
the result in right is the inverse if it exists
[ ∣ ] [ ∣ ] [ ∣ ]
1 0 1 1 0 0 1 0 11 0 0 1 0 1 1 0 0
r3
0 1 1 0 1 0 r 3 . r 2 −r 3 0 1 1 0 1 0 r 3 . r 3-r 1 0 1 1 0 1 0 r3 . 2
1 1 0 0 0 1 −1 0 1 0 1 −1 0 0 2 1 1 −1
]
1 1 1
]
−
1 0 0
[ ∣ [ ∣
1 0 1 1 0 0 2 2 2
0 1 r
0 2 . r 2 −r 3 1 1 1
0 1 1 0 1 0−
1 1 1 r 1 . r 1 −r 3 2 2 2
0 0 1 − 0 0 1 1 1 1
2 2 2 −
2 2 2
[ ]
1 1 1
−
2 2 2
1 1 1
The inverse is thus − Would you check?
2 2 2
1 1 1 31
−
2 2 2
Find the inverse if the inverse exists
[ ]
/2 3 /2 0
− 4/2 /2 0 Writing the augmented matrix :
0 0 1
[ ]
1
r1 1 3 0 ⋮ 0 0
[ ]
/2 3 /2 0 ⋮ 1 0 0 r1 . /2
/2 1
− 4/2 /2 0 ⋮ 0 1 0 , −4 1 0 ⋮ 0 0
, r 2 . r 2 -4 r 1
r2
0 0 0 ⋮ 0 0 1 r2 . /2
/2 0 0 1 ⋮ 0 0 1
[ ] [ ]
1 1
1 3 0 ⋮ 0 0 1 3 0 ⋮ 0 0
/2 r2 /2
4 1 , r2 . 4 1 , r1=r 1−3 r 2
0 13 0 ⋮ 0 13 0 1 0 ⋮ 0
/2 /2 13 / 2 13 / 2
0 0 1 ⋮ 0 0 1 0 0 1 ⋮ 0 0 1
[ ]
1 −3
1 1 0 ⋮ 0
13 / 2 13 / 2
4 1 , the left 3×3 matrix is the inverse, check the result
0 1 0 ⋮ 0
13 / 2 13 / 2 32
0 0 1 ⋮ 0 0 1
Question : find the inverse for the following matrix
[ ]
2 −4 0 0
1 2 12 0
The Augmented matrix is:
0 0 2 0
0 −1 −4 −5
[ ]
1
[ ]
1 −2 0 0 0 0 0
2 −4 0 0 1 0 0 0 r3 2
r3 .
1 2 12 0 0 1 0 0 2 1 2 12 0 0 1 0 0
,
0 0 2 0 0 0 1 0 r1 1
r1 . 0 0 1 0 0 0 0
0 −1 −4 −5 0 0 0 1 2 2
0 −1 −4 −5 0 0 0 1
r2 . r2−12r3
[ ] [ ]
1 1
1 −2 0 0 0 0 0 2 0 0 0 1 −6 0
2 2
1 2 0 0 0 1 −6 0 r1 . r1-r2 1 2 0 0 0 1 −6 0
1 1
0 0 1 0 0 0 0 −−−−−. 0 0 1 0 0 0 0
2 2
0 −1 −4 −5 0 0 0 1 0 −1 −4 −5 0 0 0 1
33
r1 . r1/ 2
] [ ]
1 1
[
1 1 1 0 0 0 −3 0
1 0 0 0 −3 0 4 2
4 2
−1 1
1 2 0 0 0 1 −6 0 0 2 0 0 −3 0 r2
r2 . r2−r1 4 2 r2 .
1 2
0 0 1 0 0 0 0 1
2 0 0 1 0 0 0 0
2
0 −1 −4 −5 0 0 0 1
0 −1 −4 −5 0 0 0 1
] [ ]
1 1
[
1 1 1 0 0 0 −3 0
1 0 0 0 −3 0 2 2
2 2
−1 1 −3
−1 1 −3 0 1 0 0 0
0 1 0 0 0 8 4 2 r4
8 4 2 r4 . r4-4r3-r2 r4 .
1 −5
1 0 0 1 0 0 0 0
0 0 1 0 0 0 0 2
2
−1 1 1
0 −1 −4 −5 0 0 0 1 0 0 0 −5 1
8 4 2
[ ]
1 1
1 0 0 0 −3 0
4 2
1 1 3
0 1 0 0 − − 0
8 4 2
1
0 0 1 0 0 0 0
2
1 1 1 −1
0 0 0 1 − − 34
40 20 10 5
Question
It is easy to find the inverse of the matrix :
[ ]
k1 0 0 0
0 k2 0 0
0 0 k3 0
0 0 0 k4
[ ]
1
0 0 0
k1
1
0 0 0
k2
You should get the following as the inverse
1
0 0 0
k3
1
0 0 0
k4
HOW
35
Find all values of c, if any, for which the given matrix is invertible.
[ ] [ ]
c c c c c c 1 0 0
1 c c writing the augmented matrix 1 c c 0 1 0 r1 . r 1−r 2
1 1 c 1 1 c 0 0 1
[ ] [ ]
c−1 0 0 1 −1 0 c−1 0 0 1 −1 0
1 c c 0 1 0 r 2 . r 2−r 3 0 c−1 0 0 1 −1 r 3 =0c−11 r3 −r 2 −r 1
1 1 c 0 0 1 1 1 c 0 0 1
[ ]
r1 1 −1
r1 . 1 0 0 0
c−1 c−1 c−1
[ ]
c−1 0 0 1 −1 0
r2 1 −1
0 c−1 0 0 1 −1 if c≠0, 1 ; r 2 . 0 1 0 0
c−1 c−1 c−1
0 0 c⋅0c−11 −1 0 c r3 −1 1
r3 . 0 0 1 0
c⋅0c−11 c⋅0c−11 0c−11
36
Question
x= [ 6
−5 ][ ] [ ]
−1 2
1 9
=
3
−1
37
Question
[ ]
0 −1 −2 −3 1 0 0 0
Find the solution of the matrix on left using 1 1 4 4 0 1 0 0
the theorem Ax=b ⇒ x=A−1 b if A is invertible 1 3 7 9 0 0 1 0
−1 −2 −4 −6 0 0 0 1
Do the following steps in the specified order
01 1 r 2 ⇔ r 1
02 1 r 3 . r 3−r 1 & r 4 . r 4 -r 1
03 1 r 3 . r 3-2r 2
04 1 r 4 . r 4−r 2
05 1 r 3 . r 3-r 4
06 1 r 4 . r 4−2r3
07 1 r 2 . r 2-2r 3 -r 4
08 1 r 2 .−r 2
09 1 r 2 . r 2−2r 4
[ ]
1 0 0 0 2 0 0 −1
0 1 0 0 6 −3 4 1
10 1 r 1 . r 1−r 2−4r 3−4r 4 The results are:
0 0 1 0 1 0 1 1 38
0 0 0 1 −3 1 −2 −1
CONTINUE
From which the inverse is :
[ ]
2 0 0 −1
6 −3 4 1
1 0 1 1
−3 1 −2 −1
hence
[ ][ ] [ ] [ ]
2 0 0 −1 0 −6 w
6 −3 4 1 7 1 x
x= = =
1 0 1 1 4 10 y
−3 1 −2 −1 6 −7 z
check the results by substitution in the equations
39
Solve the linear system of equations by reducing the approperiate augmented matrix.
x1−5x 2 =b1
, b1=1, b2 =4
3x 1-2x 2 =b 2
40
Use Gauss-Jordan elimination method
To solve the system
[ ] [ ] [ ]
1 3 5 1 1 3 5 1 1 3 5 1
r 2 . r 2 -r 1
−1 −2 0 0 0 1 5 1 r 3 . r3-r 2 0 1 5 1
r 3 . r 3 −2r 1
2 5 4 −1 0 −1 −6 −3 0 0 −1 −2
[ ] [ ] [ ]
1 2 0 0 1 2 0 0 1 0 0 18
r 1 . r 1 −r 2
0 1 5 1 r 2 . r 2−5r 3 0 1 0 −9 r 1 . r 1−2r 2 0 1 0 −9
r 3 .−r 3
0 0 1 2 0 0 1 2 0 0 1 2
[ ] [ ]
1 −1 1 2 −1 5 7 8
2 3 0 X= 4 0 −3 0 1
0 2 −1 3 5 −7 2 1
[ ]
−1
1 −1 1
Left multiply the equation by 2 3 0 gives
0 2 −1
[ ][ ]
−1
1 −1 1 2 −1 5 7 8
X= 2 3 0 4 0 −3 0 1
0 2 −1 3 5 −7 2 1
All you need is to compute the inverse
[ ]
3 −1 3
You will compute the inverse as: −2 1 −2
−4 2 −5
Find x
42