Converting to a symbolic polynomial: r2e poly2symb

### 6.27.4 Converting to a symbolic polynomial: r2e poly2symb

The r2e command converts lists into symbolic polynomials.
poly2symb is a synonym for r2e here.

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.

Example:
Input:

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

or:

r2e([1,0,-1])

or:

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

Output:

x x−1

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:

- Input:
  poly2symb(%%%{1,[2]%%%}+%%%{-1,[0]%%%},[x])
  or:
  r2e(%%%{1,[2]%%%}+%%%{-1,[0]%%%},[x])
  Output:

  x2−1

- Input:
  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])
  Output:

  x2−x y+2 y