7—Operators and Matrices 182
7.4 Matrix Multiplication
How do you multiply two matrices? There’s a rule for doing it, but where does it come from?
The composition of two functions means you first apply one function then the other, so
h=f◦g means h(~v) =f
(
g(~v)
)
(20)
I’m assuming that these are vector-valued functions of a vector variable, but this is the general definition of
composition anyway. Iffandgare linear, does it follow thehis? Yes, just check:
h(c~v) =f
(
g(c~v)
)
=f
(
cg(~v)
)
=cf
(
g(~v)
)
, and
h(~v 1 +~v 2 ) =f
(
g(~v 1 +~v 2 )
)
=f
(
g(~v 1 ) +g(~v 2 )
)
=f
(
g(~v 1 )
)
+f
(
g(~v 2 )
)
What are the components ofh? Again, use the definition and plug in.
h(~ei) =
∑
k
hki~ek=f
(
g(~ei)
)
=f
(∑
j
gji~ej
)
=
∑
j
gjif
(
~ej
)
=
∑
j
gji
∑
k
fkj~ek
and now all I have to do is equate the corresponding coefficients of~ek.
hki=
∑
j
gjifkj or more conventionally hki=
∑
j
fkjgji (21)
This is in the standard form for matrix multiplication, recalling the subscripts are ordered asfrcfor row-column.
h 11 h 12 h 13
h 21 h 32 h 23
h 31 h 32 h 33
=
f 11 f 12 f 13
f 21 f 32 f 23
f 31 f 32 f 33
g 11 g 12 g 13
g 21 g 32 g 23
g 31 g 32 g 33
(22)
The computation ofh 12 from Eq. ( 21 ) is
h 11 h 12 h 13
h 21 h 22 h 23
h 31 h 32 h 33
=
f 11 f 12 f 13
f 21 f 22 f 23
f 31 f 32 f 33
g 11 g 12 g 13
g 21 g 22 g 23
g 31 g 32 g 33
−→ h 12 =f 11 g 12 +f 12 g 22 +f 13 g 32