Find Matrix $P$ so $B=PA$ I have this problem. 
$$A =  \left(\begin{array}{ccc}
1 & 2 & 3 \\
2 & 4 & 6 \\
1 & 2 & 3 \end{array}\right)$$
$$B =  \left(\begin{array}{ccc}
1 & 2 & 3 \\
0 & 0 & 0 \\
0 & 0 & 0 \end{array}\right)$$
Find matrix $P$ invertible so $B=PA$.
It's pretty clear in this case.
But I wonder is there a way to find such a matrix in general case, when it's not obvious.
Any help will be appreciated.
 A: By row reducing, you can find matrices $P_1,P_2$ such that $P_1A$ and $P_2B$ are in the same row-echelon form.  From there, we can say that
$$
P_1A = P_2B \implies B = (P_2^{-1}P_1)A
$$
This will work whenever such a $P$ exists.

For your example: note that $B$ is in row-echelon form.  So, in this case, we have $P_2 = I$.  For $A$, we have
$$
\pmatrix{
1&2&3&&1&0&0\\
2&4&6&&0&1&0\\
1&2&3&&0&0&1} 
\mathop{\leadsto}^{R_3\to R_3-R_1}\cdots
\mathop{\leadsto}^{R_2\to R_2-2R_1}\\
\pmatrix{
1&2&3&&1&0&0\\
0&0&0&&-2&1&0\\
0&0&0&&-1&0&1} 
$$
So, 
$$
P_1 = \pmatrix{
1&0&0\\
-2&1&0\\
-1&0&1
}
$$
A: Let's say you wanted to find such $P$ that $$B = AP\text{.}$$ Let $p_1$, $p_2$ and $p_3$ be the columns of the matrix $P$, i. e. $P = [p_1\quad p_2 \quad p_3]$. Do the same for $B$. The upper linear system is equivalent to the following systems:
$$Ap_1 = b_1,\quad Ap_2 = b_2\quad\text{and}\quad Ap_3 = b_3\text{.}$$
You should be able to solve those three. From $p_j$'s you can reconstruct $P$.
Since you have to solve $B = PA$, you can transpose that relation ($B^T = A^T P^T$) and reduce this problem to the previous one. Solve the system $B^T = A^T Q$. You may find multiple (or no) solutions $Q$ if $A$ (hance $A^T$) is not invertible.
If you want an invertible $P$, find an invertible solution $Q_i$ among $Q$'s and define $P = Q_i^T$.
A: when you row reducing a matrix $A$ by hand, it is much easier to keep track of the row operations, if we augment the matrix $A$ with a column like this:
$ \left( \begin{array}{lll|l} 1 & 2 & 3 & a\cr 2 & 4 & 6 & b\cr 1 & 2 & 3 & c\end{array} \right) \to 
\left( \begin{array}{lll|l} 1 & 2 & 3 & a\cr 0 & 0 & 0 & -2a + b\cr 
0 & 0 & 0 & -a+c\end{array} \right) 
$
you decode this as multiplying by the matrix $E$ on the left where 
$ E \pmatrix{a \cr b\cr c}=\pmatrix{1 & 0 & 0\cr-2 & 1 & 0\cr -1 & 0 & 1}\pmatrix{a\cr b\cr c\cr d} =  \pmatrix{a &\cr-2a+b\cr -a+c}.$ 
that is $EA = U.$ of course, if you are calculator or computer matrix software, you augment by the identity matrix as suggested by others.
