The thing of it is that in general, it is not a good idea to calculate the inverse of a matrix. IIRC, that isn an O(n**3) operation. Most times, one solves a system of linear equations by first reducing the n x n matrix to Row-Reduced Echelon Form through Gaussian Elimination. If the matrix has full rank (a fancy way of saying that the system is uniquely solvable), then it is trivial to solve the system.