Polynomial Addition and Multiplication
 Kenneth Levasseur
Mathematical Sciences
UMass Lowell
Kenneth_Levasseur@uml.edu
Calculations done here use AbstractAlgebra a Mathematica package available at http://www.central.edu/eaam/index.asp
 ![Needs["AbstractAlgebra`Master`"] ; SwitchStructureTo[Ring] ;](HTMLFiles/PolyOps_1.gif) 
 You add and  multiply polynomials over an arbitrary ring the same way you learned to do it for polynomials over the real number in high school algebra.  The only thing you have to keep in mind is that the coefficient operations use the underlying operations for the ring over which you are working.  For example,  if you working with polynomials over  then adding
  then adding  and
  and  involved adding "like terms" and the result is
 involved adding "like terms" and the result is   
 
Addition
 Given two polynomials
    
    
    
Their sum is the polynomial
     
 You just add corresponding coefficients to add.   Notice that we didn't specify exactly where either two of  and
 and  "stop" but eventually the coefficients of both are zero and the number of additions in the underlying ring is no more than the largest degree of the two addends.
 "stop" but eventually the coefficients of both are zero and the number of additions in the underlying ring is no more than the largest degree of the two addends.
Example
 ![P = PolynomialsOver[Z[5]] a = Poly[Z[5],   2 + 4x + 3x^2 + x^3] b = Poly[Z[5], 1 + 2x + 4x^3 + 4 x^4]](HTMLFiles/PolyOps_11.gif) 
 ![-Ring of Polynomials over Z[5]-](HTMLFiles/PolyOps_12.gif) 
  
  
 ![Addition[P][a, b]](HTMLFiles/PolyOps_15.gif) 
  
Multiplication
 Given two polynomials of degree m and  n, respectively
    
    
    
Their product is the polynomials is computed by multiplying all of the terms in the first polynomial by each term in the second.  This involves multiplying powers of the indeterminate x, which follows the rule    , where the addition
, where the addition  is of integers, not in the underlying ring.   If we organize our results the product follows a regular pattern, but somewhat more complicated than for addition.
 is of integers, not in the underlying ring.   If we organize our results the product follows a regular pattern, but somewhat more complicated than for addition.
    ![a(x)   b(x) = (a_0 … b_0) + (a_0 … b_1 + a_1 … b_0) x + (a_0 … b_2 + a_1 … b_1 + a_2 ... Underoverscript[∑, k = 0, arg3] (Underoverscript[∑, j = 0, arg3] a_j … b_ (k - j)) x^k](HTMLFiles/PolyOps_21.gif) 
 In both of the formulae above it should be understood that coefficients with index higher than the respective degrees are equal to the zero of the underlying ring.    Notice that for each term in the product the coefficient of  is the sum of products of coefficients whose indices add up to k.
 is the sum of products of coefficients whose indices add up to k.   
In multiplying polynomials of degree m and n, the number of multiplications involving nonzero coefficients can be as high as  
Example
This product isn't as easy to see as the sum above. Work out a few coefficients to check the result.
 ![P {a, b} Multiplication[P][a, b]](HTMLFiles/PolyOps_24.gif) 
 ![-Ring of Polynomials over Z[5]-](HTMLFiles/PolyOps_25.gif) 
  
  
 Here's why we will usually work with polynomials over a field.  The following strange things don't happen if a ring doesn't have zero divisors as  has.
 has.
 ![Q = PolynomialsOver[Z[4]]](HTMLFiles/PolyOps_29.gif) 
 ![-Ring of Polynomials over Z[4]-](HTMLFiles/PolyOps_30.gif) 
 ![s = Poly[Z[4], 2 x] t = Poly[Z[4], 2x + 1]](HTMLFiles/PolyOps_31.gif) 
  
  
A zero divisor among the polynomials
 ![Multiplication[Q][s, s]](HTMLFiles/PolyOps_34.gif) 
  
Here we see that t is a unit, which isn't bad; but normally we expect the degree of a product to be the sum of degrees, but not in this polynomial ring.
 ![Multiplication[Q][t, t]](HTMLFiles/PolyOps_36.gif) 
  
 Over a field this strange result never occurs  the product of two linear polynomials is always a quadratic polynomial.
 the product of two linear polynomials is always a quadratic polynomial.
Created by Mathematica (September 13, 2005)