Re: Replacement Rule with Sqrt in denominator
- To: mathgroup at smc.vnet.net
- Subject: [mg113992] Re: Replacement Rule with Sqrt in denominator
- From: Sebastian <sebhofer at gmail.com>
- Date: Sat, 20 Nov 2010 06:12:04 -0500 (EST)
- References: <ic5igm$44p$1@smc.vnet.net>
On Nov 19, 11:11 am, Themis Matsoukas <tmatsou... at me.com> wrote: > This replacement rule works, > > Sqrt[-4 \[Zeta]^2 + (1 + \[Rho]^2)^2] /. > Sqrt[-4 \[Zeta]^2 + (1 + \[Rho]^2)^2] -> G > > G > > but this doesn't: > > 1/Sqrt[-4 \[Zeta]^2 + (1 + \[Rho]^2)^2] /. > Sqrt[-4 \[Zeta]^2 + (1 + \[Rho]^2)^2] -> G > > 1/Sqrt[-4 \[Zeta]^2 + (1 + \[Rho]^2)^2] > > The only difference is that the quantity to be replaced is in the denominator. If I remove Sqrt from the replacement rule it will work but I don't understand why a square root in the denominator (but not in the numerator) causes the rule to fail. > > Themis ReplaceAll acts on the FullForm of an expression. Evaluate FullForm[Sqrt[-4 \[Zeta]^2 + (1 + \[Rho]^2)^2] ] FullForm[1/Sqrt[-4 \[Zeta]^2 + (1 + \[Rho]^2)^2] ] and you will see why it fails in the 2nd case. One possible solution is to use the following pattern (-4 \[Zeta]^2 + (1 + \[Rho]^2)^2)^(_?(Abs[#]==1/2&)) HTH Sebastian