subst problems



Richard Hennessy wrote:
> Does anyone know a better command than subst for changing variables in expressions not containing integrate?  I can't get subst to work right sometimes.
>
> (%i1) 2*p+2*m*k=y$
> (%i2) subst(p, m*k);
> (%o2) 2*p+2*m*k=y
>
> It has no affect.
>
> Rich
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>   
Is this what you want?
(%o14) 2*p+2*k*m = y
(%i15) subst(m=p^(1/2),subst(k=p^(1/2),%o14));

(%o15) 4*p = y



-sen