Ratsubst works on the rational form of expressions.
ratsubst(z,exp(x-y),%) is precisely the same as
ratsubst(z,exp(x)/exp(y),%).
Ratsubst(z,x-y,exp(x-y)) does nothing because the 3rd argument is
transformed to exp(x)/exp(y), in which there is no occurrence of x-y at all.
I hope this clarifies it!
RJF
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Stavros Macrakis
> Sent: Thursday, September 06, 2007 9:05 AM
> To: fateman at cs.berkeley.edu
> Cc: maxima at math.utexas.edu
> Subject: ratsubst and exp
>
> BTW, I'm not sure I understand what ratsubst is supposed to do here...
>
> ratsubst(z,x,%e^x) => %e^z OK
> ratsubst(z,x-y,x-y) => z OK
> ratsubst(z,x-y,%e^(x-y)) => %e^(x-y) ???
>
> ratsubst(z,x+y,x-y) => 2*x-z OK
> ratsubst(z,x-y,x+y) => 2*x-z OK
> ratsubst(z,%e^(x-y),%e^(x+y)) => %e^(2*y)*z OK
> ratsubst(z,%e^(x+y),%e^(x-y)) => %e^(x-y) ???
>
> ratsubst( z,x-y,x+y) => 2*x-z OK
> ratsubst( z,x-y,f(x+y)) => f(2*x-z) OK
> ratsubst( z,x-y,%e^(x+y)) => %e^(x+y) ???
>
> On 9/6/07, Richard Fateman <fateman at cs.berkeley.edu> wrote:
> > Try ratsubst(z,exp(x-y),%);
> > subst(exp(x-y),z,%);
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>