I try
Coefficient[E^(I a (t - b)), E^(I a t)]
and expect the output
E^(-I a b)
but in fact I get 0
.
What should be corrected in my code? I cannot solve this problem for a week.
Coefficient[E^(I a (t - b)) // ExpandAll, E^(I a t)]
(* Exp[-I a b] *)
Coefficient[]
speaks of polynomials only, why do you expect anything sensible? $\endgroup$TrigExpand[ExpToTrig[expression]]
and the trying to extract the coefficients ofCos[a*t]
andSin[a*t]
. Another approach would be to recast as an explicit polynomial, by convertingExp[I*a*t]
to a "variable"eiat
and likewise forExp[I*a*b]
. $\endgroup$