### 11.1.5 Converting from a symbolic polynomial

The e2r or symb2poly command converts a symbolic polynomial into a list (for single variable polynomials) or a sum of monomials.

- e2r takes two arguments:
  - P, a symbolic polynomial.
  - vars, the variable name (for one variable polynomials) or a list of variable names (for multivariable polynomials).

    For one variable polynomials, this is optional and defaults to x.

- e2r(P ⟨,vars ⟩) returns the representation of the polynomial as a list of coefficients written in decreasing order, if vars is a variable name, or a sum of monomials (sparse representation of multivariate polynomials) if vars is a list.

#### Examples

e2r(x^2-1)

or:

symb2poly(x^2-1)

or:

symb2poly(y^2-1,y)

or:

e2r(y^2-1,y)

▯ 1,0,−1 ▯ |  |  |  |  |  |  |  |  |  |

e2r(x^2-x*y+y,[x,y])

or:

symb2poly(x^2-x*y+2*y,[x,y])

%%%{1,[2,0]%%%}+%%%{−1,[1,1]%%%}+%%%{2,[0,1]%%%} |  |  |  |  |  |  |  |  |  |