polynomial question



Here is a simple approach.

ratweight(x,1,y,1,z,1)$         /* Define polynomial variables; other
symbols will be parameters. */

homogeneous_part(p,m) := block([ratwtlvl:m],rat(p))- (if m=0 then 0 else
block([ratwtlvl:m-1],rat(p)) ) $

homogeneous_part( (x+a*y-a)^3, 0) => -a^3
homogeneous_part( (x+a*y-a)^3, 1) => 3*a^3*y+3*a^2*x
homogeneous_part( (x+a*y-a)^3, 2) => -3*a^3*y^2-6*a^2*x*y-3*a*x^2
homogeneous_part( (x+a*y-a)^3, 3) => a^3*y^3+3*a^2*x*y^2+3*a*x^2*y+x^3
homogeneous_part( (x+a*y-a)^3, 4) => 0

Is that what you had in mind?  Of course, if you want to use the
ratweight/ratwtlvl scheme in other ways, you have to make the ratweights
local (a bit painful).

           -s

On Sun, Aug 31, 2008 at 2:11 PM, Sheldon Newhouse <sen1 at math.msu.edu> wrote:

> Let p be a polynomial in k variables of degree n.
> For 1 <= m <=n is there a a built-in maxima routine which will give the
> homogeneous part of p of order m?
>