On Fri, Sep 23, 2011 at 08:55, Karl-Dieter Crisman <kcrisman at gmail.com>wrote:
> > factor(b)
>
Barton has pointed out that you actually need scanmap(factor,b).
> But of course the idea is not how to make it happen, but rather what
> the default behavior is.
Two issues actually:
1) default value of radexpand
2) how hard general simplification should work in analyzing expressions.
Maxima general simplification does not do major reorganizations of
expressions, such as factoring. This was a design decision (a long time
ago) with two major parts: 1) let the user control the *form* of expression
as well as its meaning; 2) don't spend potentially large amounts of time on
general simplification.
See Joel Moses' Algebraic Simplification: a guide for the
perplexed<http://portal.acm.org/citation.cfm?id=806298>(1971) for
background.
Since computers are 1000x faster now than when Maxima was designed (though
Maxima is not 1000x faster), we might want to revisit (2), but (1) remains
an important principle. The following expressions are all mathematically
equivalent:
(x^2-1)/x^2
(1-1/x)*(1+1/x)
1-1/x^2
(x-1)*(x+1)/x^2
but each form may be more useful to the user in a different content. Of
course, general simplification does do some normalization, so it doesn't
preserve (x-1)/x * (x+1)/x.
Having sqrt(x^2-2*x+1) simplify to abs(x-1) requires finding the square
factors of the inner expression, which is more a bigger transformation than
general simplification normally does.
-s
> On Sep 23, 2011 2:56 AM, "Dmitry Shkirmanov" <piminusmeson at bk.ru>
> wrote:
> > I found radexpand option variable in the reference manual:
> >> radexpand
> >> Option variable
> >> Default value: true
> >> radexpand controls some simpli?cations of radicals.
> >> When radexpand is all, causes nth roots of factors of a product which
> >> are powers
> >> of n to be pulled outside of the radical. E.g. if radexpand is all,
> >> sqrt (16*x^2)
> >> simpli?es to 4*x.
> >> More particularly, consider sqrt (x^2).
> >> ? If radexpand is all or assume (x > 0) has been executed, sqrt(x^2)
> >> simpli?es
> >> to x.
> >> ? If radexpand is true and domain is real (its default), sqrt(x^2)
> >> simpli?es to
> >> abs(x).
> >> ? If radexpand is false, or radexpand is true and domain is complex,
> >> sqrt(x^2)
> >> is not simpli?ed.
> >> Note that domain only matters when radexpand is true.
> >
> > But it does not work for me(version of maxima is 5.25.1):
> >
> > (%i1) radexpand:true;
> > (%o1) true
> > (%i2) b: ((1-x)/sqrt(1-2*x+x^2));
> > 1 - x
> > (%o2) ------------------
> > 2
> > sqrt(x - 2 x + 1)
> > (%i3) radcan(b);
> > (%o3) - 1
> > (%i4) radexpand: false;
> > (%o4) false
> > (%i5) radcan(b);
> > (%o5) - 1
> >
>
> maybe the default is now all instead of true?
>
>
> >
>
>
>
> >>
> http://ask.sagemath.org/question/767/simplification-errors-in-simple-expressions
> >> which seems to find a bug in radcan. Here is the relevant Maxima
> >> session.
> >>
> >>
> >> (%i3) b:((1-x)/sqrt(1-2*x+x^2));
> >> 1 - x
> >> (%o3) ------------------
> >> 2
> >> sqrt(x - 2 x + 1)
> >> (%i4) radcan(b);
> >> (%o4) - 1
> >>
> >> which seems a little aggressive.
> >
> > Radcan will consistently choose a branch for the square root. It may not
> be
> > the one you would choose, but it does so by picking a main variable
> (here, x
> > is the only one) and looking at the sign of the leading coefficient. If
> it
> > is negative, it takes out a factor of sqrt(-1).
>
>
> I see. That should probably be more explicit in the documentation for
> radcan, then. Or?
>
>
> >>
> >> (%i7) d:((1-x)/sqrt((1-x)^2));
> >> 1 - x
> >> (%o7) ----------
> >> abs(x - 1)
> >
> > This of course has nothing to do with radcan, and I personally view this
> > transformation as a bug.
> > A correct result for d is a representation of the pair {-1,1}. The answer
> > above is neither 1, -1, or the pair, but a step function except at x=1
> where
> > it is possibly undefined.
>
> Right. So you are saying that (1-x)/abs(x-1) is NOT a function, but
> purely a symbolic expression which may happen to take on the value 1
> or -1? But that is not how most users of Maxima will see it, I think.
>
> >> doesn't give very many details. But I'm certainly not an expert in
> >> making expressions canonical :)
> >
> > There's plenty of detail in my PhD dissertation, TR-95, MIT Project MAC.
> > http://publications.csail.mit.edu/lcs/specpub.php?id=663
>
> Yes, since you *are* an expert.
>
> Which reiterates my suggestion that radcan could have a lot more
> detail in its documentation (and not pointing to a dissertation...)
>
> +++
>
> Thanks for all three of your suggestions.
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>