Basic Operations on Polynomials
You create polynomials using the usual operations of
+,
-,
*
(for multiplication), and
** (or
^. Here are two examples:
These operations can also be used to combine polynomials. Try the following:
As you can see from the above examples, the variables are ordered by defaults
z > y > x > c > b > a
That is, z is the main variable, then y and so on in reverse alphabetical
order. You can redefine this ordering (for display purposes) with the
setVariableOrder. For example, the
following makes a the main variable, then b, and so on:
Now compare the way polynomials are displayed:
To return to the system's default ordering, use
resetVariableOrder.
Polynomial coefficients can be pulled out using the function
coefficient. For example:
will give you the coefficient of x**2 in the polynomial q. Try these
commands:
Coefficients of monomials can be obtained as follows:
This will return the coefficient of x**2*z in the polynomial q**2. Also,
will return the coefficient of x**2*y**2 in the polynomial r(x,y).