Re: Simplify

*To*: mathgroup at smc.vnet.net*Subject*: [mg14811] Re: [mg14780] Simplify*From*: BobHanlon at aol.com*Date*: Wed, 18 Nov 1998 01:29:13 -0500*Sender*: owner-wri-mathgroup at wolfram.com

In a message dated 11/15/98 1:16:55 AM, jtischer at col2.telecom.com.co writes: >you just showed me that it's hopeless. I'm searching for a way that will > >cook down formulas of this type, your method is ok but needs human > >skill. > >Anyway, thanks a lot. > > Jurgen, I am not convinced that it is hopeless. You might investigate along these lines: Identify the integers that are raised to powers of n: baseIntegers[eqn_, n_Symbol:n] := Cases[eqn, i_Integer^n->i, {1, Infinity}]//Union Then automate the substitutions given the integers simplifyMore[eqn_, i1_Integer, i2_Integer, n_Symbol:n] := Module[{g = GCD[i1, i2], m, eqn2}, If[g==1, eqn, eqn2 = FullSimplify[FullSimplify[eqn] /. {i1^n -> m (i1/g)^n, i2^n -> m (i2/g)^n}]; FullSimplify[eqn2 /. m -> g^n]]] For example a = (-7253*2^(1 + 2*n)*5^n - 523*4^n*5^(1 + n) + 17121*20^n + 130321*20^n*n^4)/130321; baseIntegers[a] {4,5,20} simplifyMore[a, 4, 20] 20^n*n^4 or simplifyMore[a, 5, 20] 20^n*n^4 The liberal use of FullSimplify will tend to make this relatively slow. Bob Hanlon