# Mapping an exponential function to a Polynomial

**URL:** <https://community.wolfram.com/t/mapping-an-exponential-function-to-a-polynomial/21023>\
**Category:** Questions\
**Tags:** algebra\
**Created:** [November 10, 2022, 4:54pm UTC](https://community.wolfram.com/t/mapping-an-exponential-function-to-a-polynomial/21023 "2022-11-10T16:54:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@ian](https://community.wolfram.com/u/ian)\
**Post date:** [November 10, 2022, 4:54pm UTC](https://community.wolfram.com/t/mapping-an-exponential-function-to-a-polynomial/21023/1 "2022-11-10T16:54:52Z")

</div>

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!

◔

---

<div class="post-metadata">

**Author:** ![dontdont9](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@dontdont9](https://community.wolfram.com/u/dontdont9)\
**Post date:** [November 10, 2022, 8:01pm UTC](https://community.wolfram.com/t/mapping-an-exponential-function-to-a-polynomial/21023/2 "2022-11-10T20:01:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@ian](https://community.wolfram.com/u/ian)\
**Post date:** [November 11, 2022, 8:10am UTC](https://community.wolfram.com/t/mapping-an-exponential-function-to-a-polynomial/21023/3 "2022-11-11T08:10:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hansmilton](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hansmilton/32/8656_2.png) [@hansmilton](https://community.wolfram.com/u/hansmilton)\
**Post date:** [November 11, 2022, 10:14am UTC](https://community.wolfram.com/t/mapping-an-exponential-function-to-a-polynomial/21023/4 "2022-11-11T10:14:06Z")

</div>

After looking at the `FullForm` of the exponential powers:

◔

---

<div class="post-metadata">

**Author:** ![anon21378091](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@anon21378091](https://community.wolfram.com/u/anon21378091)\
**Post date:** [November 11, 2022, 11:55am UTC](https://community.wolfram.com/t/mapping-an-exponential-function-to-a-polynomial/21023/5 "2022-11-11T11:55:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hansmilton](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hansmilton/32/8656_2.png) [@hansmilton](https://community.wolfram.com/u/hansmilton)\
**Post date:** [November 12, 2022, 11:13am UTC](https://community.wolfram.com/t/mapping-an-exponential-function-to-a-polynomial/21023/6 "2022-11-12T11:13:53Z")

</div>

Simplified the replacement a bit:

◔

---

<div class="post-metadata">

**Author:** ![ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@ian](https://community.wolfram.com/u/ian)\
**Post date:** [November 14, 2022, 2:49pm UTC](https://community.wolfram.com/t/mapping-an-exponential-function-to-a-polynomial/21023/7 "2022-11-14T14:49:57Z")

</div>

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](https://community.wolfram.com/uploads/short-url/tBmOazO6A9M0cyZXMilrRBGfJnv.nb) (2.65 KB)

---

<div class="post-metadata">

**Author:** ![hansmilton](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hansmilton/32/8656_2.png) [@hansmilton](https://community.wolfram.com/u/hansmilton)\
**Post date:** [November 14, 2022, 6:10pm UTC](https://community.wolfram.com/t/mapping-an-exponential-function-to-a-polynomial/21023/8 "2022-11-14T18:10:06Z")

</div>

Check this:

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/0e949b51-5982-42ad-b3ff-e3b4b1013030)
