Behaviour of factor



Factor treats %e^(-b*x)*(%e^(b*x)-1) as a rational function (y-1)/y with
y=%e^(b*x).  Factor doesn't return 1-1/y because that is not in the standard
rational function format poly1/poly2.

There are several ways to force the form %e^(-b*x)-1.

One is to temporarily substitute a positive exponent when factoring:

   expr: a/b-a*%e^(-b*x)/b$
   subst(-b,mb,factor(subst(-mb,b,expr)));
or
   subst(1/%e,%e,factor(subst(1/%e,%e,expr)));

Another is to reorganize after the fact:

   fexpr: factor(expr);
   substpart(multthru(piece),fexpr,1,[2,3])

Does that resolve your issue?

           -s


On Sat, Oct 8, 2011 at 08:47, Herbert Ballmann <ballmann at sapo.pt> wrote:

> Just a question about 'factor':
>
> With
> a/b-a*%e^(b*x)/b;
> factor(%);
> The result is: -a*(%e^(b*x)-1)/b
>
> But with
> a/b-a*%e^(-b*x)/b;
> factor(%);
> I obtain: a*%e^(-b*x)*(%e^(b*x)-1)/b
> and not -a*(%e^(-b*x)-1)/b, as I expected.
>
> Is it not possible to have
> "%e^(-b*x)*(%e^(b*x)-1)" expanded to "1-"%e^(-b*x)"?
>
> Herbert Ballmann
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>