Is there a way to control how exponentials are factored



I don't think simplification has anything to do with this.  'factor' is
defined over rational functions; input to 'factor' is converted to a
rational function using the CRE subsystem (rat), so something of the form
A+1/B is treated as (A*B+1)/B.  In the case of %e^-x, it is the syntactic
form that determines that it is represented as 1/(%e^x), not whether -x is
actually positive or negative.  It is important that Maxima be consistent
about this; otherwise it couldn't factor e.g. X+1/X where X=%e^x ==
%e^x+%e^-x.

To control this behavior more closely, you can always do things like
ratsubst(myexp(-x),%e^-x,...), then factor, then subst back into the
result.  Since ratsubst uses CRE, it will recognize the same cases as
factor; when substituting back, though, you probably want to use 'subst' to
preserve the form of the result.

            -s


On Sun, Dec 2, 2012 at 4:46 PM, David Ronis <ronis at ronispc.chem.mcgill.ca>wrote:

> I have a long messy expression that I'm trying to simplify.   On thing
> that would help would be to better control how sub expressions
> containing exponentials are factored.   Consider the following:
>
> (%i1) factor(exp(a)+exp(b));
>                                      b     a
> (%o1)                              %e  + %e
>
> (%i2) factor(exp(a)+exp(-b));
>                                 - b    b + a
> (%o2)                         %e    (%e      + 1)
>
>
> Both are mathematically correct, but how maxima chooses b is often very
> unhelpful, and in any event is completely arbitrary given that either a
> or b could have either sign.   Is there a flag that controls this
> "simplification"?
>
> David
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>