1 | initial version |
The methods operator
and operands
for symbolic expressions are what you are looking for.
sage: b, h, x = var('b h x')
sage: expr = x * b * cos(x^3) * sin(b)+b * cos(x)+h * sin(x)
sage: expr.operator()
<function add_vararg at 0x10abe0aa0>
sage: expr.operands()
[b*x*cos(x^3)*sin(b), b*cos(x), h*sin(x)]