Re: Simplify using custom function

*To*: mathgroup at smc.vnet.net*Subject*: [mg47688] Re: [mg47676] Simplify using custom function*From*: Bob Hanlon <hanlonr at cox.net>*Date*: Thu, 22 Apr 2004 02:38:32 -0400 (EDT)*Reply-to*: hanlonr at cox.net*Sender*: owner-wri-mathgroup at wolfram.com

expr=-1+2 x+2 E^x; expr /. E^x -> f[x]-x // Simplify 2 f(x)-1 However, f[x] cannot be defined or you will be back at expression. Bob Hanlon > > From: Jens <jens at tnntw10.tn.tudelft.nl> To: mathgroup at smc.vnet.net > Date: 2004/04/21 Wed AM 05:23:20 EDT > To: mathgroup at smc.vnet.net > Subject: [mg47688] [mg47676] Simplify using custom function > > What I'm trying to achieve is to find a certain function in a more > complicated expression: > > example: complicated expression: -1+2 x +2 e^x > function: f[x_]=x+e^x > > Mathematica should return: -1+2 f[x] > > I've been looking at TransformationFunctions and FullSimplify, but did > not succeed in defining a transformation function so far. How do I do > that? (It's Mathematica 5.0) > > Jens > >