<<VilGebra`

A={{-1+x,1+x,-1+x},{2,3,4},{-2+x,2+x,-7+x}};
InversaCP[A]

{{-1+x,1+x,-1+x,1,0,0},{2,3,4,0,1,0},{-2+x,2+x,-7+x,0,0,1}}/.x->1//MatrixForm
InversaSP[Take[%,All,3]]

{{1,((1+x)/(-1+x)),1,(1/(-1+x)),0,0},{0,((-5+x)/(-1+x)),2,-(2/(-1+x)),1,0},{0,((2 x)/(-1+x)),-5,-((-2+x)/(-1+x)),0,1}}/.x->5//MatrixForm
InversaSP[Take[%,All,3]]

{{1,0,-((7+x)/(-5+x)),(3/(-5+x)),-((1+x)/(-5+x)),0},{0,1,((2 (-1+x))/(-5+x)),-(2/(-5+x)),((-1+x)/(-5+x)),0},{0,0,-((-25+9 x)/(-5+x)),-((-10+x)/(-5+x)),-((2 x)/(-5+x)),1}}/.x->25/9//MatrixForm
InversaSP[Take[%,All,3]]