Question: Finding operands and operating on multiple operands

Hello Maple gurus!

I have two questions related to working with operands:

Question 1

I often find myself in a situation where I have a non-trivial expression for instance containing double integrals with complex exponentials, and want to perform some operation on a heavily nested operand like the exponent to a specific exponential inside the double integral. Usually what I do is use a list argument with the op() or subsop() to operate on the nested operator by finding specific operand numbers.

However, the problem with this is that I am hard-coding the operand number(s) for the operator, and this expression can be located in the middle of a large worksheet. If something above these op() or subop() calls changes and the changes trickle down, the operands might change number and the commands are no longer valid.

Does Maple have any commands that will let me 'find' an operand like one does in by-hand calculations? For example, there might be an exponent nested in a double integral that has 'a*b' in it. What I want is to operate on the operand containing 'a*b' rather than specifying the actual operand number. Is there anything like this?

Question 2

Somewhat related to the above, I sometimes want to do a single function on multiple operands. I tried applyop but that seems to apply a function to each operand individually. What if, for example, I want to run combine() on 2 specific operands, assuming these operands are heavily nested, to combine just those two operands.

Thank you!

Please Wait...