In mathematics, a cofactor is a signed minor, which is used in the calculation of a determinant of a matrix and in finding the inverse of a matrix. In biochemistry, a cofactor is a non-protein chemical compound that is required for the biological activity of a protein, often an enzyme.