Message Boards Message Boards

0
|
2331 Views
|
7 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Mapping an exponential function to a Polynomial

Posted 1 year ago

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!

POSTED BY: Ian Billington
7 Replies
Posted 1 year ago

Check this:

POSTED BY: Hans Milton

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

Attachments:
POSTED BY: Ian Billington
Posted 1 year ago

Simplified the replacement a bit:

POSTED BY: Hans Milton
Posted 1 year ago

After looking at the FullForm of the exponential powers:

POSTED BY: Hans Milton
Posted 1 year ago

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

POSTED BY: Updating Name
Posted 1 year ago

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.

POSTED BY: Bill Nelson

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.

POSTED BY: Ian Billington
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract