login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for simplify exponents revision 4 of 4

1 2 3 4
Editor: test1
Time: 2017/02/17 17:14:43 GMT+0
Note:

changed:
-Howto simplify exponents
-
-  How can I make axiom to do 2^a*2^(2*a) -> 2^(3*a) ?
How to simplify exponents

  How can I make FriCAS to do 2^a*2^(2*a) -> 2^(3*a) ?

changed:
-But I cannot convince Axiom to do 2^(5*a)/2^(4*a) -> 2^a
But I cannot convince FriCAS to do 2^(5*a)/2^(4*a) -> 2^a

changed:
-Unfortunately this seemingly simple transformation does not seem to be easy to perform in Axiom but I have found two possible ways to do this. The first involves the normalize() operation. Unfortunately normalize takes the process one step too far. This can be undone with a simple rule.
Unfortunately this seemingly simple transformation does not seem to be easy to perform in FriCAS but I have found two possible ways to do this. The first involves the normalize() operation. Unfortunately normalize takes the process one step too far. This can be undone with a simple rule.

How to simplify exponents

How can I make FriCAS to do 2^a2^(2a) -> 2^(3*a) ?

fricas
(1) -> 2^a*2^(2*a)

\label{eq1}{{2}^{a}}\ {{2}^{2 \  a}}(1)
Type: Expression(Integer)
fricas
simplify %

\label{eq2}{2}^{3 \  a}(2)
Type: Expression(Integer)

But I cannot convince FriCAS to do 2^(5a)/2^(4a) -> 2^a

fricas
2^(5*a)/2^(4*a)

\label{eq3}\frac{{2}^{5 \  a}}{{2}^{4 \  a}}(3)
Type: Expression(Integer)
fricas
simplify %

\label{eq4}{2}^{a}(4)
Type: Expression(Integer)

Unfortunately this seemingly simple transformation does not seem to be easy to perform in FriCAS but I have found two possible ways to do this. The first involves the normalize() operation. Unfortunately normalize takes the process one step too far. This can be undone with a simple rule.

fricas
exprule:=rule exp(x*log(n)) == n^x

\label{eq5}= = \left({{{e}^{x \ {\log \left({n}\right)}}}, \:{{n}^{x}}}\right)(5)
Type: RewriteRule?(Integer,Integer,Expression(Integer))
fricas
normalize %% 3

\label{eq6}{e}^{a \ {\log \left({2}\right)}}(6)
Type: Expression(Integer)
fricas
exprule %

\label{eq7}{2}^{a}(7)
Type: Expression(Integer)

The second approach uses a single rule to do the whole job.

fricas
fracrule:=rule n^m/n^p == n^(m-p)

\label{eq8}= = \left({{\frac{{n}^{m}}{{n}^{p}}}, \:{{n}^{- p + m}}}\right)(8)
Type: RewriteRule?(Integer,Integer,Expression(Integer))
fricas
fracrule %% 3

\label{eq9}{2}^{a}(9)
Type: Expression(Integer)

How about 2^a*4^a ?

fricas
2^a*4^a

\label{eq10}{{2}^{a}}\ {{4}^{a}}(10)
Type: Expression(Integer)
fricas
simplify %

\label{eq11}{{2}^{a}}\ {{4}^{a}}(11)
Type: Expression(Integer)

Here is one approach. First lets define a function that factors a power and a rule that applies this function.

fricas
powerFac(n,a) == reduce(*,[(t.factor)^(a*t.exponent) for t in factors(n)])
Type: Void
fricas
powerRule := rule n^a == powerFac(n,a)
fricas
Compiling function powerFac with type (Variable(n), Variable(a)) -> 
      Expression(Integer)

\label{eq12}= = \left({{{n}^{a}}, \:{{n}^{a}}}\right)(12)
Type: RewriteRule?(Integer,Integer,Expression(Integer))

Now we can use the rule and simplify the result

fricas
simplify powerRule (2^a*4^a)

\label{eq13}{{2}^{a}}\ {{4}^{a}}(13)
Type: Expression(Integer)

Apparently, simplifyExp yields the desired result

fricas
simplifyExp(2^a*2^(2*a))

\label{eq14}{2}^{3 \  a}(14)
Type: Expression(Integer)

The desired result was

  • 2^a*4^a -> 2^(3a)

fricas
simplifyExp(2^a*4^a)

\label{eq15}{{2}^{a}}\ {{4}^{a}}(15)
Type: Expression(Integer)

doesn't do it. But normalize plus cleanup works:

fricas
normalize(2^a*4^a)

\label{eq16}{{e}^{a \ {\log \left({2}\right)}}}^{3}(16)
Type: Expression(Integer)
fricas
exprule %

\label{eq17}{8}^{a}(17)
Type: Expression(Integer)
fricas
powerRule %

\label{eq18}{8}^{a}(18)
Type: Expression(Integer)

In the other hand ... --H.P., Mon, 11 Oct 2004 22:44:30 -0500 reply
simplifyExp does have some effect:

fricas
2^(3*a)*2^(4*a)

\label{eq19}{{2}^{3 \  a}}\ {{2}^{4 \  a}}(19)
Type: Expression(Integer)
fricas
simplifyExp(2^(3*a)*2^(4*a))

\label{eq20}{2}^{7 \  a}(20)
Type: Expression(Integer)