Agreed this is annoying and problematic.
One workaround (which is not really a solution) is
subst(-x,x,ratsimp(subst(-x,x,ex)));
(factor and radcan also work instead of ratsimp).
scanmap(factor,ex),radexpand:all;
gives (-1)^a * (x-1)^(a-1), which isn't really what you want....
Perhaps rootscontract should be extended to handle this case (with, say,
rootsconmode:radical), though I'd think ratsimp and radcan should also do
it.
This problem is especially annoying because factor((1-x)^a/(2-2*x)) treats
2-2*x = -2*(x-1), so fails to cancel.
-s
On Thu, Apr 11, 2013 at 8:22 AM, Barton Willis <willisb at unk.edu> wrote:
> The general simplifier does (1-x)^a/(1-x) --> (1-x)^(a-1), but it *doesn't
> *convert (1-x)^a/(x-1) --> -(1-x)^(a-1).
> I don't know of any simplification function that does (1-x)^a/(x-1) -->
> -(1-x)^(a-1):
>
> (%i5) (1-x)^a/(x-1)$
>
> (%i6) [radcan(%), ratsimp(%), factor(%), rootscontract(%)];
> (%o6) [(1-x)^a/(x-1),(1-x)^a/(x-1),(1-x)^a/(x-1),(1-x)^a/(x-1)]
>
> I thought maybe the option variable negdistrib might come into play--it
> didn't seem to matter.
>
> Is there a simply way to do transformations such as (1-x)^a/(x-1) -->
> -(1-x)^(a-1)?
>
> --Barton
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>