cramer:=proc (A,b) local Aj,x,j,n,i,detA; detA := det(A); n := op(2,op(2,eval(A))[1]); for j to n do Aj := concat(seq(col(A,i),i=1..(j-1)), b, seq(col(A,i),i=j+1..n)); x := [op(x), det(Aj)/detA]; od; RETURN( x ); end: # cramer