Re: Simplify Oddity
- To: mathgroup at smc.vnet.net
- Subject: [mg59407] Re: Simplify Oddity
- From: albert <awnl at arcor.de>
- Date: Mon, 8 Aug 2005 06:17:11 -0400 (EDT)
- References: <dd7337$3q5$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
AES wrote: > I'm supposing that the following rather odd result has something to do > with Mathematica being concerned that g or r (or k?) might be complex > numbers? > > In[151] := > > f1 = g (g/r)^(k-1); > > f2 = g^k/r^(k-1); > > f1/f2 // FullSimplify > > Out[151] = g^(-k) (g/r)^k r^k > No, as you suppose, mathematica takes into account that everything could be a complex number ... including 0. The expression f1/f2 will only simplify to 1 if g and r are not 0 and k is e.g. an integer. You can check that by hand or with: In[5]:= f1/f2 /. {g -> 1, r -> -2, k -> 1/2} Out[5]= -1 In[6]:= Assuming[{r < 0, g > 0}, Simplify[f1/f2]]//InputForm Out[6]//InputForm= E^((2*I)*k*Pi) but when given these assumption, mathematica will simplify (it implicitly assumes r and g to be reals when you specify something like r<0 or r!=0 I think): In[7]:= Assuming[{g != 0, r != 0, Element[k,Integers]},Simplify[f1/f2]] Out[7]= 1 > But shouldn't Mathematic be able to simplify this to unity nonetheless? > -- maybe without even invoking Simplify? Hm, you might find very different opinions about what Mathematica should do or not do even when you look at posts to this group. The point is in most cases whether to stick to strict mathematics and not give simple answers or whether implicitly making assumptions and presenting simple answers that might for special cases be wrong. Usually mathematica tries to stick to strictly mathematical correct results, but by far not in every single case. So you will find many posts where people complain about these very cases, calling them bugs. It helps a lot if you accept that mathematica is a much more usefull tool to do mathematics than a pen and a piece of paper, but be aware that it won't make it possible to get correct results if you don't understand the mathematics you are doing. Checks of any results that are computed automatically are always a good idea... Albert
- Follow-Ups:
- Re: Re: Simplify Oddity
- From: Andrzej Kozlowski <akozlowski@gmail.com>
- Re: Re: Simplify Oddity