Question: Simplifying an exponential (say via 'collect')

Hi:

Say I have an expression like this:

a0:=I*(m*x+mp*x-omega[m]*t-omega[mp]*t);

I can factor out x,t and get an expected result:
collect(a0, [x,t]);

But how would I do it if I want to force Maple to act on the argument of exp?

a1:=exp(a0);

This doesn't work:
collect(a1, [x,t])

This will do what I want for this expression but maybe not in general:
simplify(a1, size)


So I tried using 'applyrule'

collectExp:=proc(v_exp, v_collect)
 local c1, c2:
 applyrule(c1::algebraic * exp(c2::algebraic)=(  c1 * exp(collect(c2, v_collect))), v_exp);
end;
    
But doing
collectExp(a1, [x,t])
does not work. Does anyone know why??

Also, interesting fact, if I define a rule like this:
 
collectExp:=proc(v_exp, v_collect)
 local c1, c2:
 applyrule(c1::algebraic * exp(c2::algebraic)=(  c1 * c2 * exp(collect(c2, v_collect))), v_exp);
end;

and call
collectExp(a1, [x,t])

Maple just never returns.


So
1) why my collectExp does not work? Is 'collect' effectively not actually executed by Maple?
2) What is the easiest way to do operations (say 'collect' or 'simplify' or 'whatever') on arguments of exp?

thanks!

Please Wait...