       Re: Full simplify problem

• To: mathgroup at smc.vnet.net
• Subject: [mg122272] Re: Full simplify problem
• From: dimitris <dimmechan at yahoo.com>
• Date: Sun, 23 Oct 2011 06:22:52 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <j7u59t\$u\$1@smc.vnet.net>

```On Oct 22, 1:18 pm, "A. Lapraitis" <ffcita... at gmail.com> wrote:
> Hello,
>
> Could anyone explain why the following does not give zero?
>
> In:= Assuming[
>  x == y + z,
>  FullSimplify[
>   E^x - E^(y + z)
>   ]
>  ]
>
> Out= E^x - E^(y + z)
>
> Thanks!

Wow! This is rather strange! Here is some similar examples

In:= Assuming[x - y == 0, FullSimplify[E^x - E^(y + z)]] (*works*)

Out= E^y*(1 - E^z)

In:= Assuming[x - y == 2, FullSimplify[E^x - E^(y + z)]](*not
works*)

Out= E^x - E^(y + z)

In:= Assuming[x == y, FullSimplify[E^x - E^(y + z)]] (*works*)

Out= E^y*(1 - E^z)

In:= Assuming[x == 2*y, FullSimplify[E^x - E^(y + z)]] (*not
works*)

Out= E^x - E^(y + z)

Somehow FullSimplify need some push in order to simplify your
expression and similar ones.
I don't claim this is a normal behavior, I don't have any explanation
for it, I don't know what
I would do if I didn't have some knowledge of Mathematica but I found
the following
workaround (not trivial indeed)  for your example:

In:= Assuming[x == y + z, FullSimplify[E^x - E^(y + z),
ComplexityFunction -> (If[Head[#1] === Power, 1, 0] & )]]

Out= 0

This does the same

In:= Assuming[x == y + z, FullSimplify[E^x - E^(y + z),
ComplexityFunction -> (Count[{#1}, _Power, Infinity] & )]]

Out= 0

(You can use the option ComplexityFunction to specify different
simplicity criteria. Here the goal is to avoid Power if possible.
Remember that Head[Exp[z]] is Power and FullForm[Exp[z]] is
Power[E,z].)

I would also add that for my similar examples mentioned above a
workaround could be:

In:= TrigToExp[Assuming[x == 2*y, FullSimplify[E^x - E^(y + z),
ComplexityFunction -> (Count[{#1}, _Power, Infinity] & )]]]

Out= E^(2*y) - E^(y + z)

In:= TrigToExp[Assuming[x - y == 2, FullSimplify[E^x - E^(y + z),
ComplexityFunction -> (Count[{#1}, _Power, Infinity] & )]]]

Out= E^(2 + y) - E^(y + z)

Best Regards
Dimitris

```

• Prev by Date: AbsoluteTime[] runs slowly?
• Next by Date: Re: Ticks without labels
• Previous by thread: Re: Full simplify problem
• Next by thread: Re: Full simplify problem