 FromCoefficientList - Maple Help

PolynomialTools

 FromCoefficientVector
 return a univariate polynomial from a Vector of coefficients
 FromCoefficientList
 return a univariate polynomial from list of coefficients Calling Sequence FromCoefficientList(L, vars, opts) FromCoefficientVector(L, vars, opts) Parameters

 L - list of coefficients var - name,list for the polynomial variable(s) opts - (optional) equations of the form option=value (see below) Options

 • termorder = forward, reverse
 By default, the first entry of the output will be the constant coefficient of the polynomial.  If reverse is specified, the last entry of the output will be the constant coefficient.
 • form = monomial, horner
 The polynomial is constructed in standard monomial form by default, but can be created in Horner form also known as nested multiplication form. Description

 • The FromCoefficientList(L, vars) calling sequence returns a polynomial in vars from a list of coefficients.
 • The FromCoefficientVector(L, vars) calling sequence returns a polynomial in vars from a vector of coefficients.
 • These are inverse commands to CoefficientList and CoefficientVector.
 • FromCoefficientVector is written to handle sparse Vector inputs efficiently.
 • These commands now support polynomials in many variables. Examples

 > $\mathrm{with}\left(\mathrm{PolynomialTools}\right):$
 > $\mathrm{FromCoefficientList}\left(\left[1,-1,2,3\right],x\right)$
 ${3}{}{{x}}^{{3}}{+}{2}{}{{x}}^{{2}}{-}{x}{+}{1}$ (1)
 > $\mathrm{FromCoefficientList}\left(\left[1,-1,2,3\right],x,\mathrm{form}=\mathrm{horner}\right)$
 ${x}{}\left({-}{1}{+}{x}{}\left({2}{+}{3}{}{x}\right)\right){+}{1}$ (2)
 > $\mathrm{FromCoefficientList}\left(\left[1,0,0,2,0\right],x,\mathrm{termorder}=\mathrm{reverse}\right)$
 ${{x}}^{{4}}{+}{2}{}{x}$ (3)
 > $\mathrm{FromCoefficientList}\left(\left[-7,22,-55,-94,87,-56\right],\left[x,y\right]\right)$
 ${-}{94}{}{{x}}^{{2}}{+}{87}{}{x}{}{y}{-}{56}{}{{y}}^{{2}}{+}{22}{}{x}{-}{55}{}{y}{-}{7}$ (4)
 > $\mathrm{FromCoefficientVector}\left(⟨{y}^{3},-{y}^{2},y-2,1⟩,x\right)$
 ${{y}}^{{3}}{-}{{y}}^{{2}}{}{x}{+}\left({y}{-}{2}\right){}{{x}}^{{2}}{+}{{x}}^{{3}}$ (5)
 > $\mathrm{FromCoefficientList}\left(\left[\right],x\right)$
 ${0}$ (6)
 > $\mathrm{FromCoefficientVector}\left(\mathrm{CoefficientVector}\left(0,x\right),x\right)$
 ${0}$ (7)

Most vector shapes will be handled efficiently

 > $\mathrm{v1}≔\mathrm{Vector}\left(500000001,\mathrm{shape}=\mathrm{unit}\left[300\right]\right):$
 > $\mathrm{FromCoefficientVector}\left(\mathrm{v1},x\right)$
 ${{x}}^{{299}}$ (8)
 > $\mathrm{v2}≔\mathrm{Vector}\left(200000001,\mathrm{shape}=\mathrm{scalar}\left[50000,a\right]\right):$
 > $\mathrm{FromCoefficientVector}\left(\mathrm{v2},x\right)$
 ${a}{}{{x}}^{{49999}}$ (9)
 > $\mathrm{v3}≔\mathrm{Vector}\left(10,\mathrm{shape}=\mathrm{constant}\left[{b}^{2}-1\right]\right):$
 > $\mathrm{FromCoefficientVector}\left(\mathrm{v3},x\right)$
 ${{b}}^{{2}}{-}{1}{+}\left({{b}}^{{2}}{-}{1}\right){}{x}{+}\left({{b}}^{{2}}{-}{1}\right){}{{x}}^{{2}}{+}\left({{b}}^{{2}}{-}{1}\right){}{{x}}^{{3}}{+}\left({{b}}^{{2}}{-}{1}\right){}{{x}}^{{4}}{+}\left({{b}}^{{2}}{-}{1}\right){}{{x}}^{{5}}{+}\left({{b}}^{{2}}{-}{1}\right){}{{x}}^{{6}}{+}\left({{b}}^{{2}}{-}{1}\right){}{{x}}^{{7}}{+}\left({{b}}^{{2}}{-}{1}\right){}{{x}}^{{8}}{+}\left({{b}}^{{2}}{-}{1}\right){}{{x}}^{{9}}$ (10)
 > $\mathrm{v4}≔\mathrm{Vector}\left(1000000001,\left\{1=5,1000000001=1\right\},\mathrm{storage}=\mathrm{sparse}\right):$
 > $\mathrm{FromCoefficientVector}\left(\mathrm{v4},x\right)$
 ${{x}}^{{1000000000}}{+}{5}$ (11) Compatibility

 • The  option was updated in Maple 2021.