\section{Generic Polynomial Arithmetics}

This module introduces polynomials in one variable to Rascal. You may create
polynomials by the "poly"-function, but it is very useful to assign the
variable X the monome 1*X\^{ }1. Then you can easily enter the polynomials.

\begin{lyxcode}
>X=poly("X");

>p=2*X+X*X+4

~X\^{ }2+2*X+4

>p*p

~X\^{ }4+4*X\^{ }3+12*X\^{ }2+16*X+16

\end{lyxcode}

You can evaluate the polynomials like functions, as well as compute the
derivate polynomial.

\begin{lyxcode}
>p(2)

~12

>p'

~2*X+2

>p'(2)

~6
\end{lyxcode}

With this arithmetics you may easily compute powers of polynomial
expressions or compute shifted polynomials:

\begin{lyxcode}
>q=(3-X)\^{ }4

~X\^{ }4-12*X\^{ }3+54*X\^{ }2-108*X+81

>q(X+2)

~X\^{ }4-4*X\^{ }3+6*X\^{ }2-4*X+1
\end{lyxcode}

For polynomials the evaluation, derivation, addition, substraction,
equality, inequality and powering by an integer are defined.