# How to solve equation using inverse matrix method?

I'm trying to solve the following equation:

$$AX=B$$

where $A=\begin{bmatrix}1 & 5\\2 & 3\\-4 & 1\end{bmatrix}$, $B=\begin{bmatrix}1 & 2 & 5\\2 & 4 & 3\\-4 & -8 & -1\end{bmatrix}$

Usually I multiply both sides of the equation by $A^{-1}$ which results in $X=BA^{-1}$

However, matrix $A$ is not a square matrix so I cannot get its inverse. What I tried to do is multiply both sides of the equation by $B^{-1}$ and I get $AB^{-1}X=1$. But again I have no idea how to solve this.

Any tips on how to do this appreciated. Thx

Let $$X = \left[\begin{array}{ccc}a&b&c\\d&e&f\end{array}\right]$$
$$\begin{array}{lrcl} (1) & c+5f &=& 5 \\ (2) & 2c+3f&=&3 \\ (3) &-4c+f &=& -1 \end{array}$$
Then $(3)+2\cdot(2)$ reveals $$f = \frac{5}{7}$$ but $(3)+4\cdot(1)$ reveals that $$f=\frac{19}{21}$$ a contradiction. Thus you system has no solution.
• thx. In your answer I believe (1) should be $a+5d = 1$ . Wondering if it's the simplest method to solve this eq, cause solving this would need solving 3 equation systems if the eq was solvable? – user45430 Jan 12 '14 at 15:06
You should get $X=A^{-1}B$ when you do what you say you do. But to answer your question, if $A'A$ is invertible then $X=(A'A)^{-1}A'B$ is the value of $X$ that minimizes the norm of $AX-B$ so if there is a solution then $X$ would be it. More generally, read up on Moore-Penrose inverses.