# Composition of two matrices

1. Oct 30, 2014

### crashh

1. The problem statement, all variables and given/known data
The problem states that we have L as the linear transformation as:
\begin{align*}
A=
\left(
\begin{array}{ccc}
2 & 0 & 1 \\
-2 & 3 & 2 \\
4 & 1 & 5
\end{array}
\right)
\end{align*}

And when given another linear transformation T as:
\begin{align*}
B=
\left(
\begin{array}{ccc}
-3 & 1 & 0 \\
2 & 0 & 1 \\
0 & -1 & 3
\end{array}
\right)
\end{align*}

Then find the matrix representation of T ο L with respect to E(which is the standard basis, as are both transformations).

T ο L is the composition of T and L.

2. Relevant equations
I assumed you could just multiply the two matrices togeather, as they share the same basis, thus getting the composition of the two lineartransformations?

3. The attempt at a solution
\begin{align*}
T&=B=
\left(
\begin{array}{ccc}
-3 & 1 & 0 \\
2 & 0 & 1 \\
0 & -1 & 3
\end{array}
\right)\\
L&=A=
\left(
\begin{array}{ccc}
2 & 0 & 1 \\
-2 & 3 & 2 \\
4 & 1 & 5
\end{array}
\right)\\
\end{align*}

\begin{align*}
BA&=
\left(
\begin{array}{ccc}
-3 & 1 & 0 \\
2 & 0 & 1 \\
0 & -1 & 3
\end{array}
\right)
\left(
\begin{array}{ccc}
2 & 0 & 1 \\
-2 & 3 & 2 \\
4 & 1 & 5
\end{array}
\right)\\
&=
\left(
\begin{array}{ccc}
-8 & 3 & -1 \\
8 & 1 & 7 \\
14 & 0 & 13
\end{array}
\right)
\end{align*}

Or is this completely wrong?

2. Oct 30, 2014

### vela

Staff Emeritus
I didn't check that you multiplied the matrices together correctly, but assuming you did, that's the right answer.

3. Oct 31, 2014

### Fredrik

Staff Emeritus
No need to assume it. The number on row i, column j of the matrix corresponding to an arbitrary linear operator A is $A_{ij}=\langle e_i,Ae_j\rangle$. So
\begin{align}
&(T\circ L)_{ij}=\langle e_i,(T\circ L)e_j\rangle =\langle e_i,T(Le_j)\rangle =\left\langle e_i,T\left(\sum_k \langle e_k,Le_j\rangle e_k\right)\right\rangle\\
&=\sum_k\langle e_k,Le_j\rangle \langle e_i,Te_k\rangle =\sum_k L_{kj}T_{ik} =\sum_k T_{ik}L_{kj}.
\end{align}

4. Oct 31, 2014

### HallsofIvy

Staff Emeritus
Yes, that is the correct product of the two matrices. One way to remember how to multiply matrices is to think of the rows of the first matrix and the columns of the second matrix as "vectors". If $a_{ij}$ is the number in the i row, j column of the product matrix, then $a_{ij}$ is the dot product of the i row of the first matrix and the j column of the second matrix.

For example, the first row of the first matrix, B, is <-3, 1, 0> and the first column of the second matrix, A, is <2, -, 4> so the number in the first row, first column, of BA is (-3)(2)+ 1(-2)+ 0(4)= -8 as you have.

And, of course, the order of the multiplication (BA rather than AB) is important because matrix multiplication is NOT commutative. The multiplication of the matrices must be the same as the order in which the transformation are applied.