# A problem with getting a coefficient

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.

• Since the documentation on Coefficient[] speaks of polynomials only, why do you expect anything sensible? Oct 6 '14 at 17:19
• @IgorRivin So is it possible to do what I want? Oct 6 '14 at 17:20
• I am sure it is possible, but it may be a little painful, the question is: what is it you are really trying to do? Oct 6 '14 at 17:22
• I need to collect the coefficients of exponents with particular powers e.g. E^(I a t), E^(I b t) and so on. Now I see that it is not a Coefficient[] but any other method. Somehow I did not pay attention that Coefficient[] processes only polynomials. Oct 6 '14 at 17:24
• Possibly you can get the sort of behavior you want by using TrigExpand[ExpToTrig[expression]] and the trying to extract the coefficients of Cos[a*t] and Sin[a*t]. Another approach would be to recast as an explicit polynomial, by converting Exp[I*a*t] to a "variable" eiat and likewise for Exp[I*a*b]. Oct 6 '14 at 17:54

Coefficient[E^(I a (t - b)) // ExpandAll, E^(I a t)]