RE: Re: Question about Replace
- To: mathgroup at smc.vnet.net
- Subject: [mg35712] RE: [mg35689] Re: [mg35670] Question about Replace
- From: "DrBob" <majort at cox-internet.com>
- Date: Sat, 27 Jul 2002 06:43:12 -0400 (EDT)
- Reply-to: <drbob at bigfoot.com>
- Sender: owner-wri-mathgroup at wolfram.com
What you want is a change of variables: expr = x + y + z/(x + y) + e^(x + y) + (w*x) + y; expr /. x -> z - y /. z -> x 1 + e^x + x + w*(x - y) + y Bobby Treat -----Original Message----- From: Xuguang(Heather) Zhang [mailto:xuguang_zhang at hotmail.com] To: mathgroup at smc.vnet.net Subject: [mg35712] [mg35689] Re: [mg35670] Question about Replace Hi, Bob, I tried ReplaceRepeated, however, I got the following answer: x+y+z/(x+y)+e^(x+y)+(w*x)+y//. x+y->x e^x+x+(w*x)+2y+z/x In fact, there is still one more (x+y) term if we rewritten the answer. That is e^x+(x+y)+y+(w*x)+z/x. Do you know how to get rid of it? Thanks. ----- Original Message ----- From: <BobHanlon at aol.com> To: mathgroup at smc.vnet.net Subject: [mg35712] [mg35689] Re: [mg35670] Question about Replace > > In a message dated 7/25/02 5:06:57 AM, xzhang2 at is2.dal.ca writes: > > >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? > > Use ReplaceRepeated > > x+y+z/(x+y)+e^(x+y)+w*(x+y) //. x+y->x > > e^x + w*x + x + z/x > > > Bob Hanlon > Chantilly, VA USA > >