Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: replacement x->y except in Exp[x]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110849] Re: replacement x->y except in Exp[x]
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 8 Jul 2010 06:51:08 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

expr = a*x + b*x^2 - c*Exp[x];

expr /. {Exp[x] -> z, x -> y} /. z -> Exp[x]

a*y + b*y^2 - c*E^x


Bob Hanlon

---- Sebastian <sebhofer at gmail.com> wrote: 

=============
Is it possible to exclude certain patterns from replacements?
For example I want to replace y for x everywhere except in Exp[x].

TIA Sebastian



  • Prev by Date: Re: precedence for ReplaceAll?
  • Next by Date: Re: First nonzero in list
  • Previous by thread: replacement x->y except in Exp[x]
  • Next by thread: Re: replacement x->y except in Exp[x]