The factor function is a little bit silly.



On Mon, Apr 7, 2008 at 1:45 PM, J.C. Pizarro <jcpiza at gmail.com> wrote:
>  The below symbolic example doesn't terminate after many minutes in
>  maxima-5.14.0 although the human solution is f(x)-g(x)-h(x):
>
>  factor(expand((f(x)-g(x)-h(x))^500));
>
>  To fix this problem in the future: better artificial sustitution in the
>  solving of factor or intelligent lazy computation as
>  factor(expand(Alpha)) => Alpha.

Though it would be possible in principle to keep track of how an
object was calculated, and to use that information later, I'm not sure
that it is useful very often.  And as others have pointed out, it is
not straightforward to use that information correctly.  For example,
factor(expand( (1-sqrt(x))*(1+sqrt(x)) )) should be 1-x, not
(1-sqrt(x))*(1+sqrt(x)).

>  factor(expand((sqrt(x+a)+b)^10)) =>
>  10 b x^4 sqrt(x+a) + 120 b^3 x^3 sqrt(x+a) + ... + 45 a^4 b^2 + a^5

Factor factors multivariate polynomials which, by definition, have
integral powers.  It does not in general factor objects with
fractional exponents, or into objects with fractional exponents.  I am
not even sure that that is well-defined.  For example, surely you
don't want factor(x) => sqrt(x)^2 ?

As for sqrt2, as far as Maxima is concerned, that is an undefined
function, so sqrt2(x)^2 == sqrt2(x)^2.  sqrt(x) on the other hand is
defined as x^(1/2), so sqrt(x)^2 => x.

             -s