2

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?

flonk
  • 3,726
  • 3
  • 24
  • 37
  • 1
    After I wrote the answer below, a friend mentioned you might just want to see the result of the division. Is that the case? If so, try: `evala((1-z-z^3)/z0[1])`. – Erik P. Sep 18 '15 at 18:59
  • 1
    I wonder whether by "factor out the first root" he means that he wants to deflate by the `z-z0[1]` factor, given that `1-z-z^3=(z-z0[1])*(z-z0[2])*(z-z0[3])` when fully expanded and simplified (by radnormal or evala/Normal, say). So, rather than divide by `z0[1]` he may wish to divide by `z-z0[1]`. Or use `evala(Divide(1-z-z^3,z-z0[1],'q'))` where `q` is thus assigned by side-effect the quotient which should equal `(z-z0[2])*(z-z0[3])` under normalization. – acer Sep 19 '15 at 20:03

1 Answers1

1

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)));
Erik P.
  • 1,577
  • 10
  • 18
  • The answer produced by your code is interesting, but seems more convoluted (with nested **RootOf**s) than it needs to be. Do you have any problem with the simpler (and simpler to get) answer provided by **factor(1-z-z^3, RootOf(1-z-z^3))**, assuming that we already know that the polynomial is irreducible over *Q*? Unrelated comment: The syntax **specfunc(RootOf)** is a recent (and welcome) innovation. Older Maple will need **specfunc(anything, RootOf)**. – Carl Love Sep 18 '15 at 18:44
  • 1
    No problem whatsoever with it, @CarlLove. I had somehow acquired the idea that the user wanted the answer expressed in terms of the roots he received from `solve`, but that's not explicitly mentioned in the question at all. – Erik P. Sep 18 '15 at 18:52