The matrix representations of the linear functions S and T are equivalent to the coefficients of the polynomials:

\[ S = \begin{bmatrix} 1 & -2 & 3 \\ 5 & 4 & 2 \\ \end{bmatrix} \] \[ T = \begin{bmatrix} -1 & 3 & 1 & 9 \\ 2 & 0 & 1 & 7 \\ 4 & 2 & 1 & 2 \\ \end{bmatrix} \] The matrix representation of the function composition \(S \circ T\) is equivalent to \(S*T\).

\[ S*T = \begin{bmatrix} (1)(-1)+(-2)(2)+(3)(4) & (1)(3)+(-2)(0)+(3)(2) & (1)(1)+(-2)(1)+(3)(1) & (1)(9)+(-2)(7)+(3)(2) \\ (5)(-1)+(4)(2)+(2)(4) & (5)(3)+(4)(0)+(2)(2) & (5)(1)+(4)(1)+(2)(1) & (5)(9)+(4)(7)+(2)(2) \\ \end{bmatrix} \]

\[ S*T = \begin{bmatrix} 7 & 9 & 2 & 1 \\ 11 & 19 & 11 & 77 \\ \end{bmatrix} \]

Check for equivalence with R functions:

S_matrix <- matrix(c(1, -2, 3, 5, 4, 2), nrow = 2, byrow = TRUE)

S_function <- function(x){
  matrix(c(
    ( x[1,]) + (-2 * x[2,]) +(3*x[3,]),
    (5*x[1,]) + (4*x[2,]) + (2*x[3,])
  ))
}

vector_1 <- matrix(c(5, -1, 9), nrow = 3)


S_function(vector_1) == S_matrix %*% vector_1
##      [,1]
## [1,] TRUE
## [2,] TRUE
T_matrix <- matrix(c(-1,3,1,9,2,0,1,7,4,2,1,2), nrow = 3, byrow = TRUE)

T_function <- function(x){
  matrix(c(
    ( -x[1,]) + (3 * x[2,]) +x[3,] + (9*x[4,]),
    (2*x[1,]) + x[3,] + (7*x[4,]),
    (4*x[1,]) + (2*x[2,]) + x[3,] + (2*x[4,])
  ))
}

vector_2 <- matrix(c(5, -1, 9,7), nrow = 4)


T_function(vector_2) == T_matrix %*% vector_2
##      [,1]
## [1,] TRUE
## [2,] TRUE
## [3,] TRUE
S_T_matrix <- matrix(c(7, 9, 2, 1, 11, 19, 11, 77), nrow = 2, byrow = TRUE)

S_function(T_function(vector_2)) == S_T_matrix %*% vector_2
##      [,1]
## [1,] TRUE
## [2,] TRUE