[Date Index] [Thread Index] [Author Index]
Re: Expand on the RHS of a rule
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.