# How find the matrix $K$ such $AKB=C$

Question:

Find a matrix $K$ such that $$AKB=C$$ given that $$A=\begin{bmatrix} 1&4\\ -2&3\\ 1&-2 \end{bmatrix},B=\begin{bmatrix} 2&0&0\\ 0&1&-1 \end{bmatrix} ,C=\begin{bmatrix} 8&6&-6\\ 6&-1&1\\ -4&0&0 \end{bmatrix}$$

My try: $K=A^{-1}CB^{-1}$, but this matrix $A,B$ is not a square matrix, so the inverses $A^{-1}$ and $B^{-1}$ do not exist... So, how to find $K$ ?

Thank you

$$K=(A^{T}A)^{-1}A^TCB^T(BB^{T})^{-1}$$ You can also solve a equation,K is a 2X2 matrix

• How can have this form? can you expalin? – china math Jul 8 '14 at 3:48
• @chinamath Notice first that the expressions $A^TA$ and $BB^T$ are square matrices, and so can conceivably have inverses (in fact, since the columns of $A$ $B^T$ are linearly independent, they must). Then, try left multiplying the expression $$AKB = C$$ by $A^T$, then right multiplying by $B^T$. – Strants Jul 8 '14 at 3:54
• What happens if $A$ or $B$ is singular? – Learning Jul 8 '14 at 4:04
• @Mr.T The matrix equation $AKB=C$ can be changed to an "ordinary" system of equations by using the vectorisation and Kronecker product. This is the way to go for general $A$ and $B$ which do not have a suitable inverse. – Algebraic Pavel Jul 8 '14 at 8:14

Naive, but simple approach:

If we let $K = \begin{bmatrix}k_1 & k_2 \\ k_3 & k_4 \end{bmatrix}$, then we have:

$AKB = \begin{bmatrix}1&4\\-2&3\\1&-2\end{bmatrix} \begin{bmatrix}k_1 & k_2 \\ k_3 & k_4 \end{bmatrix} \begin{bmatrix}2&0&0\\0&1&-1\end{bmatrix} = \begin{bmatrix}2k_1+8k_3&k_2+4k_4&-k_2-4k_4\\-4k_1+6k_3&-2k_2+3k_4&2k_2-3k_4\\2k_1-4k_3&k_2-2k_4&-k_2+2k_4\end{bmatrix}$

Set this equal to $C=\begin{bmatrix}8&6&-6\\6&-1&1\\-4&0&0\end{bmatrix}$ and solve:

$2k_1+8k_3 = 8$

$2k_1-4k_3 = -4$

$k_2+4k_4 = 6$

$k_2-2k_4 = 0$

This gives two pairs of $2$ variable $2$ equation systems.

Just explicitly deriving windwalk's solution here.

\begin{align} AKB &= C \\ A^tAKBB^t &= A^tCB^t \\ (A^tA)^{-1}A^tAKBB^t(BB^t)^{-1} &= (A^tA)^{-1}A^tCB^t(BB^t)^{-1} \\ K &= (A^tA)^{-1}A^tCB^t(BB^t)^{-1} \end{align}