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
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.