Re: Simplify using custom function
- To: mathgroup at smc.vnet.net
- Subject: [mg47689] Re: [mg47676] Simplify using custom function
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Thu, 22 Apr 2004 02:38:33 -0400 (EDT)
- References: <200404210923.FAA02461@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 21 Apr 2004, at 18:23, Jens wrote: > 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 > > > First of all, your problem is not well defined since the answer is not unique. There are obviously infinitely many ways to "find a certain function" in a more complicated expression. But, assuming that the expression you are looking for is a polynomial in your function, in cases like your example it can be done with PolynomialReduce:: Last[PolynomialReduce[-1+2 x+2 E^x,f[x]-x-E^x]] -1+2 f[x] Andrzej Kozlowski Chiba, Japan http://www.mimuw.edu.pl/~akoz/
- References:
- Simplify using custom function
- From: Jens <jens@tnntw10.tn.tudelft.nl>
- Simplify using custom function