[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-mail] r*r^(k-1) -> r^k / Declaring variable ranges
From: |
Bill Page |
Subject: |
Re: [Axiom-mail] r*r^(k-1) -> r^k / Declaring variable ranges |
Date: |
Wed, 18 Jun 2008 18:49:53 -0400 |
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.