Function Repository Resource:

CoefficientMap

Source Notebook

Map a function over the coefficients of a polynomial

Contributed by: Daniel Robinson and Jon McLoone

ResourceFunction["CoefficientMap"][f,p]

maps the function f over the coefficients of polynomial p.

ResourceFunction["CoefficientMap"][f,p,vars]

maps the function f over the coefficients of polynomial p in variables vars.

Examples

Basic Examples (2) 

Map an arbitrary function over the coefficients of a polynomial:

In[1]:=
ResourceFunction["CoefficientMap"][f, 1 + 2 x]
Out[1]=

Take the square root of the coefficients of a polynomial:

In[2]:=
ResourceFunction["CoefficientMap"][Sqrt, 4 + 16 x + 25 x^2]
Out[2]=

Scope (2) 

By default none of the variables identified by Variables will be considered part of the coefficient:

In[3]:=
ResourceFunction["CoefficientMap"][f, 2 x - 4 y x^3]
Out[3]=

When specifying the variables of the polynomial using a third arguments, other symbols will be considered part of the coefficient:

In[4]:=
ResourceFunction["CoefficientMap"][f, 2 x - 4 y x^3, {x}]
Out[4]=

Publisher

Jon McLoone

Version History

  • 1.0.0 – 05 July 2022

Related Resources

License Information