inverse of a matrix with determinants