       Re: Simplify and FullSimplify

• To: mathgroup at smc.vnet.net
• Subject: [mg58551] Re: [mg58547] Simplify and FullSimplify
• From: Andrzej Kozlowski <akozlowski at gmail.com>
• Date: Thu, 7 Jul 2005 05:35:40 -0400 (EDT)
• References: <200507060711.DAA05301@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```On 6 Jul 2005, at 16:11, fizzy wrote:

>
> A result of a calculation I was doing generated this expression....
>
> q-q Exp[-a x] + c Exp[-a x]
>
>
> naturally my next step was Simplify and I thought I'd  get the Exp
> [- ax]
> collected.....to my complete surprize I got the following:
>
> Exp[-a x] (c + (-1+ Exp[a x]) q
>
>
> How on Earth did Mathematica come up with this?   I checked
> FullSimplify
> which did collect Exp[-a x]....
>
> On re-reading my question before I submitted it, I see that with
> Simplify Mathematica  'collected' using Exp[- a x] q.....of course,
> visually this expression seems quite complex and would seem to take
> much
> more 'thinking' to get ......why do Simplify and FullSimplify have
> such
> a vast difference in what is considered 'Simpler'?
>
>
> Thanks....Jerry Blimbaum
>
>

They do not differ at all in what is considered Simpler (Adam
Strzebonski once published here the default ComplexityFunction which
is the same for both) but FullSimplify applies a lot more
transformation rules.

I have no idea what transformation function in FullSimplify is
responsible for this simplification. However, here is a
transformation fucntion I have manufactured:

f[expr_] := First[Sort[(Collect[expr, #1] & ) /@
Level[expr, {1, Infinity}],
LeafCount[#1] <= LeafCount[#2] & ]]

With this transformation function you will get:

Simplify[(-E^((-a)*x))*q + q + c/E^(a*x),
TransformationFunctions -> {Automatic, f}]

(c - q)/E^(a*x) + q

What f[expr] does is to try to Collect expr with respect to all
subexpressions of expr at levels 1 to Infinity and then choose the
form that has the least LeafCount. Obviously this is time consuming
for complicated expressions. Possibly FullSimplify uses something
similar.

Andrzej Kozlowski

```

• Prev by Date: Re: Wrong Integral result for a Piecewise function
• Next by Date: Re: Wrong Integral result for a Piecewise function
• Previous by thread: Simplify and FullSimplify
• Next by thread: Re: Simplify and FullSimplify