Polynomial arithmetic

Given a single indeterminate, say $x$, a term is a real coefficient multiplying a non-negative integer power of the indeterminate. For example, $3.7$, $5.2x$, $-3.5x^2$ and $958.102x^{42}$ are all terms.

A polynomial is a sum of zero or more terms. If no terms are added, the polynomial is the zero polynomial. If all the terms have the same power of the indeterminate, the polynomial is said to be a monomial.

If two or more terms have the same power of the indeterminate, the distributive law can be used to combine the two terms into a single term; for example $ax^k + bx^k = (a + b)x^k$, so $3.5x^4 + (-8.7x^4) = (3.5 - 8.7)x^4 = -5.2x^4$. It is usual to write $3.5x^4 + (-8.7x^4)$ as $3.5x^4 - 8.7x^4$.

A polynomial is in normal form if there is only one term for each power of the indeterminate, and the terms are ordered from highest power to lowest power.

The coefficient of a non-negative integer power of the indeterminate of a polynomial that is in normal form is the coefficient of the term that has that power, and zero otherwise.

The leading term of a polynomial in normal form is the term with the highest non-negative integer power of the indeterminate, while the leading coefficient is the coefficient of the leading term.

If the leading coefficient is $1$, the polynomial is said to be a monic polynomial.

The degree of a polynomial is the highest power of the indeterminate that has a non-zero coefficient.

  • The degree of the zero polynomial is assigned the degree $-\infty$.
  • If all powers of the indeterminate are zero, the polynomial is a constant, and as such, it is described as a constant polynomial and the degree is zero. Examples of constant polynomials are $3.7$ and $-8.5$.
  • If the degree of the polynomial is one, it is described as a linear polynomial. Examples of linear polynomials include $5.3x - 2.3$ and $-7.1x$.

Polynomials with degrees two, three, four and five are called quadratic, cubic, quartic and quintic polynomials, respectively.

Adding polynomials with equal degree

Describe an algorithm that adds two polynomials $p$ and $q$ that are in normal form and both have the same degree so that the sum $p + q$ continues to be in normal form.

Adding polynomials with different degrees

Describe an algorithm that adds two polynomials $p$ and $q$ that are in normal form but where the degrees of the two polynomials are unequal. Again, the result $p + q$ should be in normal form.

Multiplying a polynomial by a scalar

If $b$ is a real number and $p$ is a polynomial, then $bp$ sees every coefficient of each term in that polynomial multiplied by $b$. Thus, for example, 2.5\cdot(x^2 - 3.3x + 2.1) = 2.5x^2 - 8.25x + 5.25$.

If you plot $p$ and $bp$, you will see why it is called a scalar, as it scales the polynomial. $2p$ is twice as large for every value of $x$, and $0.1p$ is one tenth as large.

Describe an algorithm for multiplying a polynomial by a scalar.

As a special case, what occurs if we add $p + (-1)p$; that is, we add the polynomial $p$ onto itself multiplied by the scalar $-1$.

Converting a polynomial to a monic polynomial

Describe an algorithm for converting a polynomial $p$ into a monic polynomial such that the roots of the polynomial are all the same as the roots of the monic polynomial.

Subtracting a polynomial from another

Describe an algorithm for subtracting a polynomial $q$ from a polynomial $p$.

Differentiating a polynomial

Describe an algorithm for determining the derivative of polynomial that is in normal form.