Re: Re: Re: Hyperbolic function identity

*To*: mathgroup at smc.vnet.net*Subject*: [mg51019] Re: [mg50964] Re: [mg50945] Re: [mg50932] Hyperbolic function identity*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>*Date*: Fri, 1 Oct 2004 04:49:52 -0400 (EDT)*References*: <200409300852.EAA26465@smc.vnet.net> <EC6856EA-12D4-11D9-8846-000A95B4967A@mimuw.edu.pl> <E5587780-12E6-11D9-9AC3-000A95B4967A@mimuw.edu.pl> <415C2570.8050607@wolfram.com>*Sender*: owner-wri-mathgroup at wolfram.com

Ah, of course! Well, it was late last night! Still, I think this explains the whole problem, and also shows that with the present paradigm on which Simplify and FullSimplify are based it is unavoidable. To summarise it: with a given complexity function and the presence of conditions in Simplify or FullFimplify, the transformation leading to the "simplest result' (in this case 0) may have to use a step which results in an expression which has a higher complexity (in this case the expression involving logs, which has a higher default complexity until it itself is simplified under the given assumptions). Clearly, this is un-avoidable, since to avoid it Mathematica should test each intermediate expression that any of its trasformation functions produces by again applying FullSimplify with assumptions. IN other words it would would have to do something like this: FullSimplify[ArcCosh[1+z^2/2]-2*ArcSinh[z/ 2],z>0,TransformationFunctions->{Automatic, FullSimplify[TrigToExp[#],z>0]&}] but not just with TrigToExp but with every function used by the Automatic setting in FullSimplify. That of course is not very realistic! Andrzej On 1 Oct 2004, at 00:25, Adam Strzebonski wrote: > *This message was transferred with a trial version of CommuniGate(tm) > Pro* > With your complexity function zero has a higher complexity > than the expression returned by FullSimplify. > > In[1]:= cf1=(1/(1 + Count[#1, Log, Infinity, Heads -> True]) & ); > > In[2]:= cf1[2*(Log[2] - Log[z + Sqrt[z^2 + 4]]) + > Log[z^2 + Sqrt[z^2 + 4]*z + 2] - Log[2]] > > 1 > Out[2]= - > 5 > > In[3]:= cf1[0] > > Out[3]= 1 > > If the ComplexityFunction favors transformation of > ArcSinh and ArcCosh to logs, but also takes LeafCount > into account, one call to FullSimplify is enough. > > In[4]:= cf2[e_]:=1000 Count[e, _ArcSinh|_ArcCosh, > {0, Infinity}]+LeafCount[e] > > In[5]:= FullSimplify[ArcCosh[1 + z^2/2] - > 2*ArcSinh[z/2], z>0, ComplexityFunction -> cf2] > > Out[5]= 0 > > Best Regards, > > Adam Strzebonski > Wolfram Research > > > Andrzej Kozlowski wrote: >> *This message was transferred with a trial version of CommuniGate(tm) >> Pro* >> Here is a puzzling observation. >> FullSimplify[FullSimplify[ArcCosh[1 + z^2/2] - >> 2*ArcSinh[z/2], ComplexityFunction -> >> (1/(1 + Count[#1, Log, Infinity, Heads -> >> True]) & )], z > 0] >> 0 >> I used a silly looking ComplexityFunction whose only purpse was to >> force FullSimplify to choose expressions involving logs in preference >> to those without them. FullSimplify obviously made use of TrigToExp >> or something like that to get the answer. However, the really curious >> thing is this: >> FullSimplify[ArcCosh[1 + z^2/2] - 2*ArcSinh[z/2], z > 0, >> ComplexityFunction -> >> (1/(1 + Count[#1, Log, Infinity, Heads -> True]) & )] >> 2*(Log[2] - Log[z + Sqrt[z^2 + 4]]) + >> Log[z^2 + Sqrt[z^2 + 4]*z + 2] - Log[2] >> FullSimplify[%, z > 0] >> 0 >> The fact that two applications of FullSimplify were needed seems >> strange to me and it might be a bug. One would have exected that >> having obtained the first expression above FullSimplify would make >> one more attempt at FullSImplifying thus obtaining the answer 0. >> Somehow it fails to do so. >> Andrzej >> On 30 Sep 2004, at 20:36, Andrzej Kozlowski wrote: >>> It seems to me that the problem lies elsewhere. Note that >>> >>> FullSimplify[ArcCosh[1 + z^2/2] - 2*ArcSinh[z/2], z > 0, >>> TransformationFunctions -> {Automatic, TrigToExp}] >>> >>> does not work and you have to use: >>> >>> Simplify[ArcCosh[1+z^2/2]-2*ArcSinh[z/ >>> 2],z>0,TransformationFunctions->{Automatic, >>> FullSimplify[TrigToExp[#],z>0]&}] >>> >>> It looks to me more likely that TrigToExp is actually used as a >>> transformation function by FullSimplify while searching for the >>> "simplest" form, but unless the condition z>0 is also used at the >>> same time the expressions obtained in this way do not actually >>> become "simpler" and are discarded. I don't think this can be helped >>> unless FullSimplify with the condition z>0 is itself included among >>> the transformation functions (which of course seems rather pointless >>> in this case as you can just apply it to the entire expression >>> itself). >>> >>> Andrzej >>> >>> On 30 Sep 2004, at 17:52, Wolf, Hartmut wrote: >>> >>>> >>>> No course to blame Mathematica. We do have TrigToExp and ExpToTrig, >>>> but >>>> cannot keep them both at the same time (no confluent ruleset). So >>>> without >>>> meta-rules, a choice must be made by the user. >>>> >>>> -- >>>> Hartmut >>>> >>>> >>>>> -----Original Message----- >>>>> From: Maxim A. Dubinnyi [mailto:maxim at nmr.ru] To: mathgroup at smc.vnet.net >>>> >>>> >>>>> Sent: Wednesday, September 29, 2004 9:15 AM >>>>> To: mathgroup at smc.vnet.net >>>>> Subject: [mg51019] [mg50964] [mg50945] Re: [mg50932] Hyperbolic function >>>>> identity >>>>> >>>>> >>>>> This works correctly: >>>>> >>>>> FullSimplify[TrigToExp[ArcCosh[1+(z^2)/2]-2*ArcSinh[z/2]], z > 0] >>>>> >>>>> It looks like that mathematica works better with logarithms and >>>>> exponents then with trigonometric functions. >>>>> >>>>> Carlos Felippa wrote: >>>>> >>>>>> Why >>>>>> >>>>>> FullSimplify[ArcCosh[1+z^2/2]-2*ArcSinh[z/2],z>0]; >>>>>> >>>>>> does not evaluate to 0? >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>> >

**Re: Simulating random fields in Mathematica**

**Re: Re: Re: Courier New Button, selecting cells without brackets**

**Re: Re: Re: Hyperbolic function identity**

**Re: Hyperbolic function identity**