[Maxima] realonly in algsys.lisp

Alexey Beshenov al at beshenov.ru
Sun Apr 26 05:05:35 CDT 2009

The option variable realonly is quite confusing since it does not find
real solutions, but only solutions which are free of %i (purely using

For example, when realonly is false,

  algsys ([x^4 + 1], [x]);


  [[x = (-1)^(1/4)],  [x = -(-1)^(1/4)*%i],
   [x = -(-1)^(1/4)], [x = (-1)^(1/4)*%i]]

But when realonly is true, it returns

  [[x = (-1)^(1/4)], [x = -(-1)^(1/4)]]

while it is natural to expect [].

Maybe it is better to modify the behavior and filter roots by
checking something like

  is_real(x) := is(trigsimp(imagpart(x)) = 0);

and not just

  freeof(%i, x)

With the freeof approach we may also omit real roots of irreducible

  sol : map ('rhs, solve (3*x^3  - 3*x + 1));

  map (lambda([x], freeof(%i, x)), sol);

  map ('is_real, sol);

So when realonly and algexact are set to true,

  algsys ([3*x^3  - 3*x + 1], [x])

just returns [].

What do you think?

Yours sincerely,
Alexey Beshenov <al at cadadr.org>

More information about the Maxima mailing list