Question: how to obtain left part and right part of expression of type *

given an expression such as expr:=-1/2*x*(y^2-1) which in tree form will be

I can get -1/2 using op(1,expr).   I need command to return the "rest" of the right side of the tree, all of it, not matter how big.

I tried op(2..nops(expr),expr) and that returns x, y^2 - 1 

Is there a way to return directly x*(y^2-1)*etc....  so I do not have to play around with the above expression sequence?  Another option is to type


to get the right side of the tree. But this seems like a hack. Do not like to divide. worry about zero.

The same thing if the type was `+`, I want to get  the whole right side in one command.

Again, I can do  expr-op(1,expr) to get the whole right side. But this also seems like  a hack, altought not as bad as with  the case above

Any hints on how to best do these things?

Maple 2019.1




Please Wait...