<s>[INST] solve matrix equation $2AX-X^TA=B$ Given matrices $A=\begin{pmatrix}
2 & 4\\ 
3 & 6
\end{pmatrix},B=\begin{pmatrix}
3 & -6\\ 
 7&-4 
\end{pmatrix}$
Find all matrices $X\in M_2(\mathbb{R})$ such that
$$2AX-X^TA=B$$
I have no idea how to do it.
 [/INST] Let $X = \begin{bmatrix}x_1&x_2\\x_3&x_4\end{bmatrix}$. Then we have
$\begin{bmatrix}4 & 8\\ 6&12\end{bmatrix}\cdot\begin{bmatrix}x_1&x_2\\x_3&x_4\end{bmatrix}-\begin{bmatrix}x_1&x_3\\x_2&x_4\end{bmatrix}\cdot\begin{bmatrix}2&4\\3&6\end{bmatrix}=\begin{bmatrix}3&-6\\7&-4\end{bmatrix}.$
Matching entries gives the system $(4x_1+8x_3)-(2x_1+3x_3)=3\tag{1}$
$(4x_2+8x_4)-(4x_1+6x_3)=-6\tag{2}$
$(6x_1+12x_3)-(2x_2+3x_4)=7\tag{3}$
$(6x_2+12x_4)-(4x_2+6x_4)=-4\tag{4}$.
We can represent this as the augmented matrix $\begin{bmatrix}2&0&5&0&3\\-4&4&-6&8&-6\\6&-2&12&-3&7\\0&2&0&6&-4\end{bmatrix}$
Rewriting this matrix in reduced row echelon form gives
$\begin{bmatrix}1&0&0&\dfrac{5}{2}&-\dfrac{7}{2}\\0&1&0&3&-2\\0&0&1&-1&2\\0&0&0&0&0\end{bmatrix}.$
Hence all desired matrices are of the form
$\begin{bmatrix}-\dfrac{5}{2}k-\dfrac{7}{2}&-3k-2\\k+2&k\end{bmatrix},$ where $k\in\mathbb{R}$.
</s>