<s>[INST] Given $BA$, find $AB$. If $A, B$ are $4\times 3, 3\times 4$ real matrices, respectively,
$$BA=\begin{bmatrix} -9 & -20 & -35 \\ 2 & 5 & 7 \\ 2 & 4 &8 \end{bmatrix}$$
$$AB=\begin{bmatrix} -14 & 0 & -15&-32 \\ 2x-9 & 1 & 3x-9&4x-19\\ 2 & 0 & 3&4\\6&0&6&14 \end{bmatrix}$$
What is $x$ ?
I try some ways, for example, $\det AB=0$, but it didn't work
 [/INST] Hint. By applying appropriate row and column operations on $AB$, we find that if
$$
P=\pmatrix{2&0&2&4\\ -1-2x&1&-3x&-1-4x\\ 2&0&3&4\\ 6&0&6&14},
\ P^{-1}=\pmatrix{\tfrac92&0&-1&-1\\ 3&1&x-1&\tfrac{-1}2\\ -1&0&1&0\\ \tfrac{-3}2&0&0&\tfrac12},
$$
then
$$
(PA)(BP^{-1}) = \pmatrix{0&0&0&0\\ 0&1&x&0\\ 0&0&1&0\\ 0&0&0&2}.\tag{1}
$$
Let $PA=\pmatrix{a^T\\ A_1}$ and $BP^{-1}=\pmatrix{b&B_1}$ where $a,b\in\mathbb{R}^3$ and $A_1,B_1\in M_3(\mathbb{R})$. Since $BA$ is invertible, we must have $\operatorname{rank}(PA)=\operatorname{rank}(BP^{-1})=3$ (why?). Hence argue that $a=b=0$ and $A_1B_1=\pmatrix{1&x&0\\ 0&1&0\\ 0&0&2}$. Yet, $A_1B_1$ is similar to $B_1A_1$, and $B_1A_1=BA$ is diagonalisable (exercise). Hence there is only one possible value of $x$, which is ...

P.S. A pair of feasible $A,B$ is given by
$$
A = \pmatrix{0&-1&0\\ 0&-1&\tfrac12\\ -2&-3&-7\\ 1&2&\tfrac72},
\ B = \pmatrix{-57&-7&-66&-141\\ 14&0&15&32\\ 10&2&12&26}.
$$
</s>