MathGroup Archive 1992

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

Search the Archive

Re: Expand[] on the RHS of a rule

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: Re: Expand[] on the RHS of a rule
  • From: a_rubin at dsg4.dse.beckman.com (arthur rubin)
  • Date: Thu, 28 May 92 07:26:15 PDT

athos at warp.stanford.edu (Athos Kasapi) writes:

>Has anybody found a way to work around the problem that Expand does not
>work when it is on the right hand side of a rule?  For example, if I
>define

>p := Sqrt[ (a + b) (c + d) ]

>and then apply the rule

>p /. Sqrt[ x_ y_ ] -> Sqrt[ Expand[ x y ] ]

You need :
 p /. Sqrt[ x_ y_ ] :> Sqrt[ Expand[ x y ] ]

With "->", Expand is evulated before x and y are substituted.





  • Prev by Date: Eigenvalue problems in diff equations.
  • Next by Date: text in graphics
  • Previous by thread: Expand[] on the RHS of a rule
  • Next by thread: Re: Expand[] on the RHS of a rule