MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Replacement Rule with Sqrt in denominator


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


  • Prev by Date: Re: Why does "Normal" not create a list of line graphics
  • Next by Date: Re: Replacement Rule with Sqrt in denominator
  • Previous by thread: Replacement Rule with Sqrt in denominator
  • Next by thread: Re: Replacement Rule with Sqrt in denominator