coefficients of a polynomial in two or more variables



Christian Stengg wrote:


> Hello,
>
> I have experimented on your suggestions and came across the following problem:
>
> (%i1) p1:a*x^2+b*x*y+c*y^2+d*x+e*y+f;
> ratcoef(p1,x*y);
> hipow(p1,x*y);
> bothcoef(p1,x*y);
> hipow(p1,b*x*y);
> bothcoef(p1,b*x*y);
>   

I think that you will get the behavior you wish if you do this:

p1 :  rat(p1);

bothcoef(p1,x*y).

with such input in rat form,   bothcoef uses ratcoef, which seems to 
work correctly.
otherwise, bothcoef uses coef, which seems to do the wrong thing here.

RJF