MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Forcing Certain Algebraic Forms With FullSimplify


Hi,

I would like to have Mathematica generate an output for an equation
where a certain variable is isolated.

For instance, I have the equation "a*b+g". I would like "b" to not be
multiplied by anything in the result. Thus, I would prefer the form
"a(b+g/a)".

I have attempted to do this with FullSimplify and ComplexityFunction.
The complexity function (cf) evaluates the way I want it to, but for
some reason FullSimplify gives me the answer I don't want.

Sample code:

cf[e_] := 100 Count[e, Times[b, __], Infinity] + LeafCount[e] ;

cf[a b + g]
cf[a (b + g/a)]

FullSimplify[a b + g, ComplexityFunction -> cf]

Output:

105
9
a b + g

Any ideas?

Thank you,
Scott



  • Prev by Date: ContourPlot ColorFunction workaround
  • Next by Date: Re: Sorting strings
  • Previous by thread: ContourPlot ColorFunction workaround
  • Next by thread: Re: Forcing Certain Algebraic Forms With FullSimplify