Mapping an exponential function to a Polynomial

Sorry for what is probably a naive question…

I can map a polynomial to an exponential function

In[940]:= ClearAll [a, b, c , x, \[Theta]]
a x + b x^2 + c  /. x -> Exp[\[Theta] I Pi]

Out[941]= c + a E^(I \[Pi] \[Theta]) + b E^(2 I \[Pi] \[Theta])

But how do I do the reverse and take a function which is powers of an exponential and substitute to get a polynomial in x? The example below substitutes the first order power, but fails for higher powers.

In[942]:= ClearAll [a, b, c , x, \[Theta]]
a  Exp[\[Theta] I Pi] + b Exp[2 \[Theta] I Pi] + c  /. 
 Exp[\[Theta] I Pi] -> x

Out[943]= c + b E^(2 I \[Pi] \[Theta]) + a x

Thanks!

◔

Pattern matching is really literal. It matches Exp[θ I π]->x but doesn’t understand the “meaning,” so that won’t match Exp[2 θ I π] and turn that into x^2. This

a Exp[θ I π]+b Exp[2 θ I π]+c/.{Exp[θ I π]->x,Exp[2 θ I π]->x^2}

is literal enough for it to understand and work for you.

Thank you for taking the time to reply.
My actual problem involves many more powers. I can see that I could map them all individually, but naturally I had hoped for a more general solution.

After looking at the FullForm of the exponential powers:

◔

Thank you. That works perfectly for both positive and negative powers of x, which is what I needed.

Simplified the replacement a bit:

◔

Thank you.
I am still puzzled by some of this behaviour. For example, why would only one term in the following be recognized.

mapping question 2.nb (2.65 KB)

Check this: