Previous Up Next

11.5.4  Building a polynomial from its evaluation

The genpoly command finds a polynomial which evaluates to a given polynomial.

Examples

genpoly(61,6,x)
     
x2−2 x+1           

Indeed 61 divided by 6 is 10 with remainder 1, then 10 divided by 6 is 2 with remainder −2 (instead of the usual quotient 1 and remainder 4 out of bounds), 61=2· 62−2· 6+1.

genpoly(5,6,x)
     
x−1           

Indeed, 5=6−1.

genpoly(7,6,x)
     
x+1           

Indeed, 7=6+1.

genpoly(7*y+5,6,x)
     
x y+x+y−1           

Indeed, xy+x+y−1=y(x+1)+(x−1).

genpoly(7*y+5*z^2,6,x)
     
x y+x z2+yz2           

Indeed, xy+xz+yz=y(x+1)+z(x−1).


Previous Up Next