unsimplifed result from expand



Another example:

 (%i32) p : z^3-2^(3/2)*%i*z^2-4*z^2+2^(5/2)*%i*z+2*z;
 (%o32) z^3-2^(3/2)*%i*z^2-4*z^2+2^(5/2)*%i*z+2*z

 (%i33) divide(p, (z-2-sqrt(2)*%i),z);
 (%o33) [z^2+((sqrt(2)-2^(3/2))*%i-2)*z,-(2^(3/2)-2^(5/2))*%i-2^(3/2)*%i]

We need to apply expand twice to simplify the remainder to zero:

 (%i34) expand(%);
 (%o34) [z^2-2^(3/2)*%i*z+sqrt(2)*%i*z-2*z,2^(5/2)*%i-2^(5/2)*%i]

 (%i35) expand(%);
 (%o35) [z^2-2^(3/2)*%i*z+sqrt(2)*%i*z-2*z,0]

Also:

 (%i37) gcd(p, diff(p,z),z), gcd : spmod, algebraic : true;
 (%o37) 1

 (%i38) gcd(p, diff(p,z),z), gcd : subres, algebraic : true;
 (%o38) z-sqrt(2)*%i-2

--Barton