simplification



Thanks for all response I got.


I've tried {subst(1, e1, %), subst(-1, e1, %)}; then union((subst(1, e2, 
%), subst(-1, e2, %)) and so on...

It kinda works: I get some simplifications but I lose variables e1, 
e2... and the result set is large (as I have a lot of iterations with at 
least one sign variable for each iteration). Moreover, I would like to 
use functions that returns either 1 or -1.

Is there a solution which would consist in:
    - declaring a variable type (or feature, or property, I'm not 
familiar with maxima's vocabulary) : say 'sign';
    - adding some rules like tellsimp(sin(e*x), e*sin(x)) if e is a 
'sign' and x an expression that leads to a real number ?

Even a 'function' (let's call it simplify_sign) could fit if I could 
have: simplify_sign(e, sin(e*a_complex_expression)) returns 
e*sin(a_complex_expression).


Thanks,

Jean

Le 13/04/2012 17:56, Stavros Macrakis a ?crit :
> [...]