Logged In: YES
user_id=588346

Maxima actually should be able to do this one if you declare
any one of f, g, or x to be nonscalar:

declare(a,nonscalar)
map(nonscalarp, [ a, f(a), a(1), a(x), f(a(x)) ] ) => all true

Diff could perfectly well check nonscalarp; so this is a bug in
diff.

Note that nonscalarp assumes by default that functions of
nonscalars are nonscalar. If you want a scalar function of a
non-scalar, you need to explicitly declare it:

declare([ns],nonscalar);
declare([s],scalar);
nonscalarp(f(ns)) => true
nonscalarp(s(ns)) => false

By the way, Maxima has no way of distinguishing the variable
a from the function a.

I am not sure what the right way to handle transpose is.