26 Matrices
26 Matrices
26 Matrices
CALCULUS- I
Week 11, Part 1:
MATRICES
P f Dr.
Prof. D Zekeriya
Z k i ALTAÇ
Eskişehir Osmangazi University
School of Engng & Architecture
MATRICES
MATR ICES j th column
A matrix is a
⎡ a11 a12 .. .. a1 j .. .. a1n ⎤
rectangular
g ⎢ ⎥
⎢ a21 a22 .. .. a2 j .. .. a2 n ⎥
array of
⎢ .. .. .. .. .. .. .. .. ⎥
numbers. ⎢ ⎥
⎢ .. .. .. .. .. .. .. .. ⎥ i th row
A=⎢ ⎥
⎢ ai1 ai 2 .. .. aij .. .. ain ⎥
⎢ .. .. .. .. .. .. .. .. ⎥
⎢ ⎥
⎢ .. .. .. .. .. .. .. .. ⎥
⎢a .. .. amj .. .. amn ⎥⎦
⎣ m1 am 2 m× n
Matrice Notations
⎡1 2 ⎤ ⎛1 2⎞
A Boldface typeset ⎢3 4 ⎥
⎣ ⎦
⎜ ⎟
⎝3 4⎠
A = [aij ]n×m
Order of a Matri
Matrice
ce
A matrice with m rows and n columns has an
order (or size) m x n.
⎡1 2 ⎤ ⎡2 3 1⎤
A = ⎢⎢ 3 - 4 ⎥⎥ B = ⎢⎢5 4 2 ⎥⎥
⎢⎣ 5 6 ⎥⎦ 3×2 ⎢⎣1 6 3⎥⎦ 3×3
⎡4 5 6⎤
C=⎢
⎣7 -8 2 ⎥⎦ 2×3
EQUALITY OF MATRICES
Two matrices A = [aij ]n×m and B = [bij ]n×m are said to
be equal (A = B) iff each element of A is equal to the
corresponding element of B, i.e., aij = bij for 1<i < m,
1< j < n.
iff pronouns “if and only if”
if A = B, it implies aijj = bijj for 1 ≤ i ≤ m, 1 ≤ j ≤ n;
if aij = bij for 1 ≤ i ≤ m, 1 ≤ j ≤ n, it implies A = B.
NOTE: Equality between matrices of different sizes
does not exist.
EXAMPLES
⎡ a 2 −2 ⎤ ⎡ −2 2 x ⎤
If ⎢ ⎥ = ⎢ y 3 1 ⎥ , then
⎣ 0 b c ⎦ 2×3
2 3 ⎣ ⎦ 22×33
a = −2, b = 3, c = 1, x = −2, y = 0
⎡a b⎤ ⎡ 1 − 2⎤
If ⎢ = , then
⎣c d ⎥⎦ 2×2 ⎢⎣ −3 4 ⎥⎦ 2×2
a = 1, b = −2, c = −3, d = 4
⎡ a − 2 b + 1 ⎤ ⎡ 4 3⎤
⎢ c + 5 d − 6 ⎥ = ⎢ −2 4 ⎥
⎣ ⎦ ⎣ ⎦
Use the definition of equality to change this matrix
equation into 4 real number equations:
a–2=4 b+1=3 c+5=–2 d–6=4
a=6 b=2 c = –7 d = 10
β is called a scalar.
EXAMPLES
⎡ −1 2 3 ⎤ ⎡ 1 −2 − 3 ⎤
⎢ ⎥
(−1) ⎢⎢ 6 −7 9 ⎥⎥ = ⎢ −6 7 −9 ⎥
⎢⎣ 0 −4 8 ⎥⎦ 3×3 ⎢⎣ 0 4 −8⎥⎦ 3×3
⎡1 2 3 ⎤ ⎡3 6 9 ⎤
(3) ⎢ ⎥ = ⎢ ⎥
⎣0 1 4 ⎦ 2×3 ⎣0 3 12 ⎦ 2×3 ⎡ 3⎤ ⎡6⎤
(2) ⎢⎢1 ⎥⎥ = ⎢⎢ 2 ⎥⎥
⎢⎣ 2 ⎥⎦ 3×1 ⎢⎣ 4 ⎥⎦ 3×1
ADDITION//SUBTRACTION OF MATRICES
ADDITION
EXAMPLE ⎡ 4 −3 1 ⎤ ⎡ −1 2 3 ⎤
⎢ 0 5 −2 ⎥ + ⎢ 6 −7 9 ⎥
⎢ ⎥ ⎢ ⎥
⎢⎣ 5 −6 0 ⎥⎦ 3×3 ⎢⎣ 0 −4 8 ⎥⎦ 3×3
⎡ 4 − 1 −3 + 2 1 + 3 ⎤ ⎡ 3 −1 4 ⎤
= ⎢⎢ 0 + 6 5 − 7 −2 + 9 ⎥⎥ = ⎢⎢ 6 −2 7 ⎥⎥
⎢⎣ 5 + 0 −6 − 4 0 + 8 ⎥⎦ 3×3 ⎢⎣ 5 −10 8 ⎥⎦ 3×3
EXAMPLE ⎡ 4 −3 1 ⎤ ⎡ −1 2 3 ⎤
⎢ 0 5 −2 ⎥ − ⎢ 6 −7 9 ⎥
⎢ ⎥ ⎢ ⎥
⎢⎣ 5 −6 0 ⎥⎦ 3×3 ⎢⎣ 0 −4 8 ⎥⎦ 3×3
⎡1 2 3⎤ ⎡ 1 −1 2 ⎤
⎢ −2 3 0 ⎥ ⎢0 2 2⎥
(2) ⎢ ⎥ + (3) ⎢ ⎥
⎢ 4 −2 3 ⎥ ⎢ 3 −1 3 ⎥
⎢ ⎥ ⎢ ⎥
⎣1 0 −2 ⎦ 4×3 ⎣ 0 1 2 ⎦ 4×3
⎡ 5 1 12 ⎤
⎢ −4 12 6 ⎥
=⎢ ⎥
⎢17 −7 15 ⎥
⎢ ⎥
⎣2 3 2 ⎦ 4×3
⎡ 2 −1 0 2 ⎤ ⎡ 5 1 2 −2 ⎤
(3) ⎢ ⎥ − ( 4) ⎢ 1 −2 3 −3 ⎥
⎣ 3 0 3 −2 ⎦ 2×4 ⎣ ⎦ 2×4
⎡ −14 −7 −8 14 ⎤
=⎢
⎣ 5 8 −3 6 ⎥⎦ 2×4
Properties of Addition
If the order of the matrices A, B and C is same size
A = [aij ]n×m , B = [bij ]n×m and C = [cij ]n×m then
(i) A + B = B + A (Commutativity)
(ii) (A + B) + C = A + (B + C) (Associativity)
(iii) If m and n are scalars, then (Distributivity)
( ) m(A
(a) (A + B) = mA
A + mB
B
(b) (m + n)A = mA + nA
(iv) A + (-A) = O (Inverse operation)
⎡ 2 0 1 ⎤ ⎡ 2 1 −1⎤ ⎡0 0 0⎤
+
⎢ 3 −1 0 ⎥ ⎢ 0 2 1 ⎥ + C = ⎢0 0 0⎥
⎣ ⎦ ⎣ ⎦ ⎣ ⎦
⎡4 1 0⎤ ⎡0 0 0⎤ ⎡ −4 −1 0 ⎤
⇒⎢ ⎥ + C = ⎢0 0 0⎥ C=⎢ ⎥
⎣3 1 1⎦ ⎣ ⎦ ⎣ −3 −1 −1⎦
EXAMPLE ⎛ ⎡3 x −1⎤ ⎡ 4 1 ⎤ ⎞ ⎡ 26 0 ⎤
2 ⎜ ⎢ + ⎟=
Solve the eq
⎝⎣ 8 5 ⎥⎦ ⎢⎣ −2 − y ⎥⎦ ⎠ ⎢⎣12 8 ⎥⎦
⎡3 x + 4 −1 + 1⎤ ⎡ 26 0⎤
2⎢ ⎥ =⎢
⎣ 8 − 2 5 − y ⎦ ⎣12 8 ⎥⎦
⎡6 x + 8 0 ⎤ ⎡ 26 0⎤
⎢ 12 ⎥ =⎢
⎣ 10 − 2 y ⎦ ⎣12 8 ⎥⎦
6 x + 8 = 26 ⇒ x = 3
10 − 2 y = 8 ⇒ y = 1
MULTIPLICATION OF MATRICES
If A = [aij ]n× p and B = [bij ] p×m are matrices, then the
product (or matrice multiplication) is a new matrice
with size n × m whose ij'th entry is found by summing
the multiplication of the i th row of A with the j th row
of B of the same entry.
C = AB = [aij ]n×m [bij ]m×r = [cij ]n×r
n
cij = ai1b1 j + ai 2b2 j + + ainbnj = ∑ aik bkj
k =1
A B = AB
mxr rxn mxn
inside
outside
LEGAL
LEGAL
ILLEGAL
c1 c2 c3
r1⎡ −1 2 ⎤
⎢
r2 2 3 ⎥ ⎡1 2 3 ⎤
⎢ ⎥ ⎢0 1 4⎥
r3 ⎢
⎣ ⎦ 2×3
⎣ 5 0 ⎥⎦ 3×2
[ ]3×2 [ ]2×3 = [ ]3×3
LEGAL
EXAMPLE ⎡ 3 2⎤ ⎡1 −4 ⎤
Find AB and BA
A=⎢ ⎥ , B = ⎢2 1 ⎥
⎣ −1 0 ⎦ 2×2 ⎣ ⎦ 2×2
⎡ 3 2⎤ ⎡1 4⎤ ⎡ 7 −10 ⎤
AB = ⎢ ⎥ ⎢ 2 1 ⎥ = ⎢ −1 4 ⎥
⎣ −1 0 ⎦ 2×2 ⎣ ⎦ 2×2 ⎣ ⎦ 2×2
⎡1 −4 ⎤ ⎡ 3 2 ⎤ ⎡7 2⎤
BA = ⎢ ⎥ ⎢ −1 0 ⎥ = ⎢ 5 4⎥
⎣ 2 1 ⎦ 2×2 ⎣ ⎦ 2×2 ⎣ ⎦ 2×2
NOTE THAT AB ≠BA
⎡5 1⎤
⎢ ⎥
⎡ 2 −1 0 2 ⎤ ⎢ 1 −2 ⎥
⎢ ⎥
⎣ 3 0 3 −2 ⎦ 2×4 ⎢ 2 3 ⎥
⎢ ⎥
⎣ −2 −3⎦ 4×2
⎡ 5 −2 ⎤
=⎢ ⎥
⎣ 25 18 ⎦ 2×2
⎡ 1 2 −1⎤
⎢ 0 3 1 ⎥ ⎡ 2 −1 −1 2 ⎤
⎢ ⎥ ⎢0 3 1 1 ⎥
⎢ 1 −1 2 ⎥ ⎢ ⎥
⎢ ⎢ ⎥
⎥ ⎣ 4 1 −1 0 ⎦ 3×4
⎣ 2 1 − 1⎦ 4×3
⎡ −2 4 2 4⎤
⎢ 4 10 2 3 ⎥⎥
=⎢
⎢10 −2 −4 1⎥
⎢ ⎥
⎣0 0 0 5 ⎦ 4×4
EXAMPLE ⎡ 3 −2 ⎤
If A = ⎢ ⎥ , find k to satisfy A 2 = kA − 2I 2
⎣ 4 −2 ⎦
⎡ 3 −2 ⎤ ⎡ 3 −2 ⎤ ⎡ 1 −2 ⎤
A2 = ⎢ ⎥ ⎢ 4 −2 ⎥ = ⎢
⎣ 4 − 2 ⎦⎣ ⎦ ⎣ 4 −4 ⎥⎦
⎡ 1 −2 ⎤ ⎡ 3k −2k ⎤ ⎡ −2 0 ⎤
⎢⎣ 4 −4 ⎥⎦ = ⎢ 4k +
−2k ⎥⎦ ⎢⎣ 0 −2 ⎥⎦
⎣
Comparing the corresponding
⎡3k − 2 −2k ⎤ elements of the two matrices ,
=⎢
−2k − 2 ⎥⎦
we get 3k –2=1, –2k= –2, 4=4k,
⎣ 4k –4=–2k–2. Taking any of the
four equations, we get k=1
1 ⎡? ? ⎤
≠⎢
⎡a b⎤ ⎡ u v ⎤ ⎣? ?⎥⎦
⎢c d ⎥⎦ ⎡? ?⎤ ⎢w t ⎥
⎣ ≠ ⎣ ⎦
⎡u v ⎤ ⎢⎣? ?⎥⎦
⎢w t ⎥⎦ ⎡1 0⎤
⎣ ⎢0
⎣ 1 ⎥⎦ ⎡? ?⎤
≠
⎡u v ⎤ ⎢⎣? ?⎥⎦
⎢w t ⎥⎦
⎣
TYPES OF MATRICES
⎡ a11 a12 … a1n ⎤
Rectangular matrice ⎢a ⎥
⎢ 21 a22 a2 ⎥
order m×n
n
⎢ ⎥
⎢ ⎥
Column matrice ⎣ am1 am 2 amn ⎦ m×n
⎡ a11 ⎤
⎢a ⎥
⎢ 21 ⎥ Row matrice
⎢ ⎥
⎢ ⎥ [ a11 a12 a1n ]1×n
⎣ am1 ⎦ m×1
EXAMPLES
⎡3 5 ⎤ ⎡ 6 1 −1⎤
⎢ 0 −2 ⎥ ⎢0 7 4 ⎥
⎣ ⎦ ⎢ ⎥
⎢⎣ 0 0 5 ⎥⎦
⎡2 0 0 0⎤
⎢ 1 −2 0 0 ⎥⎥ ⎡ −2 0 0 ⎤
⎢ ⎢ 5 3 0⎥
⎢ 3 −4 5 0⎥ ⎢ ⎥
⎢ ⎥ ⎢⎣ 1 −1 2 ⎥⎦
⎣ 4 −1 1 2⎦
9 ∑a
i =1
ii = a11 + a22 + ... + ann
Identity Matrices, In
9 In particular, a11 = a22 = … = ann = 1, the
matrice is called identity matrice
⎡1 0⎤
I2 = ⎢ ⎥
⎣0 1 ⎦ ⎡1 0 … 0⎤
⎢0 1 0 ⎥⎥
⎡1 0 0 ⎤
In = ⎢
I 3 = ⎢⎢0 1 0⎥⎥ ⎢ 0 ⎥
⎢⎣0 0 1⎥⎦ ⎢ ⎥
⎣0 0 0 1 ⎦ n×n
Diagonal Matrices
Both upper and lower ⎡ a11 0 … 0 ⎤
triangular, i.e., aij = 0, for ⎢0 a 0 ⎥⎥
i ≠ j , i.e., is called a ⎢ 22
diagonal matrice,and ⎢ ⎥
⎢ ⎥
it can be simply stated ⎣0 0 ann ⎦ n×n
as D = diag[ a11 , a22 ,..., ann ]
⎡3 0 0 0⎤
⎡6 0 0⎤ ⎢ 0 −1 0 0 ⎥⎥
⎡3 0 ⎤ ⎢0 7 0⎥ ⎢
⎢ 0 −2 ⎥ ⎢ ⎥ ⎢0 0 5 0⎥
⎣ ⎦ ⎢⎣ 0 0 5 ⎥⎦ ⎢ ⎥
⎣0 0 0 2⎦
Tridiagonal Matrices
⎡ d1 a1 0 0 0 ⎤
⎢b d 0 0 ⎥⎥
nal
⎢ 2 2 a2
Above diagon
⎢ 0 b3 d3 a3 0 ⎥
⎢ ⎥
⎢0 0 ⎥
⎢ bn−1 d n−1 an−1 ⎥
⎢ ⎥
⎢⎣ 0 0 0 bn d n ⎥⎦ n×n
Below diagonal
diagonal
TRANSPOSE OF MATRICES
The matrix obtained by interchanging the
rows and columns of a matrice A is
called the transpose of A. Its transpose
is denoted by AT.
Properties of Transpose
EXAMPLES
⎡1 4⎤
⎡1 2 3⎤
A=⎢ ⎥ AT = ⎢⎢ 2 5 ⎥⎥
⎣ 4 5 6 ⎦ 2×3 ⎢⎣ 3 6 ⎥⎦ 3×2
⎡3⎤
A = ⎢⎢ −1⎥⎥ AT = ⎡⎣ 3 −1 4 ⎤⎦
1×3
⎢⎣ 4 ⎥⎦ 3×1
⎡1 2 ⎤ ⎡1 3 ⎤
A=⎢ ⎥ A =⎢
T
⎥
⎣3 −1⎦ 2×2 ⎣ 2 −1⎦ 2×2
⎡5 -1⎤ ⎡2 1⎤
EXAMPLE If A = ⎢ ⎥ and B = ⎢ ⎥
⎣6 7 ⎦ ⎣3 4⎦
verify that (A+B)T=AT+BT
⎡5 -1⎤ ⎡2 1⎤ ⎡7 0 ⎤ T ⎡7 9 ⎤
A +B = ⎢ +
⎥ ⎢ =
⎥ ⎢ ⎥ ∴ ( A + B ) = ⎢ ⎥
⎣ 6 7 ⎦ ⎣3 4 ⎦ ⎣9 11⎦ ⎣0 11⎦
⎡ 5 6⎤ ⎡2 3 ⎤ ⎡7 9 ⎤
AT = ⎢ ⎥ and B T
= ⎢ ⎥ ∴ A T + BT = ⎢ ⎥
⎣-1 7 ⎦ ⎣1 4⎦ ⎣0 11⎦
Hence, (A+B)T=AT+BT
⎡ 4y 2 + z 2 2y 2 - z 2 -2y 2 + z 2 ⎤ ⎡ 1 0 0⎤
⎢ ⎥
= ⎢ 2y 2 - z 2 2
x +y +z2 2
x 2 - y 2 - z 2 ⎥ = ⎢⎢ 0 1 0 ⎥⎥
⎢ ⎥
2
⎢⎣-2y + z
2
x 2 - y 2 - z2 x 2 + y 2 + z 2 ⎥⎦ ⎢⎣ 0 0 1 ⎥⎦
⎡2 1 −1⎤
EXAMPLE Find x , if [ x 4 −1] ⎢⎢1 0 0 ⎥⎥ [ x 4 −1] =0
T
⎢⎣2 2 4 ⎥⎦
⎡2 1 −1⎤
[ x 4 −1] ⎢⎢1 0 0 ⎥⎥ = [ 2x + 4 − 2 x − 2 − x − 4]
⎢⎣2 2 4 ⎥⎦
⎡x⎤
[2 x + 2 x−2 − x − 4 ] ⎢⎢ 4 ⎥⎥ = 0
⎢⎣ − 1⎥⎦ 2 x2 + 7 x − 4 = 0
1
⇒ (2 x 2 + 2 x + 4 x − 8 + x + 4) = 0 x= or x = −4
2
⎡2 1 −1⎤ ⎡2 2 4 ⎤ r1 r3
⎢1 −1 3 ⎥ ∼ ⎢1 −1 3 ⎥
⎢ ⎥ ⎢ ⎥
⎢⎣2 2 4 ⎥⎦ ⎢⎣2 1 −1⎥⎦
⎡1 5 ⎤ ⎡1 5⎤
⎢2 −1⎥ ⎢ 4 −2⎥ r ← 2r
⎢ ⎥ ∼⎢ ⎥ 2 2
⎢3 0 ⎥ ⎢3 0⎥
⎢ ⎥ ⎢ ⎥
⎣ 1 2 ⎦ ⎣ −1 −2 ⎦ r4 ← (−1)r4
⎡1 2 −2⎤ ⎡1 2 −2⎤
⎢1 3 1 ⎥ ∼ ⎢01 13 31 ⎥ r ← r + (−11))r
⎢ ⎥ ⎢ ⎥ 2 2 1
⎢⎣2 −2 4 ⎥⎦ ⎢⎣02 −6
42 84 ⎦⎥ r3 ← r3 + (−2
2))r1
r2 1 3 1
(−r1 ) −1 − 2 2
+ 0 1 3
r3 2 −2 4
(−2r1 ) −2 − 4 4
+ 0 −6 8