maxima error: Quotient by a polynomial of higher degree



Dear all,

I am trying to do some computations using maxima. The following are the
codes. There is an error: Quotient by a polynomial of higher degree when I
am trying to compute: ratsimp(R(1,2,R(2,3, R(1,2,[c_one,c_two,c_three])))
-R(2,3,R(1,2, R(2,3,[c_one,c_two,c_three]))));

How could I fix this problem? Thank you very much.

All the best,
Jianrong.


c_one:matrix([a, 0, 0],[d, b, 0],[f, e, c]);
c_two:matrix([a1, 0, 0],[d1, b1, 0],[f1, e1, c1]);
c_three:matrix([a2, 0, 0],[d2, b2, 0],[f2, e2, c2]);

s_action(m):=matrix([m[3,3],m[
2,3],m[1,3]],[m[3,2],m[2,2],m[1,2]],[m[3,1],m[2,1],m[1,1]]);


s_on_product(a,m):=[matrix([(a[3,3]*(a[1,1]*a[2,2]*m[2,2]*a[3,3]*m[3,1]^2+a[2,2]*m[2,2]*a[3,3]*m[3,3]*a[3,1]*m[3,1]+
a[1,1]*m[1,1]*a[2,2]*m[2,2]*a[3,1]*m[3,1]-a[1,1]*a[2,2]*a[3,3]*m[2,1]*m[3,2]*m[3,1]+
a[1,1]*a[2,2]*m[2,2]*m[2,1]*a[3,2]*m[3,1]-a[2,2]*a[3,3]*m[3,3]*a[2,1]*m[2,1]*m[3,1]-
m[1,1]*a[3,3]*m[3,3]*a[2,1]^2*m[3,1]+m[1,1]*a[2,2]*m[2,2]*m[3,3]*a[3,1]^2-a[2,2]*a[3,3]*m[3,3]*m[2,1]*m[3,2]*a[3,1]-
a[1,1]*m[1,1]*a[2,2]*m[2,1]*m[3,2]*a[3,1]-m[1,1]*a[3,3]*m[3,3]*a[2,1]*m[3,2]*a[3,1]-
m[1,1]*m[2,2]*m[3,3]*a[2,1]*a[3,2]*a[3,1]+a[2,2]^2*m[3,3]*m[2,1]^2*a[3,1]+m[1,1]*a[2,2]*m[3,3]*a[2,1]*m[2,1]*a[3,1]-
a[1,1]*a[2,2]*m[2,1]^2*a[3,2]*m[3,2]-a[2,2]*m[3,3]*a[2,1]*m[2,1]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1,1]*a[3,3]*a[2,1]*m[3,2]*m[3,1]+a[1,1]*m[2,2]^2*a[3,2]^2*m[3,1]-m[2,2]*a[3,3]*m[3,3]*a[2,1]*a[3,2]*m[3,1]-a[1,1]*m[1,1]*m[2,2]*a[2,1]*a[3,2]*m[3,1]+m[1,1]*a[2,2]*m[2,2]*m[3,3]*a[3,1]^2-a[1,1]*m[1,1]*a[3,3]*m[3,2]^2*a[3,1]-a[1,1]*m[1,1]*m[2,2]*a[3,2]*m[3,2]*a[3,1]+a[2,2]*m[2,2]*m[3,3]*m[2,1]*a[3,2]*a[3,1]-m[1,1]*m[2,2]*m[3,3]*a[2,1]*a[3,2]*a[3,1]-a[1,1]*a[3,3]*m[2,1]*a[3,2]*m[3,2]^2-a[1,1]*m[2,2]*m[2,1]*a[3,2]^2*m[3,2]-m[2,2]*m[3,3]*a[2,1]*m[2,1]*a[3,2]^2))/((a[3,3]*m[3,1]+m[1,1]*a[3,1]+m[2,1]*a[3,2])*(a[2,2]*m[2,2]*a[3,3]*m[3,1]+m[1,1]*a[2,2]*m[2,2]*a[3,1]-a[2,2]*a[3,3]*m[2,1]*m[3,2]-m[1,1]*a[3,3]*a[2,1]*m[3,2]-m[1,1]*m[2,2]*a[2,1]*a[3,2]))])];


s_on_product(c_one,c_two);

R(i,j,l):=block([r],

  if(i=1 and j=2) then r:[s_on_product(s_action(l[2]),
  s_action(l[1]))[1], s_on_product(s_action(l[2]), s_action(l[1]))[2], l[3]]

  else if(i=2 and j=3) then r:[l[1], s_on_product(s_action(l[3]),
s_action(l[2]))[1],
  s_on_product(s_action(l[3]), s_action(l[2]))[2]],

  r


);

ratsimp(R(1,2,R(2,3, R(1,2,[c_one,c_two,c_three])))-R(2,3,R(1,2,
R(2,3,[c_one,c_two,c_three]))));