How to extract polynomial from the sum(polynomial,x,1,n)



Hi all,

I am new to Maxima. Please tell me how to extract any function/polynomial
enclosed inside sum and store it in a variable. I tried to use pattern
matching using defmatch but couldnt get through.
e.g. sum(f(x,i)*(f(y)*x+f(z)),i,1,n)
I want f(x,i)*(f(y)*x+f(z)) from the above expression.

Regards
Dileep