equivalent of subst(a,f(x),equation) ?



On Wednesday 29 October 2008 23:41:24 N.A.Beishuizen at ctw.utwente.nl 
wrote:
> I have only used maxima for a week now and I couldn't find
> how to do this using the descriptions in the manual.
>
> I have an equation containing f(x), eg
> eq: f(x)*g(x)*x*sin(f(x)
> I want f(x) to be replaced by a so the equation is eq:
> a*g(x)*x*sin(a). How can I do this? Subst does not accept these
> type of substitutions.

  (%i1) eq : f(x)*g(x)*x*sin(f(x));
  (%o1) x*f(x)*g(x)*sin(f(x))
  (%i2) subst (a, f(x), eq);
  (%o2) a*sin(a)*x*g(x)
  (%i3) subst (lambda([x],a), f, eq);
  (%o3) a*sin(a)*x*g(x)

-- 
Boomtime, Aftermath 10 YOLD 3174
Alexey Beshenov  http://beshenov.ru/