Revision history [back]

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()