0
$\begingroup$
ET[t] := 
  E1*Exp[-I*w1*t] + E2*Exp[-I*w2*t] + E3*Exp[-I*w3*t] + 
   E1*Exp[I*w1*t] + E2*Exp[I*w2*t] + E3*Exp[I*w3*t];
THGExp[t] = ET[t]*ET[t]*ET[t]//Expand;

I want to group terms in THGExp[t] with the same exponential together. But I don't know exactly how should I do this? Could anyone give me some hints?

$\endgroup$
1
  • 1
    $\begingroup$ Try Collect[#,Exp[_],Simplify]&. $\endgroup$
    – Lacia
    Commented Sep 18, 2023 at 1:39

2 Answers 2

1
$\begingroup$

You may use "GroupB" and a function that extracts the exponent:

(# /. ___ Exp[e_] -> e) &

With this:

GatherBy[List @@ THGExp[t], (# /. ___ Exp[e_] -> e) &]

enter image description here

$\endgroup$
0
$\begingroup$

Turn the comment to an answer:

Collect[THGExp[t], Exp[_], Simplify]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.