axiom-developer
[Top][All Lists]

## [Axiom-developer] Re: how to simplify exponents

 From: Martin Rubey Subject: [Axiom-developer] Re: how to simplify exponents Date: Fri, 3 Sep 2004 11:23:44 +0000

```I wrote:
>  > How can I make axiom to do 2^a*2^(2*a) -> 2^(3*a) ?
>
> Ok, simplifyExp does that. But how about
>
> 2^a*4^a ?

Furthermore, I cannot convince Axiom to do

2^(5*a)/2^(4*a) -> 2^a

I'm rather disappointed, in fact, although it might as well be that I'm missing
something.

I'd be very grateful, if somebody could tell my how to make Axiom do the
following correctly. PLEASE start up Axiom and plug in the following:

--- the first 5 statements are just for setup, don't worry to much about them

x n == 2^(a*n);
k := 2;
p n == A-(k+3)*a1+a1*n;
q:=interpolate('n,[i for i in 1..k],[x(i)*p(i)^(-i) for i in 1..k])\$PINTERP('n,
EXPR INT)::EXPR INT;
eqs:=[(p(i)^i*eval(numerator(q),n=i)-x(i)*eval(denominator(q),n=i))::MPOLY([a1,A],EXPR
INT) for i in k+1..k+3];

--- so far, everything works out just great. eqs is a List of three polynomials
--- in a1 and A with coefficients being expressions.

--- now I want to see, whether they have a common root. In fact, I know they
--- have: A=2^(a*n) and a1=0.

r1:=map(simplifyExp, resultant(eqs.1, eqs.3, a1)::UP(A, EXPR INT));

--- now we have eliminated a1. Since we know that A=2^(a*n) and a1=0 is a
--- common root of all three polynomials, evaluating r1 at A=2^(a*n) should
--- give 0. This does not work out as smooth as I'd hoped, but with a little
--- tweaking we get at least an answer that we can see to be zero:

simplifyExp(eval(r1 ,A=2^a))

--- similarly:

r2:=map(simplifyExp,resultant(eqs.2, eqs.3, a1)::UP(A, EXPR INT));

--- this even works out:

simplifyExp(eval(r2, A=2^a))

--- However, this is simply the wrong answer, it should contain A-2^a as a
--- factor:

gcd(r1, r2)

----------------------------------------------------------------------------

maybe the reason for that is, that Axiom cannot properly do

divide(r1,A-2^a)

HELP!

```