simplification



Le 15/04/2012 22:07, Stavros Macrakis a ?crit :
> [...]
>
> You can also define patterns like e^n => 1 if n is an odd integer and e
> if n is an even integer.
>

I've tried this but I must have missed sth :

(%i1) matchdeclare(e, lambda([e],equal(abs(e), 1)));
(%o1) done
(%i2) matchdeclare(n, integer);
(%o2) done
(%i3) tellsimp(e^n,e^(mod(n,2)));
(%o3) [^rule1,simpexpt]
(%i4) declare(e1, integer);
(%o4) done
(%i5) assume(equal(abs(e1), 1));
(%o5) [equal(abs(e1),1)]
(%i6) e1^5;
(%o6) e1^5
(%i7) ratsimp(%);
(%o7) e1^5


Jean


>             -s
> On Sun, Apr 15, 2012 at 15:08, Jean Vittor <jean.vittor at free.fr
> <mailto:jean.vittor at free.fr>> wrote:
> [...]