Say, we have a matrix
$$f=\begin{bmatrix} x& 2x\\ 3x& x+2 \end{bmatrix}.$$
Say we have a matrix another matrix represented by
$$g=\begin{bmatrix} 5x& 6x \\ 4x& x-1 \end{bmatrix}$$
Is there a way to calculate $$f(g(x))?$$ If so, how would it be performed in this example? I'm assuming it wouldn't be a strict multiplication, rather some use of a chain rule. I am not exactly sure how to proceed.