I was wondering about this myself. Maple has a command that does
exactly this (I think it is the "ops" command). Do you think SAGE should have
an "official" analog of that?

On Wed, Jul 2, 2008 at 11:33 PM, Mike Hansen <[EMAIL PROTECTED]> wrote:
>
> Hi Phil,
>
> I don't think there is an official way to get at the terms, but here
> is something that works:
>
> sage: var('x,y')
> (x, y)
> sage: t = x^2 + y^2
> sage: type(t)
> <class 'sage.calculus.calculus.SymbolicArithmetic'>
> sage: t._operator
> <built-in function add>
> sage: t._operands
> [x^2, y^2]
> sage: t._operands[0]
> x^2
>
> --Mike
>
> On Wed, Jul 2, 2008 at 7:49 PM, phil <[EMAIL PROTECTED]> wrote:
>>
>> I've looked around in the documentation but have not been able to
>> figure out how to access individual terms in an symbolic expression.
>> For example:
>> var('x,y')
>> t = x^2 + y^2
>>
>> How do I access the first term in t?  I want to assign it to another
>> variable, like first_term = t.extract_term(t,1) to get first_term to
>> be x^2.
>>
>> Thanks
>>
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to