Find all matrices that satisfy $\mathrm B \mathrm A = \mathrm I_2$ 
Given the matrix $$A=\begin{pmatrix}1&8\\3&5\\2&2\\ \end{pmatrix}$$ find all $2 \times 3$ matrices in $B \in M_{2 \times 3}(\mathbb R)$ with $BA=I_2$.

Here's what I did:
$$\begin{pmatrix}a&b&c\\d&e&f\\ \end{pmatrix} \begin{pmatrix}1&8\\3&5\\2&2\\ \end{pmatrix} = \begin{pmatrix}1&0\\0&1\\ \end{pmatrix}$$
and then multiplying things out:
$$\begin{pmatrix} {a+3b+2c}&{8a+5b+2c}\\{d+3e+2f}&{8d+5e+2f}\\ \end{pmatrix} = \begin{pmatrix}1&0\\0&1\\ \end{pmatrix}$$
So would I just set
$$a+3b+2c=1$$
$$8a+5b+2c=0$$
$$d+3e+2f=0$$
$$8d+5e+2f=1$$
But then this gives $4$ equations in $6$ unknowns, so wouldn't there be infinitely many solutions? Did I do this correctly? Matrices aren't my strong point...
Thanks. 
 A: Since the second column is not a multiple of the first column, the matrix $\pmatrix{1 & 8\cr 3 & 5\cr 2 & 2\cr}$ has rank $2$.  That implies that a solution exists.  One way to get a solution is to take any two rows of $A$ (check that they are linearly independent) and use the inverse of that $2 \times 2$ matrix for the corresponding columns of $B$, and $0$'s in the other column.  Thus if you take the first two rows of $A$, the inverse of $\pmatrix{1 & 8\cr 3 & 5\cr}$ is $\pmatrix{-5/19 & 8/19\cr 3/19 & -1/19\cr}$, corresponding to 
$B = \pmatrix{-5/19 & 8/19 & 0\cr 3/19 & -1/19 & 0\cr}$. 
For the general solution, write the system using block matrices as 
$$ [ B_1 \ b ] \left[\matrix{A_1\cr a^T\cr} \right] = B_1 A_1 + b a^T = I$$
(where $B_1$ and $A_1$ are $2 \times 2$, $b$ is $2 \times 1$ and $a^T$ is $1 \times 2$).  We can solve for $B_1$ in terms of $b$: $B_1 = (I - b a^T) A_1^{-1}$.  We already have $A_1^{-1} = \pmatrix{-5/19 & 8/19 \cr 3/19 & -1/19 \cr}$, so with $b = \pmatrix{b_1\cr b_2}$ and $a^T = (2, 2)$ we get
$$ B_1 = \pmatrix{1 - 2 b_1 & - 2 b_1\cr -2 b_2 & 1 - 2 b_2\cr}  \pmatrix{-5/19 & 8/19 \cr 3/19 & -1/19 \cr} = \pmatrix{ (-5 + 4 b_1)/19 & (8 - 14 b_1)/19\cr
(3 + 4 b_2)/19 & (-1 - 14 b_2)/19\cr}$$
i.e. 
$$ B =  \pmatrix{ (-5 + 4 b_1)/19 & (8 - 14 b_1)/19 & b_1\cr
(3 + 4 b_2)/19 & (-1 - 14 b_2)/19 & b_2\cr}$$
where $b_1$ and $b_2$ are arbitrary.
A: The variables of the first two equations do not occur in the last two equations and vice versa. You therefore can independently solve two systems of two equations with three unknowns each. This gives you two solutions with one free variable in each of them:
$$
B = \pmatrix{ a & -\frac{1}{2}(7a+1) & \frac{1}{4}(19a+5)\cr
d & \frac{1}{2}(1-7d) & \frac{1}{4}(19d-3)\cr}
$$
A: A general method. 
Let $A\in M_{n,m}$ with $n\geq m$ and $rank(A)=m$. Find the matrices $X\in M_{m,n}$ s.t. $XA=I_m$.
Step 1. The pseudo inverse  is a particular solution $A^+=(A^*A)^{-1}A^*$.
Step 2. The general solution. $X=A^++W(I_n-AA^+)$ where $W\in M_{m,n}$ is arbitrary.
Remark. We look for $mn$ unknowns linked by $m^2$ equations. Then, in general, the general solution depends on $m(n-m)$ independent parameters. We can see that, looking for $dim(im(W(I-AA^+)))=dim(im((I-AA^+)^TW^T))=(n-m)m$ because $rank((I-AA^+)^T)=n-m$ and $W^T$ has $m$ columns.
A: We are given a thin matrix $\mathrm A \in \mathbb R^{m \times n}$ and would like to find a fat matrix $\mathrm X \in \mathbb R^{n \times m}$ such that 
$$\mathrm X \mathrm A = \mathrm I_n$$
In other words, we want to find a left inverse of $\mathrm A$. Since $m > n$, we have an underdetermined system of $n^2$ equations in $m n$ unknowns. Hence, we look for the least-norm solution
$$\begin{array}{ll} \text{minimize} & \|\mathrm X\|_F^2\\ \text{subject to} & \mathrm X \mathrm A = \mathrm I_n\end{array}$$
We define the Lagrangian as follows
$$\mathcal{L} (\mathrm X, \Lambda) := \frac 12 \|\mathrm X\|_F^2 - \langle \Lambda, \mathrm X \mathrm A - \mathrm I_n\rangle = \mbox{tr} \left( \frac 12 \mathrm X^T \mathrm X - \Lambda^T (\mathrm X \mathrm A - \mathrm I_n)\right)$$
Taking the partial derivatives with respect to $\mathrm X$ and $\Lambda$ and finding where they vanish, we obtain
$$\mathrm X = \Lambda \mathrm A^T \qquad \qquad \qquad \mathrm X \mathrm A = \mathrm I_n$$
Assuming that $\mathrm A$ has full column rank, the least-norm solution is
$$\bar{\mathrm X} := (\mathrm A^T \mathrm A)^{-1} \mathrm A^T$$
Note that $\bar{\mathrm X} \mathrm A = (\mathrm A^T \mathrm A)^{-1} \mathrm A^T \mathrm A = \mathrm I_n$.
