Question: get coefficients with frontend and "wildcards"

Hi there!

Suppose I have an expression

Expr:=a*f(x[0],...) + b*f(x[1],...) + c*f(x[2],...),  

where the ellipses represent (different) functions of x[0]..x[2]. I'd like to use frontend to get the coefficients a, b, c corresponding to x[0], x[1] and x[2]. If the function f only has one argument, that's peanuts:

seq(frontend(coeff, [Expr, v]), v = [f(x[0]), f(x[1]), f(x[2])]);

(see: www.mapleprimes.com/forum/extractcoefficientsgeneralnonpolynomialexpression )

But how can I do this when I have two arguments, but where the coefficient I want only depends on the first one. Is there a way to put a wildcard in the sequence (for the second argument)?

Thanks!

Please Wait...