Re: Replace not spotting a replacement
- To: mathgroup at smc.vnet.net
- Subject: [mg103425] Re: [mg103399] Replace not spotting a replacement
- From: Adriano Pascoletti <adriano.pascoletti at dimi.uniud.it>
- Date: Mon, 21 Sep 2009 05:51:29 -0400 (EDT)
- References: <200909201021.GAA24204@smc.vnet.net>
Examine Sqrt[2 \[Pi]] \[Tau]^(3/2) // TreeForm and Sqrt[ 2 \[Pi] \[Tau]] //TreeForm to realize why no replacement is performed. This does what you want: In[1]:= Sqrt[2*Pi]*\[Tau]^(3/2) /. Sqrt[2*Pi] -> \[Mu]/\[Tau]^(1/2) Out[1]= \[Mu]*\[Tau] Adriano Pascoletti 2009/9/20 claranet news <david at carter-hitchin.clara.co.uk> > Hi Folks, > > Seems the replace function is being a bit dim here. This fails: > > Sqrt[2 \[Pi]] \[Tau]^(3/2) /. Sqrt[ 2 \[Pi] \[Tau]] -> \[Mu] > > Apologies if this is an FAQ - I couldn't see anything about it. What do I > need to do here to coerce Mathematica into making this replacement? I tried > using the > Collect function on tau first, but that didn't seem to work. I also tried > re-writing the replacement rule as > > Sqrt[2 \[Pi]] \[Tau]^(3/2) /. Sqrt[ 2 \[Pi] ] t^(1/2) -> \[Mu] > > But still no joy. > > Anyone know? > > Many thanks, > David. > > >
- References:
- Replace not spotting a replacement
- From: "claranet news" <david@carter-hitchin.clara.co.uk>
- Replace not spotting a replacement