MathGroup Archive 2004

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

Search the Archive

Re: Simplify using custom function

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>
To: mathgroup at
> Date: 2004/04/21 Wed AM 05:23:20 EDT
> To: mathgroup at
> 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 
> that? (It's Mathematica 5.0)
> Jens

  • Prev by Date: Re: Partitioning a list into unequal partitions
  • Next by Date: RE: Dashing option and Plot
  • Previous by thread: Re: Simplify using custom function
  • Next by thread: RE: Simplify using custom function