2015-01-27 11:54:09 -0500 answered a question Large symbolic determinant I have the same problem. I am trying to compute the determinant of f, for some given matrix A and with I being the identity. I want the determinant to be a function of x , y, and m, or at least a function of x and y for some fixed m. I should be getting a polynomial in two variables, x and y. The entries of the original matrix A are all of the form a+b*sqrt(m) with a and b being integers. Here is my routine. Assume A has been defined. m=3 x, y = PolynomialRing(RationalField(), 2, ['x','y']).gens() f=((x+y*sqrt(m))*I-A).determinant() d=f.expand().collect(sqrt(m)) d  It works fine if A is a 4x4 matrix, but if I raise it to a 9x9 matrix, SAGE simply locks up right at the second line where I define f. I let it run overnight (about 14 hours) and nothing happened. My level of experience with SAGE is rather limited, but the fact that it works with small size matrices tells me that I have done -- I hope -- nothing wrong. In fact, SAGE does not return error messages; it simply stops. Does anyone have any suggestion?