## A problem with getting a coefficient

0

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.

2Since the documentation on Coefficient[] speaks of polynomials only, why do you expect anything sensible? – Igor Rivin – 2014-10-06T17:19:26.427

@IgorRivin So is it possible to do what I want? – Vladimir – 2014-10-06T17:20:46.520

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? – Igor Rivin – 2014-10-06T17:22:14.663

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. – Vladimir – 2014-10-06T17:24:36.740

The question is whether your terms are textually explicit (if yes, it is not too hard to do with patterns, if not, it becomes a little iffy). – Igor Rivin – 2014-10-06T17:26:04.573

Not to mention that you could multiply any expression by E^(a t) E(-a t). That's why it makes sense for polynomials only. – Dr. belisarius – 2014-10-06T17:28:00.933

Anyway thank you for help. I think I need to reconsider something in my program when working with exponents. The Coefficient[] does not fit to my problem because it is not a polynomial. – Vladimir – 2014-10-06T17:36:36.477

2Possibly 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]. – Daniel Lichtblau – 2014-10-06T17:54:15.857

2

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

(* Exp[-I a b] *)


You can delete your comment, just click on the "X" sign next to the time. I'll delete mine, I can't delete yours. – RunnyKine – 2014-10-06T19:48:03.840