collect
tatiana
tatiana.zolo at libero.it
Thu Jan 24 23:36:41 CET 2002
Hi,
I don't understand some answer about the method collect().
If it is able to collect with 'sin($1)' the polynomial 'a'
why not the polynomials 'b' or 'c' with '2^$1' or '$1^n'?
> a=d*p*sin(x)+p*sin(x)+q*sin(y)+q*d*sin(y)+sin(y)+d*sin(y)+q*sin(x);
q*sin(y)+sin(x)*p+d*sin(y)+sin(y)+d*q*sin(y)+sin(x)*q+sin(x)*d*p
> collect(a,find(a,sin($1)));
sin(y)*(1+d+q+d*q)+sin(x)*(q+p+d*p)
> b=q*2^y+2^x*p+d*2^y+2^y+d*q*2^y+2^x*q+2^x*d*p;
q*2^y+d*2^y+2^x*d*p+2^x*p+2^y+d*q*2^y+2^x*q
> collect(b,find(b,2^($1)));
q*2^y+d*2^y+2^x*d*p+2^x*p+2^y+d*q*2^y+2^x*q
> c=n*2^n+n-3+3^n-n^2*2^n;
-3+2^n*n-2^n*n^2+3^n+n
> collect(c,find(c,$1^n));
-3+2^n*n-2^n*n^2+3^n+n
Thanks in advance,
Tatiana Zolo
More information about the GiNaC-list
mailing list