Hello,

2009/10/12  <wxu...@sohu.com>:
>
> Hi, I have another question.
>
> I have got the expression,
>
> a^2*x^4+b*x^4+c*x+d*y*x^4...(many items)
>
> I want to get the coefficient of all the x,x^2,x^3,x^4....
>
> here for x^4 is (a^2+b+d*y...)
>
> how can I get it?

Something like this:

sage: var('a,b,c,d,x,y')
(a, b, c, d, x, y)
sage: ex = a^2*x^4+b*x^4+c*x+d*y*x^4
sage: ex.coefficient(x^4)
a^2 + d*y + b

--Mike

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to