Changing signs of terms like (x-1) after factor or simplification
Subject: Changing signs of terms like (x-1) after factor or simplification
From: Sebastian Kranz
Date: Sat, 26 Mar 2011 16:47:17 +0100
Hi,
I use Maxima often to simplify terms or equations that have a lot
terms of the form (1-x) with variables x in [0,1]. The simplifying
functions of Maxima tend to transform the terms (1-x) in the less
intuitive form -(x-1) and I have to convert them back manually. For example,
(%i231) factor(a-x*a);
(%o231) - a (x - 1)
Does anybody know an automatic way to tell Maxima that it shall tranform
terms like (x-1) into -(1-x) and multiply the minus sign with all other
minus signs in the product? E.g. I would like
factor(a-x*a);
a (1-x)
or
factor(-a+x*a);
- a (1-x)
Alternatively, is it complicated to write a general function that does
this transformation? E.g. a function nicesign(expr), yielding:
nicesign(factor(a-x*a));
a (1-x)
Perhaps creating such a function is not too complciated, but I really
have no knowledge of maxima programming.
Thanks for any help,
Sebastian