Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

RE: RE: Question about Replace

  • To: mathgroup at
  • Subject: [mg35713] RE: [mg35696] RE: [mg35670] Question about Replace
  • From: "DrBob" <majort at>
  • Date: Sat, 27 Jul 2002 06:43:14 -0400 (EDT)
  • Reply-to: <drbob at>
  • Sender: owner-wri-mathgroup at

Actually, she wants a change of variables: expr/.x->z-y/.z->x.

-----Original Message-----
From: David Park [mailto:djmp at] 
To: mathgroup at
Subject: [mg35713] [mg35696] RE: [mg35670] Question about Replace


It works.

x + y + z/(x + y) + e^(x + y) + w*x + y /. x + y -> x
e^x + x + w*x + 2*y + z/x

Since you wrote w*x + y and not w*(x+y) Mathematica simplified to obtain
x +
2y so there is no replacement there.

But generally you will have to use ReplaceRepeated (//.).

x + y + z/(x + y) + e^(x + y) + w*(x + y) //. x + y -> x
e^x + x + w*x + z/x

David Park
djmp at

From: Xuguang Zhang [mailto:xzhang2 at]
To: mathgroup at

Hello All,

I have an expression: x+y+z/(x+y)+e^(x+y)+w*x+y.... I want to replace
any (x+y) term by x no matter how the expression looks like.  I tried
"/."command. However, it does not work properly. Is there any simple way
of doing this? Thanks.

Xuguang(Heather) Zhang

  • Prev by Date: Re: J/Link
  • Next by Date: Re: A faster alternative to ListIntegrate?
  • Previous by thread: Re: Question about Replace
  • Next by thread: RE: Re: Question about Replace