### 11.1.4 Converting to a symbolic polynomial

The r2e or poly2symb command converts lists into symbolic polynomials.

- For one-variable polynomials, r2e takes one mandatory argument and one optional argument:
  - L, a list of coefficients of a polynomial (in decreasing order),
  - x, a symbolic variable name (by default x).
- r2e(L⟨,x⟩) returns the corresponding polynomial with the given variable.
- For sparse multivariate polynomials, r2e takes two arguments:
  - S, a sum of monomials of the form %%%{coeff,[n1,…,nk]%%%}.
  - vars, a vector of symbolic variables.
- r2e(S⟨,vars⟩) returns the corresponding polynomial as an expression with the given variables

.

#### Examples

r2e([1,0,-1],x)

or:

r2e([1,0,-1])

or:

poly2symb([1,0,-1],x)

x x−1 |  |  |  |  |  |  |  |  |  |

poly2symb(%%%{1,[2]%%%}+%%%{-1,[0]%%%},[x])

or:

r2e(%%%{1,[2]%%%}+%%%{-1,[0]%%%},[x])

x2−1 |  |  |  |  |  |  |  |  |  |

r2e(%%%{1,[2,0]%%%}+%%%{-1,[1,1]%%%}+%%%{2,[0,1]%%%},[x,y])

or:

poly2symb(%%%{1,[2,0]%%%}+%%%{-1,[1,1]%%%}+%%%{2,[0,1]%%%},[x,y])

x2−x y+2 y |  |  |  |  |  |  |  |  |  |