Rules and simplification question (newbie)



On Tue, 23 May 2006 21:31:26 -0500, Barton Willis  wrote:
>----Doug Neubauer wrote: -----
>
>>I want to apply a rule such that the expression:
>>%e^-x^2  is replaced by gp(x)
>
>I'm not sure when you want to make this replacement.
>Do you want exp(x) --> gp(sqrt(-x)), for example?

No I just wanted a simple replacement. That is, replace
exp(-x^2) with gp(x), and where x could be an expression.

It looks like this more complicated than I thought.
I'll try some of your suggestions using subst(), etc.

Thanks for the quick reply

Doug

>
>By adding logic to 'f,' maybe you can make 'f' for you.
>
>(%i1) f(e) := subst("^" = lambda([x,p], if x = %e then gp(sqrt(-p)) else
>x^p),e)$
>(%i2) f(x^2 + y + cos(z));
>(%o2) cos(z)+y+x^2  <-- doesn't make any subs
>
(snip)