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

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.
