Re: rules problems (was: polynom -> list)
- Subject: Re: rules problems (was: polynom -> list)
- From: Frank Thieme
- Date: Sun, 19 Dec 2004 16:32:23 +0100
On Son, 2004-12-19 at 10:25 -0500, Viktor T. Toth wrote:
> (%i2) declare(abl,additive);
> (%o2) done
> (%i3) abl(x^2+3*x,x);
> 2
> (%o3) abl(x , x) + abl(3 x, x)
I see, really nice - but don't know why it does not work...
(%i2) abl(f,x) := COEFF(f,x,HIPOW(f,x))*HIPOW(f,x)*x^(HIPOW(f,x)-1);
HIPOW(f, x) - 1
(%o2) abl(f, x) := COEFF(f, x, HIPOW(f, x)) HIPOW(f, x) x
(%i3) declare(abl,additive);
(%o3) DONE
(%i4) abl(5*x^2+2*x,x);
(%o4) 10 x
but:
(%i6) declare(abl1,additive);
(%o6) DONE
(%i7) abl1(5*x^2+2*x,x);
2
(%o7) abl1(5 x , x) + abl1(2 x, x)