Re: r*r^(k-1) -> r^k / Declaring variable ranges

"Bill Page" <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
On Wed, Jun 18, 2008 at 5:14 PM, Gerald Knizia wrote:
> by default, axiom will simplify an expression like "r * r^5" into "r^6".
> However, an expression like "r * r^(k-1)" is untouched and not turned
> into "r^k". How can I change this?

One easy way is using a rule:

(1) -> simplePowers := rule x*x^n == x^(n+1)

              n        n + 1
   (1)  %L x x  == %L x

                    Type: RewriteRule(Integer,Integer,Expression Integer)

(2) -> w:=r*r^(k-1)

           k - 1
   (2)  r r
                    Type: Expression Integer

(3) -> simplePowers w

         k
   (3)  r

                     Type: Expression Integer

Regards,
Bill Page.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.