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



Hi Dileep,
Welcome to Maxima! You may want to try the "part" function. For
example,
(%i1) a:sum(f(x,i),i,1,n)$
(%i2) part(a,1);
(%o2)                f(x, i)

In the case of yours example, Maxima is likely to factor out the
(f(y)*x+f(z)) part, so if you do
(%i3) b: sum(f(x,i)*(f(y)*x+f(z)),i,1,n);
then use
   part(part(b,1),1)*part(b,2);

Hope this helps.
Milan

* dp2 at cise.ufl.edu <dp2 at cise.ufl.edu> [2006-02-03 23:31:40 -0500]:

> 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
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima

--