I have some enormous expression with many complex exponentials. Some of these are time varying, others are just phase terms. Here is a small piece of the expression that I hope fully captures the behavior of the full expression for the purposes of this question.
expr = 4 E^((6 I L w)/c + (4 I L wm)/c + 2 I t wm) E0^2 r1^2 +
4 E^((4 I L w)/c + (4 I L wm)/c - I t wm) E0^2 r1 r2 tr^2 +
4 E^((8 I L w)/c + (2 I L wm)/c + I t wm) E0^2 r1 r2 tr^2 +
4 E^((8 I L w)/c + (4 I L wm)/c + 2 I t wm) E0^2 r1 r2 tr^2
I would like to collect these expressions so that each oscillating frequency is factored out like so:
E^(-I t wm) (4 E^((8 I L w)/c + (2 I L wm)/c) E0^2 r1 r2 tr^2 +
4 E^((4 I L w)/c + (4 I L wm)/c) E0^2 r1 r2 tr^2) +
E^(2 I t wm) (4 E^((6 I L w)/c + (4 I L wm)/c) E0^2 r1^2 +
4 E^((8 I L w)/c + (4 I L wm)/c) E0^2 r1 r2 tr^2)
I can do this with Collect[expr, {E^(2 I t wm), E^(- I t wm)}]
just fine, but I have a lot of different frequencies and I don't want to manually enumerate them. I guess I could try to extract them from the big expression, but I feel like I should be able to do this with just Collect
. I've tried the most obvious thing Collect[expr, E^(__ t)]
. But that doesn't seem to work.