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



N.A.Beishuizen at ctw.utwente.nl wrote:
> Hello,
> 
> 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.

This works for me:

(%i3) f(x)*g(x)*x*sin(f(x));
(%o3)                        x f(x) g(x) sin(f(x))
(%i4) subst([f(x)=a],%o3);
(%o4)                           a sin(a) x g(x)

Ray