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



hi dileep,

> 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.

args (expr); => arguments of expression

args (sum (<my summand>, i, 1, n)); => <my summand>

however, maxima notices (f(y)*x+f(z)) doesn't depend on i
so it moves that outside the summation.
so args (sum(f(x,i)*(f(y)*x+f(z)),i,1,n)); doesn't yield
the summand as you have entered it.

related function op returns the operator,
e.g. op (sum (<stuff>)); => sum

op and args work on any kind of expression,
e.g. op (a + b + c); => "+", args (a + b + c); => [a, b, c]

hth
robert dodier