Barton Willis

2017-07-14 12:28:54 UTC

Using default value for option variables and assuming a > 0, Maxima simplifies (-a)^x as a^x*(-1)^x and it simplifies (-2)^x to itself. That is arguably inconsistent--correct?

This inconsistent simplification allows some vanishing expressions to resist being simplified to zero; for example

(%i2) assume(a>0)$

(%i3) e : subst(a=2, a*(-a)^x) - 2*(-2)^x;

(e) (-1)^x*2^(x+1)+(-2)^(x+1)

(%i4) ratsimp(e);

(%o4) (-1)^x*2^(x+1)+(-2)^(x+1)

(%i5) rat(e);

(%o5)/R/ 2*(-1)^x*2^x-2*(-2)^x

(%i6) ratexpand(e);

(%o6) (-1)^x*2^(x+1)+(-2)^(x+1)

(%i7) rectform(e);

(%o7) %i*(2^(x+1)*sin(%pi*(x+1))+2^(x+1)*sin(%pi*x))+2^(x+1)*cos(%pi*(x+1))+2^(x+1)*cos(%pi*x)

(%i8) trigsimp(%);

(%o8) 0

(%i9) trigrat(e);

(%o9) 0

--Barton

This inconsistent simplification allows some vanishing expressions to resist being simplified to zero; for example

(%i2) assume(a>0)$

(%i3) e : subst(a=2, a*(-a)^x) - 2*(-2)^x;

(e) (-1)^x*2^(x+1)+(-2)^(x+1)

(%i4) ratsimp(e);

(%o4) (-1)^x*2^(x+1)+(-2)^(x+1)

(%i5) rat(e);

(%o5)/R/ 2*(-1)^x*2^x-2*(-2)^x

(%i6) ratexpand(e);

(%o6) (-1)^x*2^(x+1)+(-2)^(x+1)

(%i7) rectform(e);

(%o7) %i*(2^(x+1)*sin(%pi*(x+1))+2^(x+1)*sin(%pi*x))+2^(x+1)*cos(%pi*(x+1))+2^(x+1)*cos(%pi*x)

(%i8) trigsimp(%);

(%o8) 0

(%i9) trigrat(e);

(%o9) 0

--Barton