> Do you mean that you want to get Maxima to transform f(z)+a*f(y)+f(x) into f(z+a*y+x)?
My favorite method for doing things such as a * f(x) --> f(a*x) is to substitute a lambda form for multiplication.
There are other approaches, but I don't know much about them. Try something like:
(%i1) inverse_outative(e,f) := subst("*" = lambda([[l]], block([listarith : true, farg : false, q : 1, lx],
for lx in l do (
if farg=false and not mapatom(lx) and op(lx)='f then (
farg : true,
lx : args(lx)),
q : q * lx),
if farg then funmake('f, inverse_outative(q,'f)) else q)), e)$
Examples:
(%i2) inverse_outative(5*f(x) + 7 * f(y) + 42,f);
(%o2) f(7*y)+f(5*x)+42
(%i3) inverse_outative(5*f(p) / (1 + 7 * f(q)),f);
(%o3) f((5*p)/(f(7*q)+1))
The function inverse_outative is recursive (and I hope it isn't infinitely recursive)
(%i4) inverse_outative(5*f(f(x)),f);
(%o4) f(f(5*x))
Maybe OK, maybe not:
(%i5) inverse_outative(5*f(),f);
(%o5) f()
Bug: OK
(%i6) inverse_outative([u,n,k]*f(5),f), listarith : true;
(%o6) [f(5*u),f(5*n),f(5*k)]
Not OK:
(%i7) inverse_outative([u,n,k]*f(5),f), listarith : false;
fullmap: arguments must have same formal structure.
Not sure what is desired for products of f
(%i8) inverse_outative(f(x)*f(5)*f(78),f);
(%o8) f(f(f(390*x)))
The function inverse_additive could follow the same pattern--just substitute a lambda form for "+". If you try this method
and get stuck, let us know.
--Barton