Let

Then,

This method is about the same speed as the Gaussian-Elimination method. However, if you have already calculated det(A), using the formula may be slightly faster.

The formula provides an insight on why A is singular (not invertible) if det(A)=0. (Because, if det(A)=0, in the formula we would be dividing by 0 which is not allowed.)