# How to solve for matrix $X$ in equation?

There are two matrices $$A = \begin{bmatrix}3&2\\1&4\end{bmatrix}$$ and $$B = \begin{bmatrix}2&1&-4\\0&-2&2\end{bmatrix}$$ I have to solve for matrix $$X$$ in this equation $$6X + B^T = XA$$ I tried getting rid of $$A$$ through multiplying both sides by the inverse of $$A$$, but I can't get any further than that. What is it that I'm missing?

Note that$$6X+B^T=XA\iff B^T=X(A-6\operatorname{Id}_2).$$So, take$$X=B^T(A-6\operatorname{Id}_2)^{-1}=\begin{bmatrix}-1 & -1 \\ 0 & 1 \\ \frac{3}{2} & \frac{1}{2}\end{bmatrix}.$$