Search code examples
symbolic-mathmaplecomputer-algebra-systems

How to factorize this 3rd order polynomial with maple


There is some behavior of maple, that I do not understand. Say I want to factorize the polynomial 1-z-z^3, so I compute its roots using

z0 := solve(1-z-z^3=0,z);

which gives (just for completeness...)

z0 := 1/6*(108+12*93^(1/2))^(1/3)-2/(108+12*93^(1/2))^(1/3), -1/12*(108+12*93^(1/2))^(1/3)+1/(108+12*93^(1/2))^(1/3)+1/2*I*3^(1/2)*(1/6*(108+12*93^(1/2))^(1/3)+2/(108+12*93^(1/2))^(1/3)), -1/12*(108+12*93^(1/2))^(1/3)+1/(108+12*93^(1/2))^(1/3)-1/2*I*3^(1/2)*(1/6*(108+12*93^(1/2))^(1/3)+2/(108+12*93^(1/2))^(1/3))

Now if I try to factor out the first root,

factor(1-z-z^3,z0[1]);

i get

Error, (in factor) 2nd argument, 1/6*(108+12*93^(1/2))^(1/3)-2/(108+12*93^(1/2))^(1/3), 
is not a valid algebraic extension

What does this mean? Is this a bug, or is the expression for z0[1] just too complicated? If the second is true, what is a better practice for factorizing polynomials of order, say, 3 to 4?


Solution

  • The problem is that Maple wants, specifically, a RootOf or rational power expression, or set of them, as its second argument. So for example,

    factor(x^2-2, 1+sqrt(2))
    

    will not work, whereas

    factor(x^2-2, sqrt(2))
    

    does. Similarly, in your example, you'll want to extract the rational powers from the expression that you solved for. You can do that as follows:

    factor(1-z-z^3, indets(z0[1], anything^And(rational, Non(integer))))
    

    or maybe a little less contrived:

    with_rootof := convert(z0[1], RootOf);
    factor(1-z-z^3, indets(with_rootof, specfunc(RootOf)));