Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5801

Re: Full simplify problem

From dimitris <dimmechan@yahoo.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Full simplify problem
Date 2011-10-23 10:25 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j80q30$ab1$1@smc.vnet.net> (permalink)
References <j7u59t$u$1@smc.vnet.net>

Show all headers | View raw


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

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

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

Out[31]= E^y*(1 - E^z)

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

Out[36]= E^x - E^(y + z)

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

Out[37]= E^y*(1 - E^z)

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

Out[30]= 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[69]:= Assuming[x == y + z, FullSimplify[E^x - E^(y + z),
ComplexityFunction -> (If[Head[#1] === Power, 1, 0] & )]]

Out[69]= 0

This does the same

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

Out[70]= 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[80]:= TrigToExp[Assuming[x == 2*y, FullSimplify[E^x - E^(y + z),
ComplexityFunction -> (Count[{#1}, _Power, Infinity] & )]]]

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

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

Out[82]= E^(2 + y) - E^(y + z)

Best Regards
Dimitris


Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Full simplify problem "A. Lapraitis" <ffcitatos@gmail.com> - 2011-10-22 10:18 +0000
  Re: Full simplify problem dimitris <dimmechan@yahoo.com> - 2011-10-23 10:25 +0000
  Re: Full simplify problem dimitris <dimmechan@yahoo.com> - 2011-10-23 10:29 +0000
  Re: Full simplify problem dimitris <dimmechan@yahoo.com> - 2011-10-23 10:30 +0000
  Re: Full simplify problem DrMajorBob <btreat1@austin.rr.com> - 2011-10-24 09:23 +0000

csiph-web