> Hmm, well, I have to say I found it quite surprising that
> sum and integrate, for example, are not automatically declared linear.
But what if (a+b) is integrable as a sum, but a and b are not integrable
separately, e.g. 1/LOG(x)-1/LOG(x)^2? You really don't want linearity
applied!
> What about having a global linearity flag? E.g.,
> DECLARE_LINEAR_ALL_USUAL_SUSPECTS or something.
You can put together a batch file to define all your favorite settings,
and then load it either manually when you want, or as part of your
Maxima init file.
> Or, better still, how about a function simplify() to
> apply all known forms of simplification? There should be a
> function -- not several -- to apply the kinds of
> simplifications known to high school students, at least.
There is more than one definition of "simplest". It depends on what you
want to do with the expression, and even to some extent personal taste.
Which is simpler: sin(x/2)^2 or (1-cos(x))/2? You might say that a
fully factored polynomial is "simpler" than an expanded one, but which
is simpler: x^4-1 or (x-1)*(x+1)*(x^2+1)... or even
(x-1)*(x+1)*(x-%i)*(x+%i)? OK, maybe a fully expanded one is "simpler":
how about (x-1)^400? How far do you want to go with linearity? Do you
want f((a+b)/c) (linear f) to automatically become f(a/c)+f(b/c)? The
answer is surely "sometimes".
> As with nouns and verbs, when beginners (i.e., most people)
> have trouble with expand(log(a*b)) not simplifying, they're
> not going to think "Oh, I'd better set the LOGEXPAND flag" --
> they're going to think "Maxima is useless".
The names for many functions are misleading, I agree. On the other
hand, presumably you don't want the current Expand to be renamed as
Distribute_multiplication_over_addition.
Perhaps there should be a generic Expand that knows about all possible
kinds of expansion. But to control its application, it should only
operate on the top level of an expression. Expand, for example, has a
top-level equivalent, Multthru, but most other such functions don't.
Anyway, got to run.
-s