P.6. Polynomial Arithmetic
Arithmetic may be performed on polynomials, i.e. polynomials may be added, subtracted, multiplied, and divided, just like numbers. If two polynomials are added, subtracted, or multiplied, the result is a new polynomial. However, if one polynomial is divided by another, the result is in general not a polynomial but a more complicated expression known as a rational expression.
So how does one perform arithmetic on polynomials? First we consider univariate polynomials. Adding and subtracting univariate polynomials are easy; one merely adds or subtracts each of the corresponding coefficients. For instance, the sum of the polynomials 3x2 + 5x + 6 and 2x2 + 8x - 5 is 5x2 + 13x + 1 and their difference is x2 - 3x + 11. Multiplying and dividing univariate polynomials are more complicated, but these operations are performed similarly to long multiplication and long division respectively. For example, to compute the product of the linear polynomials 2x + 5 and 3x - 7, we first write the coefficients of each polynomial on two lines, one below the other, as follows:
Next we perform long multiplication on these lists of coefficients as follows:
Thus the product of 2x + 5 and 3x - 7 is 6x2 + x - 35.
Division is the most complicated arithmetic operation, but a couple of examples should suffice to show how it is performed. First consider the polynomials x2 + 5x + 10 and x + 3. We divide these polynomials as follows:
Thus we find (x2 + 5x + 10) / (x + 3) = (x + 2) + 4 / (x + 3). In this expression, the polynomial x + 2 is known as the quotient of the polynomials x2 + 5x + 10 and x + 3 and 4 is known as the remainder.
As a more complicated example, we compute the quotient and remainder of the polynomials x4 + 5x3 + 6x2- 4x + 11 and x2 - 3x + 1. The long division now looks as follows:
Thus we find (x4 + 5x3 + 6x2- 4x + 11) / (x2 - 3x + 1) = (x2 + 8x + 29) + (75x - 18) / (x2 - 3x + 1).
Multivariate polynomial arithmetic is performed in much the same way as univariate polynomial arithmetic. Addition and subtraction are performed by adding or subtracting coefficients of like monomials, as illustrated in the following example:
Example 1: Compute the sum and difference of 3x2 + 5xy - 8y2 + 4x - 3y + 12 and x3 + 6y2 - 15x + 11.
Solution: The like monomials are y2, x, and 1. Adding the corresponding coefficients of these monomials, we obtain -2y2,-11x, and 23. Copying down the other monomials from each polynomial, we obtain the sum x3 + 3x2 + 5xy - 2y2 -11x -3y + 23. Similarly, we find their difference is -x3 + 3x2 + 5xy - 14y2 + 19x - 3y + 1.
Multivariate polynomial multiplication is performed by cross-multiplying all pairs of terms of each polynomial, as illustrated by the following example.
Example 2: Compute the product of the multivariate polynomials 2x + 3y - 5 and x - 4y + 1.
Solution: Since each polynomial has three terms, there are a total of nine cross-multipications. We have
(2x + 3y - 5)(x -4y + 1) = 2x2 + 3xy - 5x - 8xy - 12y2 + 20y + 2x + 3y - 5.
Collecting coefficients of like monomials, we find the product is 2x2 - 5xy - 12y2 - 3x + 23y - 5.
Division is the most complicated arithmetic operation on multivariate polynomials and the result is in general not a polynomial. We will skip this operation.