Question: best way to split up expressions

what is the best way to "extract" a list of terms from a sum of terms.

So something like this::

split_expr(a+b+3) should return [a,b,3]

split_expr(diff(x(t),t)) should return  [ diff(x(t),t)]

split_expr(Int(abc(t), t=2..3) + 3) should return [Int(abc(t), t=2..3) , 3]

I very often have expressions with sums of many terms, and need to run some command on each element (say simplify, or collect, etc)... i've been using convert(expr, list) to split things up, apply a command and recombine, but the convert command breaks on some cases. Maybe this is something that maple can do natively?


Please Wait...